ehbrs-tools 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +13 -0
  3. data/exe/ehbrs +6 -0
  4. data/lib/ehbrs.rb +7 -0
  5. data/lib/ehbrs/executables.rb +28 -0
  6. data/lib/ehbrs/tools.rb +9 -0
  7. data/lib/ehbrs/tools/runner.rb +35 -0
  8. data/lib/ehbrs/tools/runner/vg.rb +26 -0
  9. data/lib/ehbrs/tools/runner/vg/ips.rb +90 -0
  10. data/lib/ehbrs/tools/runner/videos.rb +25 -0
  11. data/lib/ehbrs/tools/runner/videos/unsupported.rb +65 -0
  12. data/lib/ehbrs/tools/version.rb +7 -0
  13. data/lib/ehbrs/videos.rb +9 -0
  14. data/lib/ehbrs/videos/convert_job.rb +99 -0
  15. data/lib/ehbrs/videos/file.rb +70 -0
  16. data/lib/ehbrs/videos/profiles/base.rb +35 -0
  17. data/lib/ehbrs/videos/profiles/same_quality.rb +21 -0
  18. data/lib/ehbrs/videos/track.rb +27 -0
  19. data/lib/ehbrs/videos/unsupported/check_result.rb +24 -0
  20. data/lib/ehbrs/videos/unsupported/check_set.rb +43 -0
  21. data/lib/ehbrs/videos/unsupported/check_support.rb +68 -0
  22. data/lib/ehbrs/videos/unsupported/checks.rb +13 -0
  23. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +27 -0
  24. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +26 -0
  25. data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +23 -0
  26. data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +25 -0
  27. data/lib/ehbrs/videos/unsupported/checks/invalid_extension.rb +25 -0
  28. data/lib/ehbrs/videos/unsupported/file.rb +50 -0
  29. data/lib/ehbrs/videos/unsupported/file/fix.rb +45 -0
  30. data/lib/ehbrs/videos/unsupported/fix_profile.rb +56 -0
  31. data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +36 -0
  32. data/lib/ehbrs/videos/unsupported/fixes/supported_container.rb +17 -0
  33. data/lib/ehbrs/videos/unsupported/profiles.rb +13 -0
  34. data/lib/ehbrs/videos/unsupported/profiles/base.rb +102 -0
  35. data/lib/ehbrs/videos/unsupported/profiles/philco.rb +27 -0
  36. data/lib/ehbrs/videos/unsupported/profiles/samsung.rb +32 -0
  37. data/lib/ehbrs/videos/unsupported/search.rb +72 -0
  38. data/lib/ehbrs/videos/unsupported/track.rb +32 -0
  39. data/vendor/eac_cli/Gemfile +5 -0
  40. data/vendor/eac_cli/eac_cli.gemspec +18 -0
  41. data/vendor/eac_cli/lib/eac_cli.rb +7 -0
  42. data/vendor/eac_cli/lib/eac_cli/default_runner.rb +22 -0
  43. data/vendor/eac_cli/lib/eac_cli/runner.rb +30 -0
  44. data/vendor/eac_cli/lib/eac_cli/runner/argument_option.rb +13 -0
  45. data/vendor/eac_cli/lib/eac_cli/runner/base_option.rb +22 -0
  46. data/vendor/eac_cli/lib/eac_cli/runner/boolean_option.rb +13 -0
  47. data/vendor/eac_cli/lib/eac_cli/runner/definition.rb +60 -0
  48. data/vendor/eac_cli/lib/eac_cli/runner/docopt_doc.rb +65 -0
  49. data/vendor/eac_cli/lib/eac_cli/runner/positional_argument.rb +15 -0
  50. data/vendor/eac_cli/lib/eac_cli/version.rb +5 -0
  51. data/vendor/eac_cli/spec/rubocop_spec.rb +7 -0
  52. data/vendor/eac_cli/spec/spec_helper.rb +100 -0
  53. data/vendor/eac_ruby_utils/Gemfile +16 -0
  54. data/vendor/eac_ruby_utils/MIT-LICENCE +16 -0
  55. data/vendor/eac_ruby_utils/README.rdoc +3 -0
  56. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +25 -0
  57. data/vendor/eac_ruby_utils/lib/eac_ruby_utils.rb +23 -0
  58. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb +81 -0
  59. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +133 -0
  60. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs.rb +82 -0
  61. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb +66 -0
  62. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb +5 -0
  63. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +135 -0
  64. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +39 -0
  65. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +18 -0
  66. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb +25 -0
  67. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_settings.rb +19 -0
  68. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +139 -0
  69. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker.rb +134 -0
  70. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_class_methods.rb +39 -0
  71. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/list.rb +63 -0
  72. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/node.rb +25 -0
  73. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +16 -0
  74. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +5 -0
  75. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs.rb +23 -0
  76. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/base_env.rb +28 -0
  77. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +155 -0
  78. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +46 -0
  79. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +51 -0
  80. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/file.rb +22 -0
  81. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/local_env.rb +17 -0
  82. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb +19 -0
  83. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env.rb +72 -0
  84. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +53 -0
  85. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_traverser.rb +56 -0
  86. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +11 -0
  87. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable.rb +17 -0
  88. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/class_methods.rb +14 -0
  89. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/instance_methods.rb +30 -0
  90. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb +23 -0
  91. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +89 -0
  92. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb +61 -0
  93. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/string_list.rb +19 -0
  94. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +38 -0
  95. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/on_clean_ruby_environment.rb +23 -0
  96. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/options_consumer.rb +62 -0
  97. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patch.rb +11 -0
  98. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches.rb +4 -0
  99. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class.rb +4 -0
  100. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb +9 -0
  101. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb +5 -0
  102. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb +10 -0
  103. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb +10 -0
  104. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb +4 -0
  105. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb +10 -0
  106. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/listable.rb +10 -0
  107. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch.rb +9 -0
  108. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/require_sub.rb +9 -0
  109. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb +10 -0
  110. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb +5 -0
  111. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb +14 -0
  112. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb +12 -0
  113. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +16 -0
  114. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb +95 -0
  115. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +11 -0
  116. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec.rb +9 -0
  117. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +38 -0
  118. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +44 -0
  119. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +65 -0
  120. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +42 -0
  121. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates.rb +9 -0
  122. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/directory.rb +104 -0
  123. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/file.rb +101 -0
  124. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/searcher.rb +55 -0
  125. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +5 -0
  126. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +13 -0
  127. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb +17 -0
  128. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +36 -0
  129. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb +31 -0
  130. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/configs_spec.rb +14 -0
  131. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/docopt_runner_spec.rb +136 -0
  132. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/speaker_spec.rb +36 -0
  133. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb +33 -0
  134. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/ssh_env_spec.rb +25 -0
  135. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb +32 -0
  136. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +180 -0
  137. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +45 -0
  138. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/options_consumer_spec.rb +17 -0
  139. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb +13 -0
  140. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/console_speaker_spec.rb +13 -0
  141. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +13 -0
  142. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +13 -0
  143. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/if_present_spec.rb +13 -0
  144. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec.rb +23 -0
  145. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec_files/path/my_stub_with_template +1 -0
  146. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/paths_hash_spec.rb +49 -0
  147. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +46 -0
  148. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +102 -0
  149. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb +34 -0
  150. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/expected_content +2 -0
  151. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/source.template +2 -0
  152. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb +30 -0
  153. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file1.template +1 -0
  154. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file2 +1 -0
  155. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path2/subdir1/file3.template +1 -0
  156. data/vendor/eac_ruby_utils/spec/locales/pt-BR.yml +38 -0
  157. data/vendor/eac_ruby_utils/spec/spec_helper.rb +12 -0
  158. metadata +227 -0
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs/videos/unsupported/check_support'
4
+
5
+ module Ehbrs
6
+ module Videos
7
+ module Unsupported
8
+ class Track < ::SimpleDelegator
9
+ include ::Ehbrs::Videos::Unsupported::CheckSupport
10
+
11
+ enable_console_speaker
12
+ enable_simple_cache
13
+ attr_reader :video
14
+
15
+ def initialize(video, track)
16
+ @video = video
17
+ super(track)
18
+ end
19
+
20
+ def banner
21
+ aggressions_banner("Track #{self}")
22
+ end
23
+
24
+ def check_set_key
25
+ :track_check_set
26
+ end
27
+
28
+ delegate :options, to: :video
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'eac_cli/version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = 'eac_cli'
9
+ s.version = ::EacCli::VERSION
10
+ s.authors = ['Esquilo Azul Company']
11
+ s.summary = 'Utilities to build CLI applications with Ruby.'
12
+
13
+ s.files = Dir['{lib}/**/*', 'Gemfile']
14
+
15
+ s.add_dependency 'eac_ruby_utils', '~> 0.23
16
+ '
17
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1'
18
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ require_sub __FILE__
7
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/concern'
4
+ require 'eac_cli/runner'
5
+ require 'eac_ruby_utils/console/speaker'
6
+ require 'eac_ruby_utils/simple_cache'
7
+
8
+ module EacCli
9
+ module DefaultRunner
10
+ extend ::ActiveSupport::Concern
11
+
12
+ included do
13
+ include ::EacCli::Runner
14
+ include ::EacRubyUtils::Console::Speaker
15
+ include ::EacRubyUtils::SimpleCache
16
+ runner_definition.alt do
17
+ options_arg false
18
+ bool_opt '-h', '--help', 'Show help.', usage: true
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner/definition'
4
+ require 'eac_cli/runner/docopt_doc'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module EacCli
8
+ module Runner
9
+ extend ::ActiveSupport::Concern
10
+
11
+ included do
12
+ extend ClassMethods
13
+ include InstanceMethods
14
+ end
15
+
16
+ module ClassMethods
17
+ def runner_definition(&block)
18
+ @runner_definition ||= ::EacCli::Runner::Definition.new
19
+ @runner_definition.instance_eval(&block) if block
20
+ @runner_definition
21
+ end
22
+ end
23
+
24
+ module InstanceMethods
25
+ def doc
26
+ ::EacCli::Runner::DocoptDoc.new(self.class.runner_definition).to_s
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner/base_option'
4
+
5
+ module EacCli
6
+ module Runner
7
+ class ArgumentOption < ::EacCli::Runner::BaseOption
8
+ def argument?
9
+ true
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ module Runner
7
+ class BaseOption
8
+ attr_reader :short, :long, :description, :options
9
+
10
+ def initialize(short, long, description, options = {})
11
+ @short = short
12
+ @long = long
13
+ @description = description
14
+ @options = options.with_indifferent_access
15
+ end
16
+
17
+ def show_on_usage?
18
+ options[:usage]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner/base_option'
4
+
5
+ module EacCli
6
+ module Runner
7
+ class BooleanOption < ::EacCli::Runner::BaseOption
8
+ def argument?
9
+ false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner/argument_option'
4
+ require 'eac_cli/runner/boolean_option'
5
+ require 'eac_cli/runner/positional_argument'
6
+ require 'eac_ruby_utils/core_ext'
7
+
8
+ module EacCli
9
+ module Runner
10
+ class Definition
11
+ require_sub __FILE__
12
+ attr_accessor :description
13
+ attr_accessor :options_argument
14
+
15
+ def initialize
16
+ self.description = '-- NO DESCRIPTION SET --'
17
+ self.options_argument = true
18
+ end
19
+
20
+ def alt(&block)
21
+ r = ::EacCli::Runner::Definition.new
22
+ r.instance_eval(&block)
23
+ alternatives << r
24
+ r
25
+ end
26
+
27
+ def alternatives
28
+ @alternatives ||= []
29
+ end
30
+
31
+ def arg_opt(short, long, description, option_options = {})
32
+ options << ArgumentOption.new(short, long, description, option_options)
33
+ end
34
+
35
+ def bool_opt(short, long, description, option_options = {})
36
+ options << BooleanOption.new(short, long, description, option_options)
37
+ end
38
+
39
+ def desc(description)
40
+ self.description = description
41
+ end
42
+
43
+ def options_arg(options_argument)
44
+ self.options_argument = options_argument
45
+ end
46
+
47
+ def options
48
+ @options ||= []
49
+ end
50
+
51
+ def pos_arg(name, arg_options = {})
52
+ positional << PositionalArgument.new(name, arg_options)
53
+ end
54
+
55
+ def positional
56
+ @positional ||= []
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils/console/docopt_runner'
5
+
6
+ module EacCli
7
+ module Runner
8
+ class DocoptDoc
9
+ common_constructor :definition
10
+
11
+ SEP = ' '
12
+ IDENT = SEP * 2
13
+ OPTION_DESC_SEP = IDENT * 2
14
+
15
+ def positional_argument(positional)
16
+ r = "<#{positional.name}>"
17
+ r += '...' if positional.repeat?
18
+ r
19
+ end
20
+
21
+ def option_argument(option)
22
+ option_long(option)
23
+ end
24
+
25
+ def option_definition(option)
26
+ option.short + SEP + option_long(option) + OPTION_DESC_SEP + option.description
27
+ end
28
+
29
+ def option_long(option)
30
+ b = option.long
31
+ b += '=<value>' if option.argument?
32
+ b
33
+ end
34
+
35
+ def section(header, include_header = true)
36
+ b = include_header ? "#{header.humanize}:\n" : ''
37
+ b += send("self_#{header}") + "\n"
38
+ definition.alternatives.each do |alternative|
39
+ b += self.class.new(alternative).section(header, false)
40
+ end
41
+ b
42
+ end
43
+
44
+ def self_options
45
+ definition.options.map { |option| IDENT + option_definition(option) }.join("\n")
46
+ end
47
+
48
+ def self_usage
49
+ b = IDENT + ::EacRubyUtils::Console::DocoptRunner::PROGRAM_MACRO
50
+ b += "#{SEP}[options]" if definition.options_argument
51
+ b + self_usage_arguments
52
+ end
53
+
54
+ def self_usage_arguments
55
+ definition.options.select(&:show_on_usage?)
56
+ .map { |option| "#{SEP}#{option_argument(option)}" }.join +
57
+ definition.positional.map { |p| "#{SEP}#{positional_argument(p)}" }.join
58
+ end
59
+
60
+ def to_s
61
+ "#{definition.description}\n\n#{section('usage')}\n#{section('options')}\n"
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ module Runner
7
+ class PositionalArgument
8
+ common_constructor :name, :options, default: [{}]
9
+
10
+ def repeat?
11
+ options[:repeat]
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacCli
4
+ VERSION = '0.2.0'
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_gem_support/spec/examples/rubocop_check'
4
+
5
+ RSpec.describe ::RuboCop, slow: true do
6
+ include_examples 'rubocop_check', ::File.expand_path('..', __dir__)
7
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
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
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Declare your gem's dependencies in users_support.gemspec.
6
+ # Bundler will treat runtime dependencies like base dependencies, and
7
+ # development dependencies will be added by default to the :development group.
8
+ gemspec
9
+
10
+ # Declare any dependencies that are still in development here instead of in
11
+ # your gemspec. These might include edge Rails or gems from your path or
12
+ # Git. Remember to move these dependencies to your gemspec before releasing
13
+ # your gem to rubygems.org.
14
+
15
+ # To use a debugger
16
+ # gem 'byebug', group: [:development, :test]