Skip to content

Commit

Permalink
Support passing RAILS_VERSION for development
Browse files Browse the repository at this point in the history
Move dynamic development dependencies to Gemfile
  • Loading branch information
avit committed Jan 19, 2017
1 parent ba34f0d commit 6bda692
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 9 additions & 1 deletion Gemfile
@@ -1,3 +1,11 @@
source 'https://rubygems.org'
gemspec

gemspec
compatible_rails_versions = [
'>= 3.0.0',
('<5' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2'))
].compact

gem 'activesupport', (ENV['RAILS_VERSION'] || compatible_rails_versions), require: false
gem 'i18n', require: false
gem 'tzinfo', require: false # only needed explicitly for RAILS_VERSION=3
3 changes: 0 additions & 3 deletions ice_cube.gemspec
Expand Up @@ -19,7 +19,4 @@ Gem::Specification.new do |s|

s.add_development_dependency('rake')
s.add_development_dependency('rspec', '~> 2.12.0')
s.add_development_dependency('activesupport', ['>= 3.0.0', ('<5' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2'))].compact)
s.add_development_dependency('tzinfo')
s.add_development_dependency('i18n')
end
2 changes: 2 additions & 0 deletions spec/examples/active_support_spec.rb
@@ -1,5 +1,7 @@
require File.dirname(__FILE__) + '/../spec_helper'
require 'active_support/time'
require 'active_support/version'
require 'tzinfo' if ActiveSupport::VERSION::MAJOR == 3


module IceCube
Expand Down

0 comments on commit 6bda692

Please sign in to comment.