Project

General

Profile

Refactor #21359

Updated by Tomáš Strachota over 6 years ago

Hammer no longer supports ruby 2.0, there's no point of keeping the historical code. 

 From my search there's folowing places that containing some compatibility code that should be removed: 
 <pre> 
 ./hammer/hammer-cli/lib/hammer_cli/utils.rb: 
     2    class String 
     3   
     4:     # string formatting for ruby 1.8 
     5      def format(params) 
     6        if params.is_a? Hash 

 ./hammer/hammer-cli/lib/hammer_cli/output/adapter/csv.rb: 
     1    require 'csv' 
     2    if CSV.const_defined? :Reader 
     3:     # Ruby 1.8 compatible 
     4      require 'fastercsv' 
     5      Object.send(:remove_const, :CSV) 
     6      CSV = FasterCSV 
     7    else 
     8:     # CSV is now FasterCSV in ruby 1.9 
     9    end 
    10   

 ./hammer/hammer-cli/test/unit/history_test.rb: 
     4   
     5      before :each do 
     6:       # Readline::HISOTRY does not implement #clear in Ruby 1.8 
     7        while not Readline::HISTORY.empty? 
     8          Readline::HISTORY.pop 

 ./hammer/hammer-cli/test/unit/i18n_test.rb: 
    41      let(:unavailable_domain) { TestLocaleDomain.new('domain3', false) } 
    42   
    43:     # skip the tests on older versions of fast_gettext (ruby 2.0) 
    44      if FastGettext::VERSION >= '1.2.0' 
    45        describe "with fast_gettext >= 1.2.0" do 

 ./hammer/hammer-cli/Gemfile: 
     4   
     5    gem 'gettext', '>= 3.1.3', '< 4.0.0' 
     6: if RUBY_VERSION < '2.1.0' 
     7      gem 'clamp', '< 1.1.0' 
     8      gem 'fast_gettext', '< 1.2.0' 
 </pre>

Back