diff --git a/.gitignore b/.gitignore index 7ae5b54..b236e19 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ tmtags ## PROJECT::GENERAL coverage rdoc +Gemfile.lock pkg/* *.gem .bundle diff --git a/Gemfile b/Gemfile index 0a5465e..d1715ca 100644 --- a/Gemfile +++ b/Gemfile @@ -2,8 +2,3 @@ source 'http://rubygems.org/' # Specify your gem's dependencies in time_ext.gemspec gemspec - -group :development do - gem 'rspec', '>= 2.1.0' - gem 'yard', '>= 0.6.3' -end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index f6dec94..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,32 +0,0 @@ -PATH - remote: . - specs: - time_ext (0.2.7) - activesupport (>= 2.3.0) - i18n (>= 0.4.2) - -GEM - remote: http://rubygems.org/ - specs: - activesupport (3.0.3) - diff-lcs (1.1.2) - i18n (0.4.2) - rspec (2.1.0) - rspec-core (~> 2.1.0) - rspec-expectations (~> 2.1.0) - rspec-mocks (~> 2.1.0) - rspec-core (2.1.0) - rspec-expectations (2.1.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.1.0) - yard (0.6.3) - -PLATFORMS - ruby - -DEPENDENCIES - activesupport (>= 2.3.0) - i18n (>= 0.4.2) - rspec (>= 2.1.0) - time_ext! - yard (>= 0.6.3) diff --git a/README.md b/README.md index b3a3228..0782324 100644 --- a/README.md +++ b/README.md @@ -99,5 +99,5 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [as]: http://as.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Calculations.html -[docs]: http://rdoc.info/projects/jimeh/time_ext +[docs]: http://rdoc.info/gems/time_ext/frames [rdoc.info]: http://rdoc.info/ \ No newline at end of file diff --git a/lib/time_ext.rb b/lib/time_ext.rb index 3544f1e..73b975e 100644 --- a/lib/time_ext.rb +++ b/lib/time_ext.rb @@ -1,8 +1,4 @@ require 'rubygems' -require 'active_support' - -# support both Active Support 2.x and 3.x -require 'active_support/time' if !Time.respond_to?(:days_in_month) require 'time_ext/calculations' require 'time_ext/iterations' diff --git a/lib/time_ext/core_ext/numeric.rb b/lib/time_ext/core_ext/numeric.rb index e7c112c..5f31973 100644 --- a/lib/time_ext/core_ext/numeric.rb +++ b/lib/time_ext/core_ext/numeric.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/numeric/time' unless Numeric.new.respond_to?(:seconds) # fixes rare loading issue + class Numeric alias :sec :seconds alias :min :minutes diff --git a/lib/time_ext/core_ext/time.rb b/lib/time_ext/core_ext/time.rb index aa5c599..c3ca9ed 100644 --- a/lib/time_ext/core_ext/time.rb +++ b/lib/time_ext/core_ext/time.rb @@ -1,3 +1,7 @@ +require 'active_support' +require 'active_support/time' unless Time.respond_to?(:days_in_month) # support both Active Support 2.x and 3.x +require 'active_support/core_ext/time/calculations' unless Time.new.respond_to?(:ago) # fixes rare loading issue + class Time include TimeExt::Support include TimeExt::Calculations diff --git a/lib/time_ext/version.rb b/lib/time_ext/version.rb index 4f22656..b9f91fd 100644 --- a/lib/time_ext/version.rb +++ b/lib/time_ext/version.rb @@ -1,3 +1,3 @@ module TimeExt - VERSION = "0.2.8" + VERSION = "0.2.9" end diff --git a/time_ext.gemspec b/time_ext.gemspec index 8bf27f0..fc32bd8 100644 --- a/time_ext.gemspec +++ b/time_ext.gemspec @@ -19,6 +19,11 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_runtime_dependency 'activesupport', '>= 2.3.0' + s.add_runtime_dependency 'activesupport', '>= 2.3.2' s.add_runtime_dependency 'i18n', '>= 0.4.2' + + s.add_development_dependency 'rake', '>= 0.8.7' + s.add_development_dependency 'rspec', '>= 2.1.0' + s.add_development_dependency 'yard', '>= 0.6.3' + s.add_development_dependency 'ruby-debug' end