seiya 0.0.7.1 → 0.0.7.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 +4 -4
- data/lib/seiya/version.rb +1 -1
- data/lib/seiya.rb +13 -13
- 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: 0702f2dbc3a8bcf07bab3bf695514ebd4f145b46
|
|
4
|
+
data.tar.gz: 2e1410f0278a7fbfd49088d637c03f5f89adea70
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f1f76b24c18bc73658124231906e637db83a5ce70c3fcf5c10665ca29189c5273fcff63845a5853d2ab6cedb77d4ce4cd3c89a46e656bbbff57b40c027a3150
|
|
7
|
+
data.tar.gz: 021bddbac89b5f001e46f3d35e367245c574f843ab38b2d7bff0fd4e879995e57218518a85bba8e63751eaadf3a1b69b8d28003f37698c7c40eadd7c057e5cfc
|
data/lib/seiya/version.rb
CHANGED
data/lib/seiya.rb
CHANGED
|
@@ -34,13 +34,13 @@ module Seiya
|
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
def
|
|
37
|
+
def get_classes(const_path, super_class = Object)
|
|
38
38
|
require_str, const_str = const_path.split '|'
|
|
39
39
|
_module = get_const require_str, const_str
|
|
40
40
|
|
|
41
41
|
_module.constants.select do |c|
|
|
42
42
|
const = _module.const_get(c)
|
|
43
|
-
const.is_a? Class and const <
|
|
43
|
+
const.is_a? Class and const < super_class
|
|
44
44
|
end.map do |c|
|
|
45
45
|
_module.const_get c
|
|
46
46
|
end
|
|
@@ -81,8 +81,8 @@ module Seiya
|
|
|
81
81
|
|
|
82
82
|
@pipelines = pipelines.keys.map do |k|
|
|
83
83
|
require_str, const_str = k.split '|'
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
klass = get_const require_str, const_str
|
|
85
|
+
klass.new
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
commands = [Settings::COMMANDS]
|
|
@@ -93,24 +93,24 @@ module Seiya
|
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
@commands = commands.map do |const_path|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
command_classes = get_classes(const_path, Command)
|
|
97
|
+
command_classes.map do |klass|
|
|
98
98
|
[klass.name.underscore.split('/').last.to_sym, klass.new]
|
|
99
99
|
end
|
|
100
100
|
end.flatten(1).to_h
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
@
|
|
102
|
+
task_classes = get_classes('tasks|Tasks', Task)
|
|
103
|
+
@task_classes = task_classes.map do |klass|
|
|
104
104
|
[klass.name.underscore.split('/').last.to_sym, klass]
|
|
105
105
|
end.to_h
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def tasks
|
|
109
|
-
if @
|
|
109
|
+
if @task_classes.nil?
|
|
110
110
|
setup
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
@
|
|
113
|
+
@task_classes.map do |k, v|
|
|
114
114
|
[k, v.summary]
|
|
115
115
|
end.to_h
|
|
116
116
|
end
|
|
@@ -150,17 +150,17 @@ Use "seiya <command> -h" to see more info about a command
|
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
def get_task_class(task_name)
|
|
153
|
-
if @
|
|
153
|
+
if @task_classes.nil?
|
|
154
154
|
setup
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
task_name = task_name.to_sym
|
|
158
|
-
unless @
|
|
158
|
+
unless @task_classes.key? task_name
|
|
159
159
|
puts "Task #{task_name} does not exist!"
|
|
160
160
|
exit!
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
-
@
|
|
163
|
+
@task_classes[task_name]
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
def gen_project_file(project_name)
|