Permalink
Browse files

Merge pull request #626 from javan/feature/nowarnings

Warning-free
  • Loading branch information...
2 parents 0d1669f + fb95a73 commit 075afb22a0f681ae5d2c4289b78e71527284bfe7 @benlangfeld benlangfeld committed on GitHub Dec 14, 2016
Showing with 10 additions and 3 deletions.
  1. +1 −1 lib/whenever/command_line.rb
  2. +8 −1 lib/whenever/job_list.rb
  3. +1 −1 test/functional/command_line_test.rb
@@ -56,7 +56,7 @@ def whenever_cron
end
def read_crontab
- return @current_crontab if @current_crontab
+ return @current_crontab if instance_variable_defined?(:@current_crontab)
command = [@options[:crontab_command]]
command << '-l'
@@ -30,10 +30,17 @@ def set(variable, value)
return if @pre_set_variables[variable]
instance_variable_set("@#{variable}".to_sym, value)
- self.class.send(:attr_reader, variable.to_sym)
@set_variables[variable] = value
end
+ def method_missing(name, *args, &block)
+ @set_variables.has_key?(name) ? @set_variables[name] : super
+ end
+
+ def self.respond_to?(name, include_private = false)
+ @set_variables.has_key?(name) || super
+ end
+
def env(variable, value)
@env[variable.to_s] = value
end
@@ -175,7 +175,7 @@ class CommandLineUpdateWithNoIdentifierTest < Whenever::TestCase
setup do
File.expects(:exist?).with('config/schedule.rb').returns(true)
Whenever::CommandLine.any_instance.expects(:default_identifier).returns('DEFAULT')
- @command = Whenever::CommandLine.new(:update => true, :file => @file)
+ @command = Whenever::CommandLine.new(:update => true)
end
should "use the default identifier" do

0 comments on commit 075afb2

Please sign in to comment.