ehbrs-tools 0.23.0 → 0.25.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/.avm.yml +4 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +39 -0
  5. data/Gemfile.lock +269 -0
  6. data/exe/ehbrs +2 -2
  7. data/lib/ehbrs/tools/runner/cooking_book/build.rb +52 -0
  8. data/lib/ehbrs/tools/runner/cooking_book.rb +32 -0
  9. data/lib/ehbrs/tools/runner/finances/bb_browser.rb +66 -0
  10. data/lib/ehbrs/{runner/videos/series.rb → tools/runner/finances.rb} +4 -4
  11. data/lib/ehbrs/tools/runner/fs/selected.rb +81 -0
  12. data/lib/ehbrs/tools/runner/fs/used_space.rb +161 -0
  13. data/lib/ehbrs/tools/runner/fs.rb +18 -0
  14. data/lib/ehbrs/tools/runner/google/translate.rb +89 -0
  15. data/lib/ehbrs/tools/runner/google.rb +18 -0
  16. data/lib/ehbrs/tools/runner/music/selected.rb +28 -0
  17. data/lib/ehbrs/tools/runner/music.rb +18 -0
  18. data/lib/ehbrs/tools/runner/self/test.rb +27 -0
  19. data/lib/ehbrs/tools/runner/self.rb +18 -0
  20. data/lib/ehbrs/tools/runner/telegram/send_message.rb +31 -0
  21. data/lib/ehbrs/tools/runner/telegram.rb +28 -0
  22. data/lib/ehbrs/tools/runner/vg/ips.rb +134 -0
  23. data/lib/ehbrs/tools/runner/vg/wii.rb +74 -0
  24. data/lib/ehbrs/tools/runner/vg.rb +18 -0
  25. data/lib/ehbrs/tools/runner/videos/extract.rb +70 -0
  26. data/lib/ehbrs/tools/runner/videos/probe.rb +34 -0
  27. data/lib/ehbrs/tools/runner/videos/series/rename.rb +74 -0
  28. data/lib/ehbrs/tools/runner/videos/series.rb +20 -0
  29. data/lib/ehbrs/tools/runner/videos/unsupported.rb +61 -0
  30. data/lib/ehbrs/{runner/web_utils → tools/runner}/videos.rb +3 -3
  31. data/lib/ehbrs/tools/runner/web_utils/videos/download.rb +75 -0
  32. data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +77 -0
  33. data/lib/ehbrs/tools/runner/web_utils/videos.rb +20 -0
  34. data/lib/ehbrs/tools/runner/web_utils.rb +26 -0
  35. data/lib/ehbrs/tools/runner.rb +21 -0
  36. data/lib/ehbrs/tools/version.rb +1 -1
  37. data/spec/code/rubocop_spec.rb +3 -0
  38. data/spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb +21 -0
  39. data/spec/lib/ehbrs/observers/base_spec.rb +93 -0
  40. data/spec/lib/ehbrs/tools/runner/fs/used_space_spec.rb +61 -0
  41. data/spec/lib/ehbrs/tools/runner/vg/ips_spec.rb +31 -0
  42. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/expected.rom +0 -0
  43. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_0.ips +0 -0
  44. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_1.ips +0 -0
  45. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/source.rom +0 -0
  46. data/spec/lib/ehbrs/tools/runner/videos/probe_spec.rb +19 -0
  47. data/spec/lib/ehbrs/tools/runner/videos/probe_spec_files/fixed.target.yaml +105 -0
  48. data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec.rb +75 -0
  49. data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec_files/dts_audio.probe.yaml +90 -0
  50. data/spec/lib/ehbrs/tools/runner_spec.rb +16 -0
  51. data/spec/lib/ehbrs/vg/wii/game_file_spec.rb +21 -0
  52. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec.rb +11 -0
  53. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.source.witdump +27 -0
  54. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.target.yaml +22 -0
  55. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.source.witdump +28 -0
  56. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.target.yaml +21 -0
  57. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.source.witdump +16 -0
  58. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.target.yaml +19 -0
  59. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.source.witdump +28 -0
  60. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.target.yaml +23 -0
  61. data/spec/lib/ehbrs/vg/wii/wit/path_spec.rb +33 -0
  62. data/spec/spec_helper/videos.rb +30 -0
  63. data/spec/spec_helper/videos_files/stub_source.mp4 +0 -0
  64. data/spec/spec_helper.rb +7 -0
  65. data/vendor/aranha-parsers/aranha-parsers.gemspec +2 -2
  66. data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup.rb +15 -0
  67. data/vendor/aranha-parsers/lib/aranha/parsers/{spec → rspec}/source_target_fixtures_example.rb +0 -0
  68. data/vendor/aranha-parsers/lib/aranha/parsers/rspec.rb +11 -0
  69. data/vendor/aranha-parsers/lib/aranha/parsers/source_address.rb +10 -8
  70. data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
  71. data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +1 -1
  72. data/vendor/aranha-parsers/spec/spec_helper.rb +2 -9
  73. data/vendor/aranha-selenium/aranha-selenium.gemspec +2 -2
  74. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
  75. data/vendor/aranha-selenium/spec/rubocop_check_spec.rb +1 -5
  76. data/vendor/aranha-selenium/spec/spec_helper.rb +2 -98
  77. data/vendor/eac_cli/eac_cli.gemspec +3 -3
  78. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +0 -2
  79. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  80. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
  81. data/vendor/eac_cli/spec/spec_helper.rb +2 -101
  82. data/vendor/eac_config/eac_config.gemspec +2 -2
  83. data/vendor/eac_config/lib/eac_config/version.rb +1 -1
  84. data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
  85. data/vendor/eac_config/spec/spec_helper.rb +2 -15
  86. data/vendor/eac_docker/eac_docker.gemspec +2 -2
  87. data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
  88. data/vendor/eac_docker/lib/eac_docker/debug.rb +15 -0
  89. data/vendor/eac_docker/lib/eac_docker/images/coded.rb +4 -0
  90. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +16 -2
  91. data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
  92. data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
  93. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  94. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
  95. data/vendor/eac_docker/spec/spec_helper.rb +2 -104
  96. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  97. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  98. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
  99. data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
  100. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  101. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +1 -1
  102. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
  103. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +75 -0
  104. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
  105. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
  106. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
  107. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
  108. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
  109. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
  110. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  111. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
  112. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  113. data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
  114. data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +6 -3
  115. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb +18 -0
  116. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches/object/template.rb +6 -0
  117. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
  118. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +11 -1
  119. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb +28 -0
  120. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/file.rb +11 -8
  121. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +13 -0
  122. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml +28 -0
  123. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml +7 -0
  124. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml +49 -0
  125. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml +7 -0
  126. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml +43 -0
  127. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml +7 -0
  128. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml +59 -0
  129. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml +7 -0
  130. data/vendor/ehbrs_ruby_utils/spec/rubocop_check_spec.rb +1 -5
  131. data/vendor/ehbrs_ruby_utils/spec/spec_helper.rb +2 -98
  132. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
  133. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
  134. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
  135. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
  136. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
  137. metadata +149 -40
  138. data/lib/ehbrs/runner/cooking_book/build.rb +0 -50
  139. data/lib/ehbrs/runner/cooking_book.rb +0 -30
  140. data/lib/ehbrs/runner/finances/bb_browser.rb +0 -35
  141. data/lib/ehbrs/runner/finances.rb +0 -16
  142. data/lib/ehbrs/runner/fs/selected.rb +0 -79
  143. data/lib/ehbrs/runner/fs/used_space.rb +0 -159
  144. data/lib/ehbrs/runner/fs.rb +0 -16
  145. data/lib/ehbrs/runner/google/translate.rb +0 -87
  146. data/lib/ehbrs/runner/google.rb +0 -16
  147. data/lib/ehbrs/runner/music/selected.rb +0 -26
  148. data/lib/ehbrs/runner/music.rb +0 -16
  149. data/lib/ehbrs/runner/self/test.rb +0 -25
  150. data/lib/ehbrs/runner/self.rb +0 -16
  151. data/lib/ehbrs/runner/telegram/send_message.rb +0 -29
  152. data/lib/ehbrs/runner/telegram.rb +0 -26
  153. data/lib/ehbrs/runner/vg/ips.rb +0 -132
  154. data/lib/ehbrs/runner/vg/wii.rb +0 -72
  155. data/lib/ehbrs/runner/vg.rb +0 -16
  156. data/lib/ehbrs/runner/videos/extract.rb +0 -68
  157. data/lib/ehbrs/runner/videos/probe.rb +0 -32
  158. data/lib/ehbrs/runner/videos/series/rename.rb +0 -72
  159. data/lib/ehbrs/runner/videos/unsupported.rb +0 -59
  160. data/lib/ehbrs/runner/videos.rb +0 -16
  161. data/lib/ehbrs/runner/web_utils/videos/download.rb +0 -63
  162. data/lib/ehbrs/runner/web_utils/videos/upload.rb +0 -75
  163. data/lib/ehbrs/runner/web_utils.rb +0 -24
  164. data/lib/ehbrs/runner.rb +0 -19
  165. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
  166. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*', 'Gemfile']
