Skip to content

Commit

Permalink
ActiveSupport < 4.2.1 compat
Browse files Browse the repository at this point in the history
Avoid using Hash#transform_keys. #143
  • Loading branch information
glebm committed Apr 11, 2015
1 parent 51dbdc8 commit e8b8c0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/i18n/tasks/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def context
end

def commands
@commands ||= ::I18n::Tasks::Commands.cmds.transform_keys { |k| k.to_s.tr('_', '-') }
@commands ||= ::I18n::Tasks::Commands.cmds.dup.tap do |cmds|
# Hash#transform_keys is only available since activesupport v4.2.1
cmds.keys.each { |k| cmds[k.to_s.tr('_', '-')] = cmds.delete(k) }
end
end

private
Expand Down

0 comments on commit e8b8c0e

Please sign in to comment.