wisco 0.2.2 → 0.2.3
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/wisco/commands/exec.rb +13 -5
- data/lib/wisco/version.rb +1 -1
- data/lib/wisco.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 51be86dee6508b94fdfb404c37a7550de6f73497df168fc78b220021bbfdb5bd
|
|
4
|
+
data.tar.gz: 015f92b59cee11340d40c075be7f8cd73f08efa2d18442ec37bc41def1aa1273
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a81968e4a3aaf8164fbe849c049a525f6bb9853cfb39e1fb5c9d4f090ca9f98669aa7151b9ab36efba1ec8875869df10401e2524a405bb12e590eb5e39bc869
|
|
7
|
+
data.tar.gz: b07cc5ea7da1bc2f34f12d342a63822250f818a0372dd70a4b6d2172badd2dad31f99cdf63a787841a97cee3302b75625d40fd1c2bfdae54152d7197444f6d91
|
data/lib/wisco/commands/exec.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Wisco
|
|
|
10
10
|
module Exec
|
|
11
11
|
module_function
|
|
12
12
|
|
|
13
|
-
def run(path_arg, target_dir, input: nil, debug: false)
|
|
13
|
+
def run(path_arg, target_dir, input: nil, pagination: true, debug: false)
|
|
14
14
|
target_dir = File.expand_path(target_dir)
|
|
15
15
|
config_path = Wisco.config_path(target_dir)
|
|
16
16
|
|
|
@@ -51,7 +51,8 @@ module Wisco
|
|
|
51
51
|
if input_files.empty?
|
|
52
52
|
if %w[pick_lists methods].include?(section)
|
|
53
53
|
# No-param pick list or method — execute once with no input file
|
|
54
|
-
execute_one(section, key, nil, fixtures_dir, connector_full_path, connection,
|
|
54
|
+
execute_one(section, key, nil, fixtures_dir, connector_full_path, connection,
|
|
55
|
+
pagination: pagination, debug: debug)
|
|
55
56
|
else
|
|
56
57
|
warn "\tWarning: No ready input files found in #{fixture_dir_output}"
|
|
57
58
|
end
|
|
@@ -60,7 +61,7 @@ module Wisco
|
|
|
60
61
|
|
|
61
62
|
input_files.each do |input_file|
|
|
62
63
|
execute_one(section, key, input_file, fixtures_dir,
|
|
63
|
-
connector_full_path, connection, debug: debug)
|
|
64
|
+
connector_full_path, connection, pagination: pagination, debug: debug)
|
|
64
65
|
end
|
|
65
66
|
end
|
|
66
67
|
end
|
|
@@ -92,13 +93,20 @@ module Wisco
|
|
|
92
93
|
first_line == Wisco::Commands::Fixtures::SENTINEL
|
|
93
94
|
end
|
|
94
95
|
|
|
95
|
-
def execute_one(section, key, input_file, fixtures_dir, connector_full_path, connection,
|
|
96
|
+
def execute_one(section, key, input_file, fixtures_dir, connector_full_path, connection,
|
|
97
|
+
pagination: true, debug: false)
|
|
96
98
|
stem = input_file ? File.basename(input_file, '.*') : 'execute'
|
|
97
99
|
output_file = File.join(fixtures_dir, "output_#{stem}.json")
|
|
98
100
|
error_file = File.join(fixtures_dir, "error_#{stem}.txt")
|
|
99
101
|
|
|
100
102
|
use_args = %w[pick_lists methods].include?(section)
|
|
101
|
-
exec_path = use_args
|
|
103
|
+
exec_path = if use_args
|
|
104
|
+
"#{section}.#{key}"
|
|
105
|
+
elsif section == 'triggers'
|
|
106
|
+
pagination ? "#{section}.#{key}.poll" : "#{section}.#{key}.poll_page"
|
|
107
|
+
else
|
|
108
|
+
"#{section}.#{key}.execute"
|
|
109
|
+
end
|
|
102
110
|
|
|
103
111
|
options = { connector: connector_full_path, output: output_file }
|
|
104
112
|
options[:connection] = connection if connection
|
data/lib/wisco/version.rb
CHANGED
data/lib/wisco.rb
CHANGED
|
@@ -82,14 +82,17 @@ module Wisco
|
|
|
82
82
|
actions all keys in that section
|
|
83
83
|
get_users auto-detect section
|
|
84
84
|
DESC
|
|
85
|
-
option :input,
|
|
86
|
-
option :
|
|
85
|
+
option :input, type: :string, desc: 'Specific input file'
|
|
86
|
+
option :pagination, type: :boolean, default: true,
|
|
87
|
+
desc: 'Triggers only: true = .poll (with pagination), false = .poll_page (without)'
|
|
88
|
+
option :debug, type: :boolean, default: false, desc: 'Print ExecCommand call details'
|
|
87
89
|
def exec(path_arg, target_dir = nil)
|
|
88
90
|
Wisco::Commands::Exec.run(
|
|
89
91
|
path_arg,
|
|
90
92
|
target_dir || Dir.pwd,
|
|
91
|
-
input:
|
|
92
|
-
|
|
93
|
+
input: options[:input],
|
|
94
|
+
pagination: options[:pagination],
|
|
95
|
+
debug: options[:debug]
|
|
93
96
|
)
|
|
94
97
|
end
|
|
95
98
|
|