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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b165a0824c474f449b62bd61beed9f96f3e11c39
4
- data.tar.gz: bfaf7d5212c500d6084b07e4ca36baf745ab3efb
3
+ metadata.gz: e9f4f1e22085cbcfcfafc854b03bc5538ee70044
4
+ data.tar.gz: 1644fab37cea4a2b001306a84641dbfb3a8da9e6
5
5
  SHA512:
6
- metadata.gz: 0109918d72f5527124754e5ffdffa7c4ae97661a9c4a871e2c2620bc96e1514ee8affd3015a9e25d74134ee547c248eb41488f172333b8aa017ec1654e66cb4c
7
- data.tar.gz: 2c662f7a992ae4172e4cb93d2ba5937bb25ef6aee7ddc9e5ef3cd929cc274fb5fec974035225c80a606cfd74d50a1d1138501594420f5e11c862902d6fb3bc1f
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
- job_dirs = (default_job_dirs + options[:job_dirs]).map { |d| File.expand_path(d) }.uniq
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)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Rukawa
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rukawa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007