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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b480d047c6f25a2c8ad8e234e034cb1d1cb571efbd9620b405a90a9e7816a807
4
- data.tar.gz: baac61b7895d1a8fa7046a675910ecacfcae4e03afab83fa42d371f5a8a19b0b
3
+ metadata.gz: 51be86dee6508b94fdfb404c37a7550de6f73497df168fc78b220021bbfdb5bd
4
+ data.tar.gz: 015f92b59cee11340d40c075be7f8cd73f08efa2d18442ec37bc41def1aa1273
5
5
  SHA512:
6
- metadata.gz: f15e57668b56c77e593da83dbc759663d1bf2a7c3bb7f39fe7dc03bfea50365df9356aa7e996d9e060a34b5ba1f1946172d5cdbe91c92c02c49e72eec606a26f
7
- data.tar.gz: d8339fb1ea9942a124a8cbd260ffd74912504dbe5ed38f24ba817e82bad9f930ebcb75f270f65afe23a09a82bbb2161bfee40c0adc96a76049ec698c90e62e2c
6
+ metadata.gz: 5a81968e4a3aaf8164fbe849c049a525f6bb9853cfb39e1fb5c9d4f090ca9f98669aa7151b9ab36efba1ec8875869df10401e2524a405bb12e590eb5e39bc869
7
+ data.tar.gz: b07cc5ea7da1bc2f34f12d342a63822250f818a0372dd70a4b6d2172badd2dad31f99cdf63a787841a97cee3302b75625d40fd1c2bfdae54152d7197444f6d91
@@ -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, debug: debug)
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, debug: false)
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 ? "#{section}.#{key}" : "#{section}.#{key}.execute"
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
@@ -1,3 +1,3 @@
1
1
  module Wisco
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
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, type: :string, desc: 'Specific input file'
86
- option :debug, type: :boolean, default: false, desc: 'Print ExecCommand call details'
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: options[:input],
92
- debug: options[:debug]
93
+ input: options[:input],
94
+ pagination: options[:pagination],
95
+ debug: options[:debug]
93
96
  )
94
97
  end
95
98
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbillington