le1t0-whenever 0.4.2.002 → 0.4.2.003

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.4.2.003 / Jul 5th, 2010
2
+
3
+ * fixed adding per-cronjob environment variables
4
+
1
5
  == 0.4.2.002 / May 18th, 2010
2
6
 
3
7
  * Added setting environment variables per cron job
@@ -11,22 +11,26 @@ module Whenever
11
11
  @output_redirection = opts.delete(:output) || :not_set
12
12
  @environment = opts.delete(:environment) || :production
13
13
  @path = opts.delete(:path) || Whenever.path
14
- @envvars = opts
14
+ @envvars = envvars(opts)
15
15
  end
16
16
 
17
17
  def output
18
18
  envvars + task
19
19
  end
20
20
 
21
- def envvars
22
- if @envvars.is_a?(Array)
23
- @envvars.keys.select do |key|
24
- key.to_sym != :RAILS_ENV
21
+ def envvars(opts=nil)
22
+ return @envvars if opts.nil?
23
+ env_vars = opts
24
+ if env_vars.is_a?(Hash)
25
+ env_vars.keys.select do |key|
26
+ key.to_sym != :RAILS_ENV && key.to_s =~ /^[A-Z_]+$/
25
27
  end.collect do |key|
26
- "#{key}=#{@envvars[key]}"
28
+ "#{key}=#{env_vars[key]}"
27
29
  end.join(' ') + ' '
30
+ elsif env_vars.is_a?(Array)
31
+ env_vars.join(' ') + ' '
28
32
  else
29
- @envvars.nil? ? '' : @envvars.to_s + ' '
33
+ env_vars.to_s + ' '
30
34
  end
31
35
  end
32
36
 
@@ -38,4 +42,4 @@ module Whenever
38
42
 
39
43
  end
40
44
  end
41
- end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Whenever
2
- VERSION = '0.4.2.002'
2
+ VERSION = '0.4.2.003'
3
3
  end unless defined?(Whenever::VERSION)
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 4
8
8
  - 2
9
- - 2
10
- version: 0.4.2.002
9
+ - 3
10
+ version: 0.4.2.003
11
11
  platform: ruby
12
12
  authors:
13
13
  - Le1t0
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-18 00:00:00 +02:00
18
+ date: 2010-07-05 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency