commander 4.4.6 → 4.4.7

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
  SHA256:
3
- metadata.gz: 584705d6b59c75d49df6d2369763f91b5a5dbc5013575dbb2be575983b040f60
4
- data.tar.gz: 0bab3911300bcc194406717c08ab1718608c86fe62703f0219a16a645bded947
3
+ metadata.gz: 9bb88c28e0d43c3616cceb161661a306fbcb74ef6c68ce67bc5aee8e820498cd
4
+ data.tar.gz: 9c5295c278179f4325c179b61a07182c45f3ed911b8228294cdf53e83cb6fe74
5
5
  SHA512:
6
- metadata.gz: 1bb1d5703d53f0c6a140e7f24e0d4c9f0e80283425b2daf49d80da554a78122d4eb731bb9ee817c11e0636732938ffab81367312f599b40c3c8f8dc036ab9604
7
- data.tar.gz: 1da0b8c354a4b0fc744e170c6d6e3393ddbb759ae9fecf50cf06274ee1611dd48d1f9c69e0414c3b28d2d810d56e0a6348c17eec3c58b084dd14f594a7f9a3b4
6
+ metadata.gz: 977685b95002c9e0dcaafd60da783473dc1e2d90f72eec6c1fc209d7ba6ff498f7941f2ac263244775d58d5f41b7bda7e57d7a39041963d8ec85852c20b99ee9
7
+ data.tar.gz: 2c2eb1a834b1446b61d0ac7dbeb8f0575f80ab10e57d432a6710c4e37eb24eb870a6312655be5f27f3d4250505320f04fb46c763f91ef688b9e6c96fa573b45e
@@ -1,3 +1,7 @@
1
+ === 4.4.7 / 2018-10-22
2
+
3
+ * Update HighLine dependency to 2.0.0. (@rohitpaulk)
4
+
1
5
  === 4.4.6 / 2018-07-31
2
6
 
3
7
  * Fix unexpected internal behavior change introduced in 4.4.5.
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
19
19
  s.require_paths = ['lib']
20
20
 
21
- s.add_runtime_dependency('highline', '~> 1.7.2')
21
+ s.add_runtime_dependency('highline', '~> 2.0.0')
22
22
 
23
23
  s.add_development_dependency('rspec', '~> 3.2')
24
24
  s.add_development_dependency('rake')
@@ -1,7 +1,7 @@
1
1
  class Array
2
2
  ##
3
3
  # Split _string_ into an array. Used in
4
- # conjunction with Highline's #ask, or #ask_for_array
4
+ # conjunction with HighLine's #ask, or #ask_for_array
5
5
  # methods, which must respond to #parse.
6
6
  #
7
7
  # This method allows escaping of whitespace. For example
@@ -1,22 +1,22 @@
1
1
 
2
- <%= $terminal.color "NAME", :bold %>:
2
+ <%= HighLine.default_instance.color "NAME", :bold %>:
3
3
 
4
4
  <%= @name %>
5
5
  <% if @syntax -%>
6
6
 
7
- <%= $terminal.color "SYNOPSIS", :bold %>:
7
+ <%= HighLine.default_instance.color "SYNOPSIS", :bold %>:
8
8
 
9
9
  <%= @syntax -%>
10
10
 
11
11
  <% end -%>
12
12
 
13
- <%= $terminal.color "DESCRIPTION", :bold %>:
13
+ <%= HighLine.default_instance.color "DESCRIPTION", :bold %>:
14
14
 
15
15
  <%= Commander::HelpFormatter.indent 4, (@description || @summary || 'No description.') -%>
16
16
 
17
17
  <% unless @examples.empty? -%>
18
18
 
19
- <%= $terminal.color "EXAMPLES", :bold %>:
19
+ <%= HighLine.default_instance.color "EXAMPLES", :bold %>:
20
20
  <% for description, command in @examples -%>
21
21
 
22
22
  # <%= description %>
@@ -25,10 +25,10 @@
25
25
  <% end -%>
26
26
  <% unless @options.empty? -%>
27
27
 
28
- <%= $terminal.color "OPTIONS", :bold %>:
28
+ <%= HighLine.default_instance.color "OPTIONS", :bold %>:
29
29
  <% for option in @options -%>
30
30
 
31
- <%= option[:switches].join ', ' %>
31
+ <%= option[:switches].join ', ' %>
32
32
  <%= Commander::HelpFormatter.indent 8, option[:description] %>
33
33
  <% end -%>
34
34
  <% end -%>
@@ -1,34 +1,34 @@
1
- <%= $terminal.color "NAME", :bold %>:
1
+ <%= HighLine.default_instance.color "NAME", :bold %>:
2
2
 
3
3
  <%= program :name %>
4
4
 
5
- <%= $terminal.color "DESCRIPTION", :bold %>:
5
+ <%= HighLine.default_instance.color "DESCRIPTION", :bold %>:
6
6
 
7
7
  <%= Commander::HelpFormatter.indent 4, program(:description) %>
8
8
 
9
- <%= $terminal.color "COMMANDS", :bold %>:
9
+ <%= HighLine.default_instance.color "COMMANDS", :bold %>:
10
10
  <% for name, command in @commands.sort -%>
11
11
  <% unless alias? name %>
12
12
  <%= "%-#{max_command_length}s %s" % [command.name, command.summary || command.description] -%>
13
13
  <% end -%>
14
14
  <% end %>
15
15
  <% unless @aliases.empty? %>
16
- <%= $terminal.color "ALIASES", :bold %>:
16
+ <%= HighLine.default_instance.color "ALIASES", :bold %>:
17
17
  <% for alias_name, args in @aliases.sort %>
18
18
  <%= "%-#{max_aliases_length}s %s %s" % [alias_name, command(alias_name).name, args.join(' ')] -%>
19
19
  <% end %>
20
20
  <% end %>
21
21
  <% unless @options.empty? -%>
22
- <%= $terminal.color "GLOBAL OPTIONS", :bold %>:
22
+ <%= HighLine.default_instance.color "GLOBAL OPTIONS", :bold %>:
23
23
  <% for option in @options -%>
24
24
 
25
- <%= option[:switches].join ', ' %>
25
+ <%= option[:switches].join ', ' %>
26
26
  <%= option[:description] %>
27
27
  <% end -%>
28
28
  <% end -%>
29
29
  <% if program :help -%>
30
30
  <% for title, body in program(:help) %>
31
- <%= $terminal.color title.to_s.upcase, :bold %>:
31
+ <%= HighLine.default_instance.color title.to_s.upcase, :bold %>:
32
32
 
33
33
  <%= body %>
34
34
  <% end -%>
@@ -4,8 +4,8 @@ module Commander
4
4
  include Commander::UI::AskForClass
5
5
  include Commander::Delegates
6
6
 
7
- if $stdin.tty? && (cols = $terminal.output_cols) >= 40
8
- $terminal.wrap_at = cols - 5
7
+ if $stdin.tty? && (cols = HighLine.default_instance.output_cols) >= 40
8
+ HighLine.default_instance.wrap_at = cols - 5
9
9
  end
10
10
  end
11
11
  end
@@ -448,7 +448,7 @@ module Commander
448
448
  end
449
449
 
450
450
  def say(*args) #:nodoc:
451
- $terminal.say(*args)
451
+ HighLine.default_instance.say(*args)
452
452
  end
453
453
  end
454
454
  end
@@ -66,7 +66,7 @@ module Commander
66
66
 
67
67
  def say_ok(*args)
68
68
  args.each do |arg|
69
- say $terminal.color(arg, :green)
69
+ say HighLine.default_instance.color(arg, :green)
70
70
  end
71
71
  end
72
72
 
