libis-workflow 2.0.beta.5 → 2.0.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libis/workflow/config.rb +12 -80
- data/lib/libis/workflow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc567c39e544349f3d849bf2cd79f2845f603561
|
4
|
+
data.tar.gz: 8332ec1f868d0e4e206f33b16bdd5ca3eae14ea9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14724c697bf6f105a036e5a65a25c80b40211c17b305af93543f5fe50793f6052b6b1091658940344bdf87a8fd85a2f54a172c234c2bf4e09e167a6eb6719d96
|
7
|
+
data.tar.gz: 3eca54647e04e308127023247c13cdbd4017616692f964f955d99c723c757eb3aea03ce83983f7ca63c6beb64d4866ff6778d4ff66d3b62edb67c231fc666a15
|
@@ -1,92 +1,24 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'logger'
|
3
|
+
require 'libis/tools/config'
|
5
4
|
|
6
5
|
module Libis
|
7
6
|
module Workflow
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
# noinspection RubyConstantNamingConvention
|
9
|
+
Config = ::Libis::Tools::Config
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def initialize
|
17
|
-
Config.require_all(File.join(File.dirname(__FILE__), 'tasks'))
|
18
|
-
@logger = ::Logger.new STDOUT
|
19
|
-
set_formatter
|
20
|
-
@workdir = './work'
|
21
|
-
self.taskdir = './tasks'
|
22
|
-
self.itemdir = './items'
|
23
|
-
end
|
24
|
-
|
25
|
-
public
|
26
|
-
|
27
|
-
def set_formatter(formatter = nil)
|
28
|
-
@logger.formatter = formatter || proc do |severity, time, progname, msg|
|
29
|
-
"%s, [%s#%d] %5s -- %s: %s\n" % [severity[0..0],
|
30
|
-
(time.strftime('%Y-%m-%dT%H:%M:%S.') << '%06d ' % time.usec),
|
31
|
-
$$, severity, progname, msg]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.logger
|
36
|
-
instance.logger
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.workdir
|
40
|
-
instance.workdir
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.taskdir
|
44
|
-
instance.taskdir
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.itemdir
|
48
|
-
instance.itemdir
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.logger=(log)
|
52
|
-
instance.logger = log
|
11
|
+
Config.define_singleton_method(:require_all) do |dir|
|
12
|
+
Dir.glob(File.join(dir, '*.rb')).each do |filename|
|
13
|
+
# noinspection RubyResolve
|
14
|
+
require filename
|
53
15
|
end
|
54
|
-
|
55
|
-
def self.set_formatter(formatter = nil)
|
56
|
-
instance.set_formatter(formatter)
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.workdir=(dir)
|
60
|
-
instance.workdir = dir
|
61
|
-
end
|
62
|
-
|
63
|
-
def taskdir=(dir)
|
64
|
-
@taskdir = dir
|
65
|
-
Config.require_all dir
|
66
|
-
end
|
67
|
-
|
68
|
-
def self.taskdir=(dir)
|
69
|
-
instance.taskdir = dir
|
70
|
-
end
|
71
|
-
|
72
|
-
def itemdir=(dir)
|
73
|
-
@itemdir = dir
|
74
|
-
Config.require_all dir
|
75
|
-
end
|
76
|
-
|
77
|
-
def self.itemdir=(dir)
|
78
|
-
instance.itemdir = dir
|
79
|
-
end
|
80
|
-
|
81
|
-
def self.require_all(dir)
|
82
|
-
return unless Dir.exist?(dir)
|
83
|
-
Dir.glob(File.join(dir, '*.rb')).each do |filename|
|
84
|
-
#noinspection RubyResolve
|
85
|
-
require filename
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
16
|
end
|
90
17
|
|
18
|
+
Config.require_all(File.join(File.dirname(__FILE__), 'tasks'))
|
19
|
+
Config[:workdir] = './work'
|
20
|
+
Config[:taskdir] = './tasks'
|
21
|
+
Config[:itemdir] = './items'
|
22
|
+
|
91
23
|
end
|
92
24
|
end
|
@@ -2,6 +2,6 @@
|
|
2
2
|
|
3
3
|
module Libis
|
4
4
|
module Workflow
|
5
|
-
VERSION = '2.0.beta.
|
5
|
+
VERSION = '2.0.beta.7' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
|
6
6
|
end
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libis-workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.beta.
|
4
|
+
version: 2.0.beta.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Dekeyser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: 1.3.1
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.4.
|
173
|
+
rubygems_version: 2.4.8
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: LIBIS Workflow framework.
|