14
14
 
15
15
  s.add_dependency 'colorize', '~> 0.8.1'
16
- s.add_dependency 'eac_config', '~> 0.3'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.67'
16
+ s.add_dependency 'eac_config', '~> 0.5', '>= 0.5.1'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.70'
18
18
 
19
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
19
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
20
20
  end
@@ -21,8 +21,6 @@ module EacCli
21
21
  return sub_value_to_return if sub_entry.found?
22
22
  return nil unless options.required?
23
23
 
24
- puts "|#{sub_entry.path}|"
25
-
26
24
  input_value
27
25
  end
28
26
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.22.0'
4
+ VERSION = '0.22.2'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::EacRubyGemSupport::Rspec.default.describe_rubocop
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,103 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file was generated by the `rspec --init` command. Conventionally, all
4
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
- # The generated `.rspec` file contains `--require spec_helper` which will cause
6
- # this file to always be loaded, without a need to explicitly require it in any
7
- # files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need
15
- # it.
16
- #
17
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
18
- RSpec.configure do |config|
19
- # rspec-expectations config goes here. You can use an alternate
20
- # assertion/expectation library such as wrong or the stdlib/minitest
21
- # assertions if you prefer.
22
- config.expect_with :rspec do |expectations|
23
- # This option will default to `true` in RSpec 4. It makes the `description`
24
- # and `failure_message` of custom matchers include text for helper methods
25
- # defined using `chain`, e.g.:
26
- # be_bigger_than(2).and_smaller_than(4).description
27
- # # => "be bigger than 2 and smaller than 4"
28
- # ...rather than:
29
- # # => "be bigger than 2"
30
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
31
- end
32
-
33
- # rspec-mocks config goes here. You can use an alternate test double
34
- # library (such as bogus or mocha) by changing the `mock_with` option here.
35
- config.mock_with :rspec do |mocks|
36
- # Prevents you from mocking or stubbing a method that does not exist on
37
- # a real object. This is generally recommended, and will default to
38
- # `true` in RSpec 4.
39
- mocks.verify_partial_doubles = true
40
- end
41
-
42
- # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
43
- # have no way to turn it off -- the option exists only for backwards
44
- # compatibility in RSpec 3). It causes shared context metadata to be
45
- # inherited by the metadata hash of host groups and examples, rather than
46
- # triggering implicit auto-inclusion in groups with matching metadata.
47
- config.shared_context_metadata_behavior = :apply_to_host_groups
48
-
49
- # The settings below are suggested to provide a good initial experience
50
- # with RSpec, but feel free to customize to your heart's content.
51
- # # This allows you to limit a spec run to individual examples or groups
52
- # # you care about by tagging them with `:focus` metadata. When nothing
53
- # # is tagged with `:focus`, all examples get run. RSpec also provides
54
- # # aliases for `it`, `describe`, and `context` that include `:focus`
55
- # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
56
- # config.filter_run_when_matching :focus
57
- #
58
- # # Allows RSpec to persist some state between runs in order to support
59
- # # the `--only-failures` and `--next-failure` CLI options. We recommend
60
- # # you configure your source control system to ignore this file.
61
- # config.example_status_persistence_file_path = "spec/examples.txt"
62
- #
63
- # # Limits the available syntax to the non-monkey patched syntax that is
64
- # # recommended. For more details, see:
65
- # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
66
- # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
67
- # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
68
- # config.disable_monkey_patching!
69
- #
70
- # # This setting enables warnings. It's recommended, but in some cases may
71
- # # be too noisy due to issues in dependencies.
72
- # config.warnings = true
73
- #
74
- # # Many RSpec users commonly either run the entire suite or an individual
75
- # # file, and it's useful to allow more verbose output when running an
76
- # # individual spec file.
77
- # if config.files_to_run.one?
78
- # # Use the documentation formatter for detailed output,
79
- # # unless a formatter has already been configured
80
- # # (e.g. via a command-line flag).
81
- # config.default_formatter = "doc"
82
- # end
83
- #
84
- # # Print the 10 slowest examples and example groups at the
85
- # # end of the spec run, to help surface which specs are running
86
- # # particularly slow.
87
- # config.profile_examples = 10
88
- #
89
- # # Run specs in random order to surface order dependencies. If you find an
90
- # # order dependency and want to debug it, you can fix the order by providing
91
- # # the seed, which is printed after each run.
92
- # # --seed 1234
93
- # config.order = :random
94
- #
95
- # # Seed global randomization in this process using the `--seed` CLI option.
96
- # # Setting this allows you to use `--seed` to deterministically reproduce
97
- # # test failures related to randomization by passing the same `--seed` value
98
- # # as the one that triggered the failure.
99
- # Kernel.srand config.seed
100
-
101
- require 'eac_ruby_gem_support/rspec'
102
- ::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
103
- end
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
15
  s.add_dependency 'addressable'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.64'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.70'
