winever 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -57,6 +57,13 @@ then remove the :path (leaving the pipes around it intact).
57
57
  As of right now the only type of schedule that is supported are the daily ones (run once per day, at a specific time, every day).
58
58
  Pull requests welcomed to add more, cron_time.rb and test_cron_time.rb should be the only files needing edit for that.
59
59
 
60
+ ## Limitations/warnings
61
+
62
+ * As mentioned previously, only once-per-day-everyday tasks are supported.
63
+ * Since RVM doesn't support windows, the tasks will call the global executables. Meaning if you have multiple Ruby installed, the first executable found on the PATH will be used.
64
+ * Windows may not deal with single and double quotes in the same way as Linux. This is especially apparent when using `bundle exec` before the actual command, which happens automatically for rake and script tasks. Whenever possible, use the single quote. If you don't, make sure to test on both environment that the behavior is as expected.
65
+
66
+
60
67
  ## Contributing
61
68
 
62
69
  1. Fork it
@@ -1,30 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'winever'
4
- require 'optparse'
5
-
6
- options = {}
7
-
8
- OptionParser.new do |opts|
9
- opts.banner = "Usage: whenever [options]"
10
- opts.on('-i', '--update [identifier]', 'Default: full path to schedule.rb file') do |identifier|
11
- options[:update] = true
12
- options[:identifier] = identifier if identifier
13
- end
14
- opts.on('-c', '--clear [identifier]') do |identifier|
15
- options[:clear] = true
16
- options[:identifier] = identifier if identifier
17
- end
18
- opts.on('-s', '--set [variables]', 'Example: --set \'environment=staging&path=/my/sweet/path\'') do |set|
19
- options[:set] = set if set
20
- end
21
- opts.on('-f', '--load-file [schedule file]', 'Default: config/schedule.rb') do |file|
22
- options[:file] = file if file
23
- end
24
- opts.on('-k', '--cut [lines]', 'Cut lines from the top of the cronfile') do |lines|
25
- options[:cut] = lines.to_i if lines
26
- end
27
- opts.on('-v', '--version') { puts "Winever v#{Winever::VERSION}"; exit(0) }
28
- end.parse!
29
-
30
- Winever::CommandLine.execute(options)
4
+ Winever::CommandLine.run_from_command_line_options
@@ -1,5 +1,36 @@
1
1
  module Winever
2
2
  class CommandLine
3
+
4
+ def self.run_from_command_line_options
5
+ require 'optparse'
6
+
7
+ options = {}
8
+
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: whenever [options]"
11
+ opts.on('-i', '--update [identifier]', 'Default: full path to schedule.rb file') do |identifier|
12
+ options[:update] = true
13
+ options[:identifier] = identifier if identifier
14
+ end
15
+ opts.on('-c', '--clear [identifier]') do |identifier|
16
+ options[:clear] = true
17
+ options[:identifier] = identifier if identifier
18
+ end
19
+ opts.on('-s', '--set [variables]', 'Example: --set \'environment=staging&path=/my/sweet/path\'') do |set|
20
+ options[:set] = set if set
21
+ end
22
+ opts.on('-f', '--load-file [schedule file]', 'Default: config/schedule.rb') do |file|
23
+ options[:file] = file if file
24
+ end
25
+ opts.on('-k', '--cut [lines]', 'Cut lines from the top of the cronfile') do |lines|
26
+ options[:cut] = lines.to_i if lines
27
+ end
28
+ opts.on('-v', '--version') { puts "Winever v#{Winever::VERSION}"; exit(0) }
29
+ end.parse!
30
+
31
+ self.execute(options)
32
+ end
33
+
3
34
  def self.execute options={}
4
35
  new(options).run
5
36
  end
@@ -8,6 +8,6 @@ if winever?
8
8
 
9
9
  job_type :command, ":task_folder|:task_name||:task :output"
10
10
  job_type :rake, ":task_folder|:task_name|:path|:bundle_command rake :task --silent :environment_variable=:environment :output"
11
- job_type :script, ":task_folder|:task_name|:path|:bundle_command script/:task :environment_variable=:environment :output"
12
- job_type :runner, ":task_folder|:task_name|:path|:runner_command -e :environment ':task' :output"
11
+ job_type :script, ":task_folder|:task_name|:path|:bundle_command ruby script/:task :environment_variable=:environment :output"
12
+ job_type :runner, ":task_folder|:task_name|:path|ruby :runner_command -e :environment ':task' :output"
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module Winever
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-15 00:00:00.000000000 Z
12
+ date: 2014-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: whenever
@@ -132,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  segments:
134
134
  - 0
135
- hash: -1691464168230782844
135
+ hash: -2498711773757809459
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  none: false
138
138
  requirements:
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  segments:
143
143
  - 0
144
- hash: -1691464168230782844
144
+ hash: -2498711773757809459
145
145
  requirements: []
146
146
  rubyforge_project:
147
147
  rubygems_version: 1.8.25