console_runner 0.1.27 → 0.1.28

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: 614357167cb89854843845188c98d84f602c205a
4
- data.tar.gz: 1b91e965ac69852bcfcb36a9f68a05050abed0fb
3
+ metadata.gz: bc3a9531df2e4e6164309a48b9711fb4ce4b82a0
4
+ data.tar.gz: 52b2b36913c2bc8a5e8baf6ef06b368b556817fe
5
5
  SHA512:
6
- metadata.gz: b444c1f0b4442c99cb0258bffafd85dc6343b5d6a95eb34dcdf1782f79607085b18c928f44d00107f7e933e04e208be3653184a6a48243d683e0b4a578e1a094
7
- data.tar.gz: fdb0675ae820cfce774d83be778e41dbbcb4a747ed1a2568ee96c1b43565eba77f562d4b657e514a50c49e89480b8096bf0a978172d70a1d9eb6d86c391f932e
6
+ metadata.gz: 1de098adb92f8c1e600898eaac0d56d9e7cbb41c1b6a3c5e1c08795f13dd841ced303c7a2e2a2f7e8e1badf7d216da94c9dfb44d0c3a25707ec710726c33b30c
7
+ data.tar.gz: ff252265a08da9bccad17fd4f315842a1e9e7136bfe3c23efd9f05b8a83ca35471a5fcc3c488135f4d0578579f232a29005a93632a66dbb9773c546dd082905c
@@ -10,16 +10,15 @@ 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
22
- CommandLineParser.debug = ARGV.any? { |a| %w(-d --debug).include? a }
21
+ @parser = Trollop::Parser.new
23
22
  @parser.opt(:debug, 'Run in debug mode.', type: :flag)
24
23
  @parser.stop_on @sub_commands
25
24
  @initialize_method = nil
@@ -4,12 +4,12 @@ require 'console_runner/version'
4
4
 
5
5
  # console_runner logic is here
6
6
  module ConsoleRunner
7
- SEPARATOR = '==================================='.freeze
7
+ CommandLineParser.debug = ARGV.any? { |a| %w(-d --debug).include? a }
8
+ SEPARATOR = '==================================='.freeze
8
9
  begin
9
10
  start_time = Time.now
10
11
  success_status = true
11
12
  puts "#{SEPARATOR}\nStart Time: #{start_time}\n#{SEPARATOR}".blue
12
-
13
13
  file_from_arg = ARGV.shift
14
14
  raise ConsoleRunnerError, 'Specify file to be executed' unless file_from_arg
15
15
  file_path = File.realpath file_from_arg
@@ -1,3 +1,3 @@
1
1
  module ConsoleRunner
2
- VERSION = '0.1.27'
2
+ VERSION = '0.1.28'
3
3
  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.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Karpovich