17
17
 
18
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
18
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
19
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacConfig
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::EacRubyGemSupport::Rspec.default.describe_rubocop
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,17 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
4
- RSpec.configure do |config|
5
- config.expect_with :rspec do |expectations|
6
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
7
- end
8
-
9
- config.mock_with :rspec do |mocks|
10
- mocks.verify_partial_doubles = true
11
- end
12
-
13
- config.shared_context_metadata_behavior = :apply_to_host_groups
14
-
15
- require 'eac_ruby_gem_support/rspec'
16
- ::EacRubyGemSupport::Rspec.setup(::File.dirname(__dir__), config)
17
- end
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'eac_ruby_utils', '~> 0.64'
15
+ s.add_dependency 'eac_ruby_utils', '~> 0.74'
16
16
  s.add_dependency 'eac_templates', '~> 0.1'
17
17
 
18
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
18
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3', '>= 0.3.3'
19
19
  end
@@ -7,7 +7,7 @@ module EacDocker
7
7
  enable_immutable
8
8
  immutable_accessor :interactive, :temporary, :tty, type: :boolean
9
9
  immutable_accessor :env, type: :hash
10
- immutable_accessor :command_arg, :volume, type: :array
10
+ immutable_accessor :capability, :command_arg, :volume, type: :array
11
11
  attr_reader :id
12
12
  common_constructor :image
13
13
 
@@ -43,8 +43,8 @@ module EacDocker
43
43
  end
44
44
 
45
45
  def run_command_args
46
- run_command_boolean_args + run_command_envs_args + run_command_volumes_args + [image.id] +
47
- command_args
46
+ run_command_boolean_args + run_command_capabilities_args + run_command_envs_args +
47
+ run_command_volumes_args + [image.provide.id] + command_args
48
48
  end
49
49
 
50
50
  def stop
@@ -63,6 +63,10 @@ module EacDocker
63
63
  r
64
64
  end
65
65
 
66
+ def run_command_capabilities_args
67
+ capabilities.flat_map { |capability| ['--cap-add', capability] }
68
+ end
69
+
66
70
  def run_command_volumes_args
67
71
  volumes.flat_map { |volume| ['--volume', volume] }
68
72
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/boolean'
4
+
5
+ module EacDocker
6
+ module Debug
7
+ class << self
8
+ ENABLE_ENVVAR = 'EAC_DOCKER_DEBUG'
9
+
10
+ def enabled?
11
+ ::EacRubyUtils::Boolean.parse(ENV[ENABLE_ENVVAR])
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_docker/debug'
3
4
  require 'eac_docker/executables'
4
5
  require 'eac_docker/images/base'
