console_runner 0.1.26 → 0.1.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 344b4f36e59f435fa57dad5dea276ba37de733dd
4
- data.tar.gz: 045f4843e0f6dd65cac4efed1e53dfd8bbacc174
3
+ metadata.gz: 614357167cb89854843845188c98d84f602c205a
4
+ data.tar.gz: 1b91e965ac69852bcfcb36a9f68a05050abed0fb
5
5
  SHA512:
6
- metadata.gz: 201d7e5b7aa1d8bbcc5796516299d2749d2ec4cc051d9634192722d34ee063044d3d665f0549c2392ea4789f5e5d8a0f959907ca00bfbc78a04393dc57e58e5f
7
- data.tar.gz: 33aa8b4fe48bad93318c91eef3c9e3cc3de05d03688e5b2b44017ae2ee94f2fd1c909825ea96a715a26fbee7ff51b5e278a09e1eb1d618b411e99105f668ec2e
6
+ metadata.gz: b444c1f0b4442c99cb0258bffafd85dc6343b5d6a95eb34dcdf1782f79607085b18c928f44d00107f7e933e04e208be3653184a6a48243d683e0b4a578e1a094
7
+ data.tar.gz: fdb0675ae820cfce774d83be778e41dbbcb4a747ed1a2568ee96c1b43565eba77f562d4b657e514a50c49e89480b8096bf0a978172d70a1d9eb6d86c391f932e
@@ -10,15 +10,16 @@ class CommandLineParser
10
10
  # Generate tool help menu.
11
11
  # IMPORTANT! Should be executed before ARGV.shift
12
12
  def initialize(file_parser)
13
- @file_parser = file_parser
14
- @sub_commands = @file_parser.runnable_methods.map { |m| m.name.to_s }
15
- @sub_commands_text = @file_parser.runnable_methods.map do |m|
13
+ @file_parser = file_parser
14
+ @sub_commands = @file_parser.runnable_methods.map { |m| m.name.to_s }
15
+ @sub_commands_text = @file_parser.runnable_methods.map do |m|
16
16
  [
17
17
  m.name.to_s,
18
18
  FileParser.select_runnable_tags(m).map(&:text).join("\n")
19
19
  ]
20
20
  end.to_h
21
- @parser = Trollop::Parser.new
21
+ @parser = Trollop::Parser.new
22
+ CommandLineParser.debug = ARGV.any? { |a| %w(-d --debug).include? a }
22
23
  @parser.opt(:debug, 'Run in debug mode.', type: :flag)
23
24
  @parser.stop_on @sub_commands
24
25
  @initialize_method = nil
@@ -52,7 +53,6 @@ class CommandLineParser
52
53
  action_index = ARGV.index(action)
53
54
  scope = ARGV[0..action_index] if action_index
54
55
  end
55
- CommandLineParser.debug = ARGV.any? { |a| %w(-d --debug).include? a }
56
56
  return unless scope.any? { |a| %w(-h --help).include? a }
57
57
  @parser.banner("\n" + banner)
58
58
  Trollop::with_standard_exception_handling(@parser) { raise Trollop::HelpNeeded }
@@ -1,3 +1,3 @@
1
1
  module ConsoleRunner
2
- VERSION = '0.1.26'
2
+ VERSION = '0.1.27'
3
3
  end
@@ -7,5 +7,5 @@ class ConsoleRunnerError < StandardError
7
7
  @object
8
8
  end
9
9
  end
10
-
10
+
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Karpovich