Skip to content
This repository

Make it work with ActiveSupport >= 2.3.2 instead of >= 2.3.4 #217

Closed
wants to merge 3 commits into from

2 participants

Jonathan Tron Javan Makhmali
Jonathan Tron

No description provided.

Javan Makhmali javan commented on the diff
.travis.yml
((5 lines not shown))
  9 + - jruby-head
  10 +gemfile:
1
Javan Makhmali Owner
javan added a note

Neat! Didn't know Travis could do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Javan Makhmali javan commented on the diff
lib/whenever/job_list.rb
@@ -130,7 +130,7 @@ def cron_jobs
130 130 Whenever::Output::Cron.output(time, job) do |cron|
131 131 cron << "\n\n"
132 132
133   - if cron.starts_with?("@")
  133 + if cron.start_with?("@")
2
Javan Makhmali Owner
javan added a note

Oh man, start_with reads like broken english. I think I'd rather just use a regex here.

Indeed, but this method exists in both ruby 1.8.7 and 1.9.x without having to require 'active_support/core_ext'.
If you want I can change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Javan Makhmali javan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
8 .travis.yml
@@ -6,4 +6,10 @@ rvm:
6 6 - jruby
7 7 - jruby-18mode
8 8 - jruby-19mode
9   - - jruby-head
  9 + - jruby-head
  10 +gemfile:
  11 + - Gemfile
  12 + - ci/Gemfile-AS-2_3_2
  13 + - ci/Gemfile-AS-3_0_0
  14 + - ci/Gemfile-AS-3_1_0
  15 + - ci/Gemfile-AS-3_2_0
4 ci/Gemfile-AS-2_3_2
... ... @@ -0,0 +1,4 @@
  1 +source "http://rubygems.org"
  2 +
  3 +gem "activesupport", "2.3.2"
  4 +gemspec :path=>"../"
4 ci/Gemfile-AS-2_3_4
... ... @@ -0,0 +1,4 @@
  1 +source "http://rubygems.org"
  2 +
  3 +gem "activesupport", "2.3.4"
  4 +gemspec :path=>"../"
4 ci/Gemfile-AS-3_0_0
... ... @@ -0,0 +1,4 @@
  1 +source "http://rubygems.org"
  2 +
  3 +gem "activesupport", "3.0.0"
  4 +gemspec :path=>"../"
4 ci/Gemfile-AS-3_1_0
... ... @@ -0,0 +1,4 @@
  1 +source "http://rubygems.org"
  2 +
  3 +gem "activesupport", "3.1.0"
  4 +gemspec :path=>"../"
4 ci/Gemfile-AS-3_2_0
... ... @@ -0,0 +1,4 @@
  1 +source "http://rubygems.org"
  2 +
  3 +gem "activesupport", "3.2.0"
  4 +gemspec :path=>"../"
8 lib/whenever.rb
... ... @@ -1,5 +1,11 @@
1 1 require 'thread'
2   -require 'active_support/all'
  2 +require 'active_support/version'
  3 +
  4 +if ActiveSupport::VERSION::STRING >= "3.0.0"
  5 + require "active_support/time"
  6 +else
  7 + require "active_support"
  8 +end
3 9
4 10 module Whenever
5 11 autoload :JobList, 'whenever/job_list'
4 lib/whenever/job_list.rb
@@ -39,7 +39,7 @@ def every(frequency, options = {})
39 39 end
40 40
41 41 def job_type(name, template)
42   - class_eval do
  42 + JobList.class_eval do
43 43 define_method(name) do |task, *args|
44 44 options = { :task => task, :template => template }
45 45 options.merge!(args[0]) if args[0].is_a? Hash
@@ -130,7 +130,7 @@ def cron_jobs
130 130 Whenever::Output::Cron.output(time, job) do |cron|
131 131 cron << "\n\n"
132 132
133   - if cron.starts_with?("@")
  133 + if cron.start_with?("@")
134 134 shortcut_jobs << cron
135 135 else
136 136 regular_jobs << cron
2  whenever.gemspec
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17 17 s.require_paths = ["lib"]
18 18
19 19 s.add_dependency "chronic", "~> 0.6.3"
20   - s.add_dependency "activesupport", ">= 2.3.4"
  20 + s.add_dependency "activesupport", ">= 2.3.2"
21 21
22 22 s.add_development_dependency "shoulda", ">= 2.1.1"
23 23 s.add_development_dependency "mocha", ">= 0.9.5"

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.