5
6
  require 'eac_ruby_utils/core_ext'
@@ -26,6 +27,9 @@ module EacDocker
26
27
  private
27
28
 
28
29
  def id_uncached
30
+ if ::EacDocker::Debug.enabled?
31
+ ::EacDocker::Executables.docker.command(*build_args.excluding('--quiet')).system!
32
+ end
29
33
  ::EacDocker::Executables.docker.command(*build_args).execute!.strip
30
34
  end
31
35
 
@@ -11,17 +11,31 @@ module EacDocker
11
11
  class Templatized < ::EacDocker::Images::Base
12
12
  enable_immutable
13
13
  immutable_accessor :tag
14
+ attr_reader :provide_dir
15
+
16
+ def id
17
+ tag
18
+ end
14
19
 
15
20
  def provide
16
21
  ::EacRubyUtils::Fs::Temp.on_directory do |provide_dir|
17
- template.apply(self, provide_dir)
18
- coded_image(provide_dir).tag(tag).provide
22
+ begin
23
+ self.provide_dir = provide_dir
24
+ template.apply(self, provide_dir)
25
+ coded_image(provide_dir).tag(tag).provide
26
+ ensure
27
+ self.provide_dir = nil
28
+ end
19
29
  end
20
30
  end
21
31
 
22
32
  def coded_image(provide_dir)
23
33
  ::EacDocker::Images::Coded.new(provide_dir)
24
34
  end
35
+
36
+ private
37
+
38
+ attr_writer :provide_dir
25
39
  end
26
40
  end
27
41
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_docker/executables'
4
+
5
+ module EacDocker
6
+ module Rspec
7
+ module Setup
8
+ def self.extended(obj)
9
+ obj.setup_conditional_docker_executable
10
+ end
11
+
12
+ def setup_conditional_docker_executable
13
+ conditional(:docker) { ::EacDocker::Executables.docker.validate }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,17 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/rspec/conditional'
4
- require 'eac_docker/executables'
3
+ require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module EacDocker
7
6
  module Rspec
8
- class << self
9
- def configure
10
- ::EacRubyUtils::Rspec::Conditional.default.add(:docker) do
11
- ::EacDocker::Executables.docker.validate
12
- end
13
- RSpec.configure { |config| ::EacRubyUtils::Rspec::Conditional.default.configure(config) }
14
- end
15
- end
7
+ require_sub __FILE__
16
8
  end
17
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacDocker
4
- VERSION = '0.2.2'
4
+ VERSION = '0.4.1'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::EacRubyGemSupport::Rspec.default.describe_rubocop
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,106 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file was generated by the `rspec --init` command. Conventionally, all
4
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
- # The generated `.rspec` file contains `--require spec_helper` which will cause
6
- # this file to always be loaded, without a need to explicitly require it in any
7
- # files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need
15
- # it.
16
- #
17
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
18
- RSpec.configure do |config|
19
- # rspec-expectations config goes here. You can use an alternate
20
- # assertion/expectation library such as wrong or the stdlib/minitest
21
- # assertions if you prefer.
22
- config.expect_with :rspec do |expectations|
23
- # This option will default to `true` in RSpec 4. It makes the `description`
24
- # and `failure_message` of custom matchers include text for helper methods
25
- # defined using `chain`, e.g.:
26
- # be_bigger_than(2).and_smaller_than(4).description
27
- # # => "be bigger than 2 and smaller than 4"
28
- # ...rather than:
29
- # # => "be bigger than 2"
30
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
31
- end
32
-
33
- # rspec-mocks config goes here. You can use an alternate test double
34
- # library (such as bogus or mocha) by changing the `mock_with` option here.
35
- config.mock_with :rspec do |mocks|
36
- # Prevents you from mocking or stubbing a method that does not exist on
37
- # a real object. This is generally recommended, and will default to
38
- # `true` in RSpec 4.
39
- mocks.verify_partial_doubles = true
40
- end
41
-
42
- # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
43
- # have no way to turn it off -- the option exists only for backwards
44
- # compatibility in RSpec 3). It causes shared context metadata to be
45
- # inherited by the metadata hash of host groups and examples, rather than
46
- # triggering implicit auto-inclusion in groups with matching metadata.
47
- config.shared_context_metadata_behavior = :apply_to_host_groups
48
-
49
- # The settings below are suggested to provide a good initial experience
50
- # with RSpec, but feel free to customize to your heart's content.
51
- # # This allows you to limit a spec run to individual examples or groups
52
- # # you care about by tagging them with `:focus` metadata. When nothing
53
- # # is tagged with `:focus`, all examples get run. RSpec also provides
54
- # # aliases for `it`, `describe`, and `context` that include `:focus`
55
- # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
56
- # config.filter_run_when_matching :focus
57
- #
58
- # # Allows RSpec to persist some state between runs in order to support
59
- # # the `--only-failures` and `--next-failure` CLI options. We recommend
60
- # # you configure your source control system to ignore this file.
61
- # config.example_status_persistence_file_path = "spec/examples.txt"
62
- #
63
- # # Limits the available syntax to the non-monkey patched syntax that is
64
- # # recommended. For more details, see:
65
- # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
66
- # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
67
- # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
68
- # config.disable_monkey_patching!
69
- #
70
- # # This setting enables warnings. It's recommended, but in some cases may
71
- # # be too noisy due to issues in dependencies.
72
- # config.warnings = true
73
- #
74
- # # Many RSpec users commonly either run the entire suite or an individual
75
- # # file, and it's useful to allow more verbose output when running an
76
- # # individual spec file.
77
- # if config.files_to_run.one?
78
- # # Use the documentation formatter for detailed output,
79
- # # unless a formatter has already been configured
80
- # # (e.g. via a command-line flag).
81
- # config.default_formatter = "doc"
82
- # end
83
- #
84
- # # Print the 10 slowest examples and example groups at the
85
- # # end of the spec run, to help surface which specs are running
86
- # # particularly slow.
87
- # config.profile_examples = 10
88
- #
89
- # # Run specs in random order to surface order dependencies. If you find an
90
- # # order dependency and want to debug it, you can fix the order by providing
91
- # # the seed, which is printed after each run.
92
- # # --seed 1234
93
- # config.order = :random
94
- #
95
- # # Seed global randomization in this process using the `--seed` CLI option.
96
- # # Setting this allows you to use `--seed` to deterministically reproduce
97
- # # test failures related to randomization by passing the same `--seed` value
98
- # # as the one that triggered the failure.
99
- # Kernel.srand config.seed
100
-
101
- require 'eac_ruby_gem_support/rspec'
102
- ::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
103
- end
104
-
105
- require 'eac_docker/rspec'
106
- ::EacDocker::Rspec.configure
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))