Project

General

Profile

Refactor #21359

Remove legacy code for Ruby < 2.0 from hammer-cli

Added by Tomáš Strachota about 1 year ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
-
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

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

From my search there's following places containing some compatibility code that should be removed:

./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


Related issues

Related to Hammer CLI - Refactor #21360: Remove legacy code for Ruby <= 2.0 from hammer-cli-foremanClosed
Related to Hammer CLI - Refactor #22549: Remove legacy Gemfile code for Ruby < 2.0Closed2018-02-12

Associated revisions

Revision 4b0e6e3e (diff)
Added by d-m-u about 2 months ago

Fixes #21359

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

History

#1 Updated by Tomáš Strachota about 1 year ago

  • Description updated (diff)

#2 Updated by Tomáš Strachota about 1 year ago

  • Description updated (diff)

#3 Updated by Tomáš Strachota about 1 year ago

  • Related to Refactor #21360: Remove legacy code for Ruby <= 2.0 from hammer-cli-foreman added

#4 Updated by Tomáš Strachota 10 months ago

  • Related to Refactor #22549: Remove legacy Gemfile code for Ruby < 2.0 added

#5 Updated by Tomáš Strachota 10 months ago

  • Description updated (diff)

#6 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/269 added

#7 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/hammer-cli/pull/285 added

#8 Updated by Oleh Fedorenko 3 months ago

  • Assignee set to Oleh Fedorenko

#9 Updated by Anonymous about 2 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF