simple-cli 0.2.10 → 0.2.11

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
- SHA1:
3
- metadata.gz: 44520b7c6a838460bc19bbf57d6a994868260eea
4
- data.tar.gz: 36fbf74ca169e31d4a3d10bad17fe204b6c70d80
2
+ SHA256:
3
+ metadata.gz: 0f1c16037299ca7f383eb093ad4b6c238c242a99d7a1025c12fd3e6a9072e8c6
4
+ data.tar.gz: 4a5884aea0b768e946466dc6d38ec72cbcc1952d10cc8d67aad51d63b05073aa
5
5
  SHA512:
6
- metadata.gz: cf5539eae076672f770c5d3e59d448c6968b691d5c1fd0b1408765db5b56b49acd758a65ae9a3fc4b665c17213fd3061f5fdedb12a191be3dfc3760c49910aa3
7
- data.tar.gz: 12eb5c2d861764eb55aa5fbeee97468f19c0bdac0517c81365eb8650b99ee57daa116fc4ee8df77be145f799fef34336828f825d6f9f67731cf2156064ebaeae
6
+ metadata.gz: 22e37371acf5ab7141051adf9c111859d24c68903bfc5a01cc8a1e2a7fd93bbd3bd505c451f73a9836ba9819a3bf0ce8050f4b88e0dad0969c37709cfeb13a52
7
+ data.tar.gz: 52aa6a48f7b9c7483576590b4418242f9d6f10ec24e6b7fcea227274ef0dc727ec521a2e4deeadef2ff2686d3979a77e82e0e45e3ae8aa0f38c5ee377e77ed2f
data/.rubocop.yml CHANGED
@@ -42,3 +42,30 @@ Lint/MissingCopEnableDirective:
42
42
 
43
43
  Style/RegexpLiteral:
44
44
  Enabled: false
45
+
46
+ Style/PercentLiteralDelimiters:
47
+ Enabled: false
48
+
49
+ Style/FormatStringToken:
50
+ Enabled: false
51
+
52
+ Style/IfUnlessModifier:
53
+ Enabled: false
54
+
55
+ Style/ParallelAssignment:
56
+ Enabled: false
57
+
58
+ Style/FormatString:
59
+ Enabled: false
60
+
61
+ Style/SymbolArray:
62
+ Enabled: false
63
+
64
+ Layout/SpaceInsideArrayLiteralBrackets:
65
+ Enabled: false
66
+
67
+ Style/TrailingCommaInLiteral:
68
+ Enabled: false
69
+
70
+ Performance/Caller:
71
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple-cli (0.2.10)
4
+ simple-cli (0.2.11)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -55,4 +55,4 @@ DEPENDENCIES
55
55
  simplecov (~> 0)
56
56
 
57
57
  BUNDLED WITH
58
- 1.16.2
58
+ 1.16.4
@@ -1,11 +1,15 @@
1
+ # rubocop:disable Metrics/AbcSize
2
+ # rubocop:disable Metrics/MethodLength
3
+
1
4
  class Simple::CLI::Logger::Adapter
2
5
  def initialize(logger)
3
6
  @logger = logger
4
7
  end
5
8
 
6
- def method_missing(*args, &block)
7
- @logger.send *args, &block
8
- end
9
+ LOGGER_METHODS = [ :debug, :info, :warn, :error, :fatal, :level, :level= ]
10
+
11
+ extend Forwardable
12
+ delegate LOGGER_METHODS => :@logger
9
13
 
10
14
  def success(msg, *args, &block)
11
15
  if @logger.respond_to?(:success)
@@ -16,6 +20,8 @@ class Simple::CLI::Logger::Adapter
16
20
  end
17
21
 
18
22
  def benchmark(msg, *args, &block)
23
+ _ = block
24
+
19
25
  severity = :warn
20
26
  if msg.is_a?(Symbol)
21
27
  severity, msg = msg, args.shift
@@ -1,7 +1,10 @@
1
+ # rubocop:disable Metrics/AbcSize
2
+ # rubocop:disable Metrics/MethodLength
3
+
1
4
  module Simple::CLI::Logger::ColoredLogger
2
5
  extend self
3
6
 
4
- attr :level, true
7
+ attr_accessor :level
5
8
 
6
9
  COLORS = {
7
10
  clear: "\e[0m", # Embed in a String to clear all previous ANSI sequences.
@@ -25,13 +28,14 @@ module Simple::CLI::Logger::ColoredLogger
25
28
  on_white: "\e[47m" # Set the terminal's background ANSI color to white.
26
29
  }
27
30
 
31
+ # rubocop:disable Style/ClassVars
28
32
  @@started_at = Time.now
29
33
 
30
34
  MESSAGE_COLOR = {
31
- :info => :cyan,
32
- :warn => :yellow,
33
- :error => :red,
34
- :success => :green,
35
+ info: :cyan,
36
+ warn: :yellow,
37
+ error: :red,
38
+ success: :green,
35
39
  }
36
40
 
37
41
  def debug(msg, *args)
@@ -77,7 +81,7 @@ module Simple::CLI::Logger::ColoredLogger
77
81
 
78
82
  msg_length = msg.length
79
83
 
80
- if color = COLORS[MESSAGE_COLOR[sym]]
84
+ if (color = COLORS[MESSAGE_COLOR[sym]])
81
85
  msg = "#{color}#{msg}#{COLORS[:clear]}"
82
86
  end
83
87
 
data/lib/simple/cli/pp.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # rubocop:disable Lint/HandleExceptions
2
+
1
3
  require "pp"
2
4
 
3
5
  begin
@@ -74,7 +74,7 @@ class Simple::CLI::Runner
74
74
  #{edoc.full}
75
75
  MSG
76
76
 
77
- exit 1
77
+ exit 1
78
78
  end
79
79
 
80
80
  def logger
@@ -36,7 +36,7 @@ module Simple::CLI::Runner::Autocompletion
36
36
  if subcommand == "help"
37
37
  completions = commands.map(&:to_s).map { |s| s.tr("_", ":") } + ["autocomplete"]
38
38
  filter_completions completions, prefix: cur
39
- elsif cur && cur[0,1] == "-"
39
+ elsif cur && cur[0, 1] == "-"
40
40
  completions = CommandHelp.option_names(@app, string_to_command(subcommand))
41
41
  completions += DEFAULT_OPTIONS
42
42
 
@@ -1,5 +1,5 @@
1
1
  module Simple
2
2
  module CLI
3
- VERSION = "0.2.10"
3
+ VERSION = "0.2.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-21 00:00:00.000000000 Z
12
+ date: 2018-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.5.1
118
+ rubygems_version: 2.7.6
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Simple CLI builder for ruby