Permalink
Browse files

Merge pull request #93 from ifarkas/ruby2.0

Add Ruby 2.0 support to RubyGettextExtractor module
  • Loading branch information...
2 parents 2be26b6 + b659be9 commit 3a130c8c11e7d9b48150d332d4aa61a2b2cd65a2 @grosser committed Mar 22, 2013
Showing with 16 additions and 10 deletions.
  1. +1 −0 .travis.yml
  2. +11 −3 Appraisals
  3. +1 −1 Gemfile
  4. +1 −1 Gemfile.lock
  5. +2 −5 lib/gettext_i18n_rails/ruby_gettext_extractor.rb
View
@@ -2,3 +2,4 @@ rvm:
- ree
- 1.9.2
- 1.9.3
+ - 2.0.0
View
@@ -1,5 +1,13 @@
-['2.3', '3.0', '3.1', '3.2'].each do |version|
- appraise "rails.#{version}" do
- gem "rails", "~>#{version}.0"
+if RUBY_VERSION =~ /^2\.0/
+ ['3.0', '3.1', '3.2'].each do |version|
+ appraise "rails.#{version}" do
+ gem "rails", "~>#{version}.0"
+ end
+ end
+else
+ ['2.3', '3.0', '3.1', '3.2'].each do |version|
+ appraise "rails.#{version}" do
+ gem "rails", "~>#{version}.0"
+ end
end
end
View
@@ -1,4 +1,4 @@
-source :rubygems
+source 'http://rubygems.org'
gemspec
gem 'appraisal'
View
@@ -5,7 +5,7 @@ PATH
fast_gettext (>= 0.4.8)
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
actionmailer (3.2.11)
actionpack (= 3.2.11)
@@ -12,13 +12,10 @@ def parse(file, targets = []) # :nodoc:
def parse_string(content, file, targets=[])
# file is just for information in error messages
- case RUBY_VERSION
- when /^1\.8/ then
+ if RUBY_VERSION =~ /^1\.8/
parser = Extractor18.new(file, targets)
- when /^1\.9/ then
- parser = Extractor19.new(file, targets)
else
- raise "unrecognized RUBY_VERSION #{RUBY_VERSION}"
+ parser = Extractor19.new(file, targets)
end
parser.run(content)
end

0 comments on commit 3a130c8

Please sign in to comment.