rukawa 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rukawa/cli.rb +5 -8
- data/lib/rukawa/configuration.rb +2 -1
- data/lib/rukawa/version.rb +1 -1
- data/lib/rukawa.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f4f1e22085cbcfcfafc854b03bc5538ee70044
|
4
|
+
data.tar.gz: 1644fab37cea4a2b001306a84641dbfb3a8da9e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08a3537bb614bec8ccff3e16443c44f72edae4cfa163821fbc7d2e0367081d4c689024be12c67895c59230024cc3ff6fbb44aae1056b3b7831599a6deeb912e2
|
7
|
+
data.tar.gz: bca2d4b61780f68ad08598f5e51d5f472438db4fb6dceb7f0d109242d461bd9bc69d19fdce337d9c6eea662e922d04a1a6b8a770167b590132023aff0ffa3cf8
|
data/lib/rukawa/cli.rb
CHANGED
@@ -111,6 +111,10 @@ module Rukawa
|
|
111
111
|
else
|
112
112
|
load default_config_file if File.exists?(default_config_file)
|
113
113
|
end
|
114
|
+
|
115
|
+
Rukawa.configure do |c|
|
116
|
+
c.job_dirs.concat(options[:job_dirs]) unless options[:job_dirs].empty?
|
117
|
+
end
|
114
118
|
end
|
115
119
|
|
116
120
|
def set_logger
|
@@ -138,15 +142,8 @@ module Rukawa
|
|
138
142
|
"./rukawa.rb"
|
139
143
|
end
|
140
144
|
|
141
|
-
def default_job_dirs
|
142
|
-
[File.join(Dir.pwd, "job_nets"), File.join(Dir.pwd, "jobs")]
|
143
|
-
end
|
144
|
-
|
145
145
|
def load_job_definitions
|
146
|
-
|
147
|
-
job_dirs.each do |dir|
|
148
|
-
Dir.glob(File.join(dir, "**/*.rb")) { |f| load f }
|
149
|
-
end
|
146
|
+
Rukawa.load_jobs
|
150
147
|
end
|
151
148
|
|
152
149
|
def get_class(name)
|
data/lib/rukawa/configuration.rb
CHANGED
@@ -11,7 +11,8 @@ module Rukawa
|
|
11
11
|
def initialize
|
12
12
|
@config = OpenStruct.new(
|
13
13
|
concurrency: Concurrent.processor_count,
|
14
|
-
dot_command: "dot"
|
14
|
+
dot_command: "dot",
|
15
|
+
job_dirs: [File.join(Dir.pwd, "job_nets"), File.join(Dir.pwd, "jobs")]
|
15
16
|
)
|
16
17
|
@config.graph = GraphConfig.new.tap { |c| c.rankdir = "LR" }
|
17
18
|
end
|
data/lib/rukawa/version.rb
CHANGED
data/lib/rukawa.rb
CHANGED
@@ -23,6 +23,13 @@ module Rukawa
|
|
23
23
|
def config
|
24
24
|
Configuration.instance
|
25
25
|
end
|
26
|
+
|
27
|
+
def load_jobs
|
28
|
+
job_dirs = config.job_dirs.map { |d| File.expand_path(d) }.uniq
|
29
|
+
job_dirs.each do |dir|
|
30
|
+
Dir.glob(File.join(dir, "**/*.rb")) { |f| load f }
|
31
|
+
end
|
32
|
+
end
|
26
33
|
end
|
27
34
|
end
|
28
35
|
|