speedflow 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/speedflow +1 -1
- data/lib/speedflow/flow.rb +22 -6
- data/lib/speedflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fa0904a1217e443c1c991f6a65247eedb1b74bf
|
4
|
+
data.tar.gz: 230efa0af2539563d2b8f23465b4d1cd2723ba2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a72c8b294fbc30f78ce1f72249ab43be9b3f04408c8f6bba93798035e7a6225a23a590d2be597415cf2bd5456af973f10e63832fae8011e72598d6ff1dc04c2
|
7
|
+
data.tar.gz: 9cf30224680531bca375aa8ba1616ef118e6bdb9823abbb96325470339ca79fcb37eb0ee01e7209e1683e17eaf018b231b10f98b583ccd9f1374fe30b6aa1fa8
|
data/bin/speedflow
CHANGED
@@ -7,7 +7,7 @@ require 'speedflow'
|
|
7
7
|
# Speedflow program
|
8
8
|
Mercenary.program(:speedflow) do |program|
|
9
9
|
program.version Speedflow::VERSION
|
10
|
-
program.description 'Speedflow is a CLI
|
10
|
+
program.description 'Speedflow is a CLI to help you to keep your time.'
|
11
11
|
program.syntax "speedflow [OPTIONS] COMMAND [arg...]\n" \
|
12
12
|
' speedflow [ --help | -v | --version | --trace ]'
|
13
13
|
program.option(
|
data/lib/speedflow/flow.rb
CHANGED
@@ -29,12 +29,28 @@ module Speedflow
|
|
29
29
|
output = {}
|
30
30
|
@config['flow'][trigger.to_s].each do |step|
|
31
31
|
arguments = step['arguments'] || {}
|
32
|
+
|
32
33
|
step['arguments'] = transform_arguments(arguments, output, inputs)
|
33
|
-
step['arguments']
|
34
|
+
step['arguments'] = add_config_argument(arguments)
|
35
|
+
|
34
36
|
output = plugin_manager.call_action_from_step(step)
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
40
|
+
# Public: Add config arguement
|
41
|
+
#
|
42
|
+
# arguments - Hash of arguments.
|
43
|
+
#
|
44
|
+
# Returns Hash of arguments.
|
45
|
+
def add_config_argument(arguments)
|
46
|
+
arguments['_config'] = @config.clone
|
47
|
+
arguments['_config'].delete_if { |k, _| arguments.key?(k) }
|
48
|
+
arguments['_config'].delete_if do |k, _|
|
49
|
+
@config.class.const_get('DEFAULTS').stringify_keys.key?(k)
|
50
|
+
end
|
51
|
+
arguments
|
52
|
+
end
|
53
|
+
|
38
54
|
# Public: Transform arguments (to add value)
|
39
55
|
#
|
40
56
|
# arguments - Hash of arguments.
|
@@ -45,14 +61,14 @@ module Speedflow
|
|
45
61
|
def transform_arguments(arguments, prev_values, inputs)
|
46
62
|
arguments = arguments.replace_values_from_previous(prev_values)
|
47
63
|
arguments.each do |arg_name, arg_values|
|
48
|
-
arguments[arg_name]
|
64
|
+
arguments[arg_name] = {} unless arguments[arg_name].is_a?(Hash)
|
65
|
+
arguments[arg_name]['value'] = ''
|
49
66
|
if inputs.key?(arg_name)
|
50
|
-
arguments[arg_name][
|
51
|
-
elsif arg_values.key?('default')
|
52
|
-
arguments[arg_name][
|
67
|
+
arguments[arg_name]['value'] = inputs[arg_name]
|
68
|
+
elsif !arg_values.nil? && arg_values.key?('default')
|
69
|
+
arguments[arg_name]['value'] = arg_values['default']
|
53
70
|
end
|
54
71
|
end
|
55
|
-
arguments
|
56
72
|
end
|
57
73
|
|
58
74
|
# Public: Get flat arguments from flow.
|
data/lib/speedflow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speedflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Breux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_all
|