ehbrs-tools 0.16.0 → 0.16.1
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/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/vg/wii/wit/parsers/dump.rb +10 -5
- data/vendor/aranha-parsers/Gemfile +5 -0
- data/vendor/aranha-parsers/aranha-parsers.gemspec +23 -0
- data/vendor/aranha-parsers/lib/aranha/parsers.rb +9 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/base.rb +79 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html.rb +11 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/base.rb +47 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/item.rb +24 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/item_list.rb +29 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/node.rb +13 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/node/base.rb +36 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/node/default.rb +126 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/invalid_state_exception.rb +8 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/patches.rb +11 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/patches/ofx_parser.rb +38 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address.rb +55 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/file.rb +31 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/hash_http_get.rb +25 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/hash_http_post.rb +45 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +49 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_target_fixtures.rb +77 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/spec/source_target_fixtures_example.rb +70 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +7 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_address/http_get_spec.rb +21 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_address_spec.rb +74 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb +27 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.source.txt +1 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.target.html +1 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub2.source.html +1 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub3.target.yaml +1 -0
- data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +7 -0
- data/vendor/aranha-parsers/spec/spec_helper.rb +8 -0
- data/vendor/eac_cli/lib/eac_cli/definition.rb +14 -4
- data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +76 -0
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +15 -2
- data/vendor/eac_cli/lib/eac_cli/parser/options_collection.rb +4 -63
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +4 -69
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb +81 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +18 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb +7 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +27 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- metadata +38 -2
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/console/configs/read_entry_options'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Console
|
8
|
+
class Configs
|
9
|
+
class EntryReader
|
10
|
+
enable_console_speaker
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def entry_key_to_envvar_name(entry_key)
|
14
|
+
path = if entry_key.is_a?(::Array)
|
15
|
+
entry_key
|
16
|
+
else
|
17
|
+
::EacRubyUtils::PathsHash.parse_entry_key(entry_key)
|
18
|
+
end
|
19
|
+
path.join('_').gsub(/[^a-z0-9_]/i, '').gsub(/\A_+/, '').gsub(/_+\z/, '')
|
20
|
+
.gsub(/_{2,}/, '_').upcase
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
common_constructor :console_configs, :entry_key, :options do
|
25
|
+
self.options = ::EacRubyUtils::Console::Configs::ReadEntryOptions.new(options)
|
26
|
+
end
|
27
|
+
|
28
|
+
def read
|
29
|
+
%w[envvars storage console].each do |suffix|
|
30
|
+
value = send("read_from_#{suffix}")
|
31
|
+
return value if value.present?
|
32
|
+
end
|
33
|
+
return nil unless options[:required]
|
34
|
+
|
35
|
+
raise "No value found for entry \"#{entry_key}\""
|
36
|
+
end
|
37
|
+
|
38
|
+
def read_from_storage
|
39
|
+
console_configs.configs.read_entry(entry_key)
|
40
|
+
end
|
41
|
+
|
42
|
+
def read_from_envvars
|
43
|
+
return if options[:noenv]
|
44
|
+
|
45
|
+
env_entry_key = self.class.entry_key_to_envvar_name(entry_key)
|
46
|
+
return unless ENV.key?(env_entry_key)
|
47
|
+
|
48
|
+
ENV.fetch(env_entry_key).if_present(::EacRubyUtils::BlankNotBlank.instance)
|
49
|
+
end
|
50
|
+
|
51
|
+
def read_from_console
|
52
|
+
return if options[:noinput]
|
53
|
+
|
54
|
+
options[:before_input].if_present(&:call)
|
55
|
+
entry_value = looped_entry_value_from_input
|
56
|
+
console_configs.configs.write_entry(entry_key, entry_value) if options[:store]
|
57
|
+
entry_value
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def looped_entry_value_from_input
|
63
|
+
loop do
|
64
|
+
entry_value = entry_value_from_input(entry_key, options)
|
65
|
+
next if entry_value.blank?
|
66
|
+
next if options[:validator] && !options[:validator].call(entry_value)
|
67
|
+
|
68
|
+
return entry_value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def entry_value_from_input(entry_key, options)
|
73
|
+
entry_value = request_input("Value for entry \"#{entry_key}\"",
|
74
|
+
options.request_input_options)
|
75
|
+
warn('Entered value is blank') if entry_value.blank?
|
76
|
+
entry_value
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/console/configs/entry_reader'
|
4
|
+
|
5
|
+
module EacRubyUtils
|
6
|
+
module Console
|
7
|
+
class Configs
|
8
|
+
class PasswordEntryReader < ::EacRubyUtils::Console::Configs::EntryReader
|
9
|
+
ENTRY_KEY = 'core.store_passwords'
|
10
|
+
|
11
|
+
def initialize(console_configs, entry_key, options = {})
|
12
|
+
super(console_configs, entry_key, options.merge(noecho: true,
|
13
|
+
store: console_configs.store_passwords?))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -7,13 +7,18 @@ module EacRubyUtils
|
|
7
7
|
class Configs
|
8
8
|
class ReadEntryOptions
|
9
9
|
enable_simple_cache
|
10
|
-
common_constructor :options
|
10
|
+
common_constructor :options do
|
11
|
+
self.options = options.to_h.symbolize_keys
|
12
|
+
.assert_valid_keys(DEFAULT_VALUES.keys).freeze
|
13
|
+
end
|
11
14
|
|
12
15
|
DEFAULT_VALUES = {
|
13
16
|
before_input: nil, bool: false, list: false, noecho: false, noenv: false, noinput: false,
|
14
|
-
required: true, validator: nil
|
17
|
+
required: true, store: true, validator: nil
|
15
18
|
}.freeze
|
16
19
|
|
20
|
+
delegate :to_h, to: :options
|
21
|
+
|
17
22
|
def [](key)
|
18
23
|
values.fetch(key.to_sym)
|
19
24
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/console/configs/entry_reader'
|
4
|
+
|
5
|
+
module EacRubyUtils
|
6
|
+
module Console
|
7
|
+
class Configs
|
8
|
+
class StorePasswordsEntryReader < ::EacRubyUtils::Console::Configs::EntryReader
|
9
|
+
ENTRY_KEY = 'core.store_passwords'
|
10
|
+
|
11
|
+
def initialize(console_configs)
|
12
|
+
super(console_configs, ENTRY_KEY,
|
13
|
+
before_input: -> { banner },
|
14
|
+
validator: ->(entry_value) { %w[yes no].include?(entry_value) }
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def banner
|
19
|
+
infom 'Do you wanna to store passwords?'
|
20
|
+
infom 'Warning: the passwords will be store in clear text in ' \
|
21
|
+
"\"#{console_configs.configs.storage_path}\""
|
22
|
+
infom 'Enter "yes" or "no"'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ehbrs-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm-tools
|
@@ -182,6 +182,37 @@ files:
|
|
182
182
|
- lib/ehbrs/videos/unsupported/profiles/samsung.rb
|
183
183
|
- lib/ehbrs/videos/unsupported/search.rb
|
184
184
|
- lib/ehbrs/videos/unsupported/track.rb
|
185
|
+
- vendor/aranha-parsers/Gemfile
|
186
|
+
- vendor/aranha-parsers/aranha-parsers.gemspec
|
187
|
+
- vendor/aranha-parsers/lib/aranha/parsers.rb
|
188
|
+
- vendor/aranha-parsers/lib/aranha/parsers/base.rb
|
189
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html.rb
|
190
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html/base.rb
|
191
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html/item.rb
|
192
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html/item_list.rb
|
193
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html/node.rb
|
194
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html/node/base.rb
|
195
|
+
- vendor/aranha-parsers/lib/aranha/parsers/html/node/default.rb
|
196
|
+
- vendor/aranha-parsers/lib/aranha/parsers/invalid_state_exception.rb
|
197
|
+
- vendor/aranha-parsers/lib/aranha/parsers/patches.rb
|
198
|
+
- vendor/aranha-parsers/lib/aranha/parsers/patches/ofx_parser.rb
|
199
|
+
- vendor/aranha-parsers/lib/aranha/parsers/source_address.rb
|
200
|
+
- vendor/aranha-parsers/lib/aranha/parsers/source_address/file.rb
|
201
|
+
- vendor/aranha-parsers/lib/aranha/parsers/source_address/hash_http_get.rb
|
202
|
+
- vendor/aranha-parsers/lib/aranha/parsers/source_address/hash_http_post.rb
|
203
|
+
- vendor/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb
|
204
|
+
- vendor/aranha-parsers/lib/aranha/parsers/source_target_fixtures.rb
|
205
|
+
- vendor/aranha-parsers/lib/aranha/parsers/spec/source_target_fixtures_example.rb
|
206
|
+
- vendor/aranha-parsers/lib/aranha/parsers/version.rb
|
207
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_address/http_get_spec.rb
|
208
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_address_spec.rb
|
209
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
|
210
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.source.txt
|
211
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.target.html
|
212
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub2.source.html
|
213
|
+
- vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub3.target.yaml
|
214
|
+
- vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb
|
215
|
+
- vendor/aranha-parsers/spec/spec_helper.rb
|
185
216
|
- vendor/aranha-selenium/Gemfile
|
186
217
|
- vendor/aranha-selenium/aranha-selenium.gemspec
|
187
218
|
- vendor/aranha-selenium/lib/aranha/selenium.rb
|
@@ -203,6 +234,7 @@ files:
|
|
203
234
|
- vendor/eac_cli/lib/eac_cli/definition/argument_option.rb
|
204
235
|
- vendor/eac_cli/lib/eac_cli/definition/base_option.rb
|
205
236
|
- vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb
|
237
|
+
- vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb
|
206
238
|
- vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb
|
207
239
|
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb
|
208
240
|
- vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb
|
@@ -256,7 +288,10 @@ files:
|
|
256
288
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb
|
257
289
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb
|
258
290
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb
|
291
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb
|
292
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb
|
259
293
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb
|
294
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb
|
260
295
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb
|
261
296
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb
|
262
297
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb
|
@@ -336,6 +371,7 @@ files:
|
|
336
371
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb
|
337
372
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb
|
338
373
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb
|
374
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb
|
339
375
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb
|
340
376
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb
|
341
377
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb
|