multi_scheduler 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDY0NDIwNmEzMjJmYjYzMTVhMzM3Y2MxYmIzZjAxYTI0MjQ5Zjk2Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDc0NGM4NDhmZDAzYTUyMzczZWM0MGJhOGYxYTQ2M2I2MzE5MjVjNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWE2YjQxOTE0OWIzYjAyMjgyYmU4OTk5OTliY2MyYTVjZGVhMzkyNzY5OGY2
|
10
|
+
MjlkZDM3MWFjNTlhZGUyMTg0YjMyMzRmNGI5YTk4MmVjNDI4ZGU4NzE0MmM0
|
11
|
+
ODM5OGJmZGIxOTQ0NzZmN2UwZDI4N2JkODY5OTUwYzAzYTU0YmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTA4ZjQ0ZGY0MzliNDE0MzgwOTI0OGZlYTNhOTQwZWRjNTNiYzUzMGM0M2I1
|
14
|
+
N2VhODdmNTIxZDE4ZThmMWIxMTBjMDQzZGMxYzdkYWFmOTllZDgxZmE0NzZm
|
15
|
+
MjM3YWIwNzUyYTI0YWEzNzFkMDM4Yjc3NGZmODlkYmMzMTAyODM=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/multi_scheduler.rb
CHANGED
@@ -1,36 +1,17 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
module MultiScheduler
|
4
|
-
VERSION = '0.1.
|
4
|
+
VERSION = '0.1.2'
|
5
5
|
|
6
6
|
def self.schedule id, options = {}
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def self.unschedule id, options = {}
|
11
|
-
scheduler(id, options).stop
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.scheduler id, options = {}
|
15
|
-
case RbConfig::CONFIG['host_os']
|
7
|
+
host_os = RbConfig::CONFIG['host_os']
|
8
|
+
case host_os
|
16
9
|
when /darwin/i
|
17
10
|
Launchd.new id, options
|
18
|
-
|
11
|
+
when /linux/i
|
19
12
|
Whenever.new id, options
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
class Scheduler
|
26
|
-
|
27
|
-
def initialize id, options = {}
|
28
|
-
|
29
|
-
@identifier = id
|
30
|
-
raise "identifier is required" unless @identifier
|
31
|
-
|
32
|
-
@command_arguments = [ options[:args] ].flatten.compact
|
33
|
-
@command = options[:command] || @command_arguments.shift
|
13
|
+
else
|
14
|
+
raise "Unsupported host operating system '#{host_os}'"
|
34
15
|
end
|
35
16
|
end
|
36
17
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
module MultiScheduler
|
3
|
+
|
4
|
+
class Schedule
|
5
|
+
attr_reader :identifier, :command, :command_arguments
|
6
|
+
|
7
|
+
def initialize id, options = {}
|
8
|
+
|
9
|
+
@identifier = id
|
10
|
+
raise "identifier is required" unless @identifier
|
11
|
+
|
12
|
+
@command_arguments = [ options[:args] ].flatten.compact
|
13
|
+
@command = options[:command] || @command_arguments.shift
|
14
|
+
raise "command is required" unless @command
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Dir[File.join File.dirname(__FILE__), File.basename(__FILE__, '.*'), '*.rb'].each{ |lib| require lib }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AlphaHydrae
|
@@ -150,8 +150,9 @@ files:
|
|
150
150
|
- README.md
|
151
151
|
- VERSION
|
152
152
|
- lib/multi_scheduler.rb
|
153
|
-
- lib/multi_scheduler/
|
154
|
-
- lib/multi_scheduler/
|
153
|
+
- lib/multi_scheduler/schedule.rb
|
154
|
+
- lib/multi_scheduler/schedule/launchd.rb
|
155
|
+
- lib/multi_scheduler/schedule/whenever.rb
|
155
156
|
homepage: http://github.com/AlphaHydrae/multi_scheduler
|
156
157
|
licenses:
|
157
158
|
- MIT
|