@@ -80,7 +80,7 @@ module Commander
80
80
 
81
81
  def say_warning(*args)
82
82
  args.each do |arg|
83
- say $terminal.color(arg, :yellow)
83
+ say HighLine.default_instance.color(arg, :yellow)
84
84
  end
85
85
  end
86
86
 
@@ -94,7 +94,7 @@ module Commander
94
94
 
95
95
  def say_error(*args)
96
96
  args.each do |arg|
97
- say $terminal.color(arg, :red)
97
+ say HighLine.default_instance.color(arg, :red)
98
98
  end
99
99
  end
100
100
 
@@ -113,7 +113,7 @@ module Commander
113
113
  # * highligh: on_<color>
114
114
 
115
115
  def color(*args)
116
- say $terminal.color(*args)
116
+ say HighLine.default_instance.color(*args)
117
117
  end
118
118
 
119
119
  ##
@@ -329,7 +329,7 @@ module Commander
329
329
  # define methods for common classes
330
330
  [Float, Integer, String, Symbol, Regexp, Array, File, Pathname].each do |klass|
331
331
  define_method "ask_for_#{klass.to_s.downcase}" do |prompt|
332
- $terminal.ask(prompt, klass)
332
+ HighLine.default_instance.ask(prompt, klass)
333
333
  end
334
334
  end
335
335
 
@@ -351,7 +351,7 @@ module Commander
351
351
 
352
352
  klass = available_classes.find { |k| k.to_s.downcase == requested_class }
353
353
  if klass
354
- $terminal.ask(prompt, klass)
354
+ HighLine.default_instance.ask(prompt, klass)
355
355
  else
356
356
  super
357
357
  end
@@ -509,9 +509,9 @@ module Commander
509
509
  return if finished?
510
510
  erase_line
511
511
  if completed?
512
- $terminal.say UI.replace_tokens(@complete_message, generate_tokens) if @complete_message.is_a? String
512
+ HighLine.default_instance.say UI.replace_tokens(@complete_message, generate_tokens) if @complete_message.is_a? String
513
513
  else
514
- $terminal.say UI.replace_tokens(@format, generate_tokens) << ' '
514
+ HighLine.default_instance.say UI.replace_tokens(@format, generate_tokens) << ' '
515
515
  end
516
516
  end
517
517
 
@@ -544,7 +544,7 @@ module Commander
544
544
 
545
545
  def erase_line
546
546
  # highline does not expose the output stream
547
- $terminal.instance_variable_get('@output').print "\r\e[K"
547
+ HighLine.default_instance.instance_variable_get('@output').print "\r\e[K"
548
548
  end
549
549
  end
550
550
  end
@@ -1,3 +1,3 @@
1
1
  module Commander
2
- VERSION = '4.4.6'.freeze
2
+ VERSION = '4.4.7'.freeze
3
3
  end
@@ -16,12 +16,12 @@ describe Commander::Methods do
16
16
 
17
17
  before do
18
18
  allow(terminal).to receive(:ask)
19
- $_old_terminal = $terminal
20
- $terminal = terminal
19
+ @old_highline = HighLine.default_instance
20
+ HighLine.default_instance = terminal
21
21
  end
22
22
 
23
23
  after do
24
- $terminal = $_old_terminal
24
+ HighLine.default_instance = @old_highline
25
25
  end
26
26
 
27
27
  subject do
@@ -18,7 +18,7 @@ require 'commander/methods'
18
18
  def mock_terminal
19
19
  @input = StringIO.new
20
20
  @output = StringIO.new
21
- $terminal = HighLine.new @input, @output
21
+ HighLine.default_instance = HighLine.new(@input, @output)
22
22
  end
23
23
 
24
24
  # Create test command for usage within several specs
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commander
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.6
4
+ version: 4.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-01 00:00:00.000000000 Z
12
+ date: 2018-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.7.2
20
+ version: 2.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.7.2
27
+ version: 2.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement