ehbrs-tools 0.11.0 → 0.12.0

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ehbrs/google.rb +9 -0
  3. data/lib/ehbrs/google/translate.rb +11 -0
  4. data/lib/ehbrs/google/translate/session.rb +61 -0
  5. data/lib/ehbrs/runner/google.rb +19 -0
  6. data/lib/ehbrs/runner/google/translate.rb +92 -0
  7. data/lib/ehbrs/tools/version.rb +1 -1
  8. data/vendor/aranha-selenium/Gemfile +5 -0
  9. data/vendor/aranha-selenium/aranha-selenium.gemspec +19 -0
  10. data/vendor/aranha-selenium/lib/aranha/selenium.rb +8 -0
  11. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory.rb +47 -0
  12. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/base.rb +76 -0
  13. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/chrome.rb +28 -0
  14. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox.rb +54 -0
  15. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox_auto_download_mime_types +685 -0
  16. data/vendor/aranha-selenium/lib/aranha/selenium/session.rb +78 -0
  17. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +7 -0
  18. data/vendor/aranha-selenium/spec/rubocop_check_spec.rb +7 -0
  19. data/vendor/aranha-selenium/spec/spec_helper.rb +100 -0
  20. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +68 -0
  21. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs.rb +4 -12
  22. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +1 -1
  23. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +1 -1
  24. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker.rb +1 -1
  25. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +4 -0
  26. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb +10 -12
  27. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/symbol_list.rb +19 -0
  28. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +10 -0
  29. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch.rb +1 -1
  30. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/require_sub.rb +2 -2
  31. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb +1 -1
  32. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb +1 -3
  33. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +45 -2
  34. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  35. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +85 -2
  36. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +42 -0
  37. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +1 -0
  38. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/docopt_runner_spec.rb +5 -5
  39. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/speaker_spec.rb +1 -1
  40. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb +4 -0
  41. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/temp_spec.rb +1 -1
  42. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +32 -0
  43. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +1 -1
  44. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb +1 -1
  45. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/if_present_spec.rb +1 -1
  46. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec.rb +1 -1
  47. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb +4 -4
  48. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +19 -0
  49. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_module_a.rb +6 -0
  50. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_not_module.rb +6 -0
  51. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb +1 -1
  52. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/yaml_spec.rb +75 -0
  53. data/vendor/eac_ruby_utils/spec/locales/pt-BR.yml +17 -0
  54. metadata +26 -1
@@ -17,7 +17,7 @@ RSpec.describe ::Object do
17
17
  ::EacRubyUtils::Templates::Searcher.default.included_paths.delete(templates_path)
18
18
  end
19
19
 
20
- context '#template' do
20
+ describe '#template' do
21
21
  it { expect(instance.template).to be_a(::EacRubyUtils::Templates::File) }
22
22
  end
23
23
  end
@@ -4,14 +4,14 @@ require 'eac_ruby_utils/patches/pathname/basename_sub'
4
4
 
5
5
  RSpec.describe ::Pathname do
6
6
  it do
7
- expect(::Pathname.new('/absolute/path/to/file').basename_sub { |_b| 'other_file' }).to eq(
8
- ::Pathname.new('/absolute/path/to/other_file')
7
+ expect(described_class.new('/absolute/path/to/file').basename_sub { |_b| 'other_file' }).to eq(
8
+ described_class.new('/absolute/path/to/other_file')
9
9
  )
10
10
  end
11
11
 
12
12
  it do
13
- expect(::Pathname.new('file').basename_sub { |b| b.to_s + '_appended' }).to eq(
14
- ::Pathname.new('file_appended')
13
+ expect(described_class.new('file').basename_sub { |b| b.to_s + '_appended' }).to eq(
14
+ described_class.new('file_appended')
15
15
  )
16
16
  end
17
17
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+
5
+ RSpec.describe ::EacRubyUtils::RequireSub do
6
+ class RequireSubStubClass
7
+ end
8
+
9
+ let(:instance) { described_class.new(__FILE__, base: RequireSubStubClass, include_modules: true) }
10
+
11
+ before do
12
+ instance.apply
13
+ end
14
+
15
+ it do
16
+ expect(RequireSubStubClass.included_modules)
17
+ .to include(RequireSubStubClass::StubbedModuleA)
18
+ end
19
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RequireSubStubClass
4
+ module StubbedModuleA
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RequireSubStubClass
4
+ class StubbedNotModule
5
+ end
6
+ end
@@ -20,7 +20,7 @@ RSpec.describe ::EacRubyUtils::Templates::Searcher do
20
20
  }.each do |klass, subpaths|
21
21
  subpaths.each do |subpath|
22
22
  context "when subpath is \"#{subpath}\"" do
23
- it "should return a #{klass}'s instance" do
23
+ it "returns a #{klass}'s instance" do
24
24
  expect(instance.template(subpath, false)).to be_a(klass)
25
25
  end
26
26
  end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/hash_with_indifferent_access'
4
+ require 'eac_ruby_utils/yaml'
5
+
6
+ RSpec.describe ::EacRubyUtils::Yaml do
7
+ let(:unpermitted_class) do
8
+ Class.new do
9
+ def initialize(value)
10
+ @value = value
11
+ end
12
+
13
+ def to_s
14
+ @value.to_s
15
+ end
16
+ end
17
+ end
18
+
19
+ let(:arrayliable_class) do
20
+ Class.new do
21
+ def initialize(value)
22
+ @value = value
23
+ end
24
+
25
+ def to_a
26
+ [@value]
27
+ end
28
+ end
29
+ end
30
+
31
+ let(:source) do
32
+ {
33
+ a: 'a', b: :b, c: false, d: true, e: nil,
34
+ f: [
35
+ 'f',
36
+ {
37
+ g: 'g',
38
+ h: ::ActiveSupport::HashWithIndifferentAccess.new(
39
+ 'i' => ['i', unpermitted_class.new('j')],
40
+ k: arrayliable_class.new('k')
41
+ )
42
+ }
43
+ ]
44
+ }
45
+ end
46
+
47
+ let(:target) do
48
+ {
49
+ a: 'a', b: :b, c: false, d: true, e: nil,
50
+ f: ['f', { g: 'g', h: { i: %w[i j], k: ['k'] } }]
51
+ }
52
+ end
53
+
54
+ describe '#dump' do
55
+ it { expect(described_class.load(described_class.dump(source))).to eq(target) }
56
+ end
57
+
58
+ describe '#sanitize' do
59
+ it { expect(described_class.sanitize(target)).to eq(target) }
60
+ end
61
+
62
+ describe '#yaml' do
63
+ {
64
+ ['text'] => false,
65
+ 'text' => false,
66
+ "--- Text\n\n" => true,
67
+ "---\n" + ":index: 0\n" + ":codec_name: h264\n" + ":codec_type: video\n" => true,
68
+ '--- - \n bla bla bla' => false
69
+ }.each do |source, result|
70
+ it "return #{result} to source \"#{source}\"" do
71
+ expect(described_class.yaml?(source)).to eq(result)
72
+ end
73
+ end
74
+ end
75
+ end
@@ -36,3 +36,20 @@ pt-BR:
36
36
  b:
37
37
  label: Tipo B
38
38
  description: Tipo B Descr.
39
+ simbolo:
40
+ a:
41
+ label: Simbolo A
42
+ description: Simbolo A Descr.
43
+ b:
44
+ label: Simbolo B
45
+ description: Simbolo B Descr.
46
+ c:
47
+ label: Simbolo C
48
+ description: Simbolo C Descr.
49
+ tipado:
50
+ a:
51
+ label: Tipado A
52
+ description: Tipado A Descr.
53
+ b:
54
+ label: Tipado B
55
+ description: Tipado B Descr.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
@@ -100,12 +100,17 @@ files:
100
100
  - lib/ehbrs/fs.rb
101
101
  - lib/ehbrs/fs/compressed_package.rb
102
102
  - lib/ehbrs/gems.rb
103
+ - lib/ehbrs/google.rb
104
+ - lib/ehbrs/google/translate.rb
105
+ - lib/ehbrs/google/translate/session.rb
103
106
  - lib/ehbrs/observers.rb
104
107
  - lib/ehbrs/observers/base.rb
105
108
  - lib/ehbrs/observers/with_persistence.rb
106
109
  - lib/ehbrs/runner.rb
107
110
  - lib/ehbrs/runner/fs.rb
108
111
  - lib/ehbrs/runner/fs/used_space.rb
112
+ - lib/ehbrs/runner/google.rb
113
+ - lib/ehbrs/runner/google/translate.rb
109
114
  - lib/ehbrs/runner/self.rb
110
115
  - lib/ehbrs/runner/self/test.rb
111
116
  - lib/ehbrs/runner/vg.rb
@@ -170,6 +175,18 @@ files:
170
175
  - lib/ehbrs/videos/unsupported/profiles/samsung.rb
171
176
  - lib/ehbrs/videos/unsupported/search.rb
172
177
  - lib/ehbrs/videos/unsupported/track.rb
178
+ - vendor/aranha-selenium/Gemfile
179
+ - vendor/aranha-selenium/aranha-selenium.gemspec
180
+ - vendor/aranha-selenium/lib/aranha/selenium.rb
181
+ - vendor/aranha-selenium/lib/aranha/selenium/driver_factory.rb
182
+ - vendor/aranha-selenium/lib/aranha/selenium/driver_factory/base.rb
183
+ - vendor/aranha-selenium/lib/aranha/selenium/driver_factory/chrome.rb
184
+ - vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox.rb
185
+ - vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox_auto_download_mime_types
186
+ - vendor/aranha-selenium/lib/aranha/selenium/session.rb
187
+ - vendor/aranha-selenium/lib/aranha/selenium/version.rb
188
+ - vendor/aranha-selenium/spec/rubocop_check_spec.rb
189
+ - vendor/aranha-selenium/spec/spec_helper.rb
173
190
  - vendor/eac_cli/Gemfile
174
191
  - vendor/eac_cli/eac_cli.gemspec
175
192
  - vendor/eac_cli/lib/eac_cli.rb
@@ -191,6 +208,7 @@ files:
191
208
  - vendor/eac_ruby_utils/lib/eac_ruby_utils.rb
192
209
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb
193
210
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/by_reference.rb
211
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb
194
212
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb
195
213
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/configs.rb
196
214
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb
@@ -235,6 +253,7 @@ files:
235
253
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb
236
254
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb
237
255
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/string_list.rb
256
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/symbol_list.rb
238
257
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb
239
258
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/on_clean_ruby_environment.rb
240
259
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/options_consumer.rb
@@ -248,6 +267,7 @@ files:
248
267
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb
249
268
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb
250
269
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb
270
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb
251
271
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb
252
272
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/listable.rb
253
273
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch.rb
@@ -282,6 +302,7 @@ files:
282
302
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb
283
303
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb
284
304
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb
305
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
285
306
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb
286
307
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
287
308
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/configs_spec.rb
@@ -307,6 +328,9 @@ files:
307
328
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec_files/path/my_stub_with_template
308
329
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb
309
330
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/paths_hash_spec.rb
331
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb
332
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_module_a.rb
333
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_not_module.rb
310
334
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb
311
335
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb
312
336
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb
@@ -316,6 +340,7 @@ files:
316
340
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file1.template
317
341
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file2
318
342
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path2/subdir1/file3.template
343
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/yaml_spec.rb
319
344
  - vendor/eac_ruby_utils/spec/locales/pt-BR.yml
320
345
  - vendor/eac_ruby_utils/spec/rubocop_check_spec.rb
321
346
  - vendor/eac_ruby_utils/spec/spec_helper.rb