commander 4.2.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,11 @@ require 'rubygems'
2
2
  require 'stringio'
3
3
  require 'simplecov'
4
4
  SimpleCov.start do
5
- add_filter "/spec/"
5
+ add_filter '/spec/'
6
6
  end
7
7
 
8
8
  # Unshift so that local files load instead of something in gems
9
- $:.unshift File.dirname(__FILE__) + '/../lib'
9
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
10
10
 
11
11
  # This basically replicates the behavior of `require 'commander/import'`
12
12
  # but without adding an `at_exit` hook, which interferes with exit code
@@ -25,13 +25,13 @@ end
25
25
 
26
26
  def create_test_command
27
27
  command :test do |c|
28
- c.syntax = "test [options] <file>"
29
- c.description = "test description"
30
- c.example "description", "command"
31
- c.example "description 2", "command 2"
32
- c.option '-v', "--verbose", "verbose description"
33
- c.when_called do |args, options|
34
- "test %s" % args.join
28
+ c.syntax = 'test [options] <file>'
29
+ c.description = 'test description'
30
+ c.example 'description', 'command'
31
+ c.example 'description 2', 'command 2'
32
+ c.option '-v', '--verbose', 'verbose description'
33
+ c.when_called do |args, _options|
34
+ 'test %s' % args.join
35
35
  end
36
36
  end
37
37
  @command = command :test
@@ -39,7 +39,7 @@ end
39
39
 
40
40
  # Create a new command runner
41
41
 
42
- def new_command_runner *args, &block
42
+ def new_command_runner(*args, &block)
43
43
  Commander::Runner.instance_variable_set :"@singleton", Commander::Runner.new(args)
44
44
  program :name, 'test'
45
45
  program :version, '1.2.3'
@@ -55,10 +55,10 @@ def command_runner
55
55
  Commander::Runner.instance
56
56
  end
57
57
 
58
- def run *args
58
+ def run(*args)
59
59
  new_command_runner(*args) do
60
60
  program :help_formatter, Commander::HelpFormatter::Base
61
- end.run!
61
+ end.run!
62
62
  @output.string
63
63
  end
64
64
 
@@ -2,30 +2,29 @@ require 'spec_helper'
2
2
 
3
3
  describe Commander::UI do
4
4
  include Commander::Methods
5
-
6
- describe ".replace_tokens" do
7
- it "should replace tokens within a string, with hash values" do
8
- result = Commander::UI.replace_tokens 'Welcome :name, enjoy your :object'.freeze, :name => 'TJ', :object => 'cookie'
5
+
6
+ describe '.replace_tokens' do
7
+ it 'should replace tokens within a string, with hash values' do
8
+ result = Commander::UI.replace_tokens 'Welcome :name, enjoy your :object'.freeze, name: 'TJ', object: 'cookie'
9
9
  expect(result).to eq('Welcome TJ, enjoy your cookie')
10
10
  end
11
11
  end
12
12
 
13
- describe "progress" do
14
- it "should not die on an empty list" do
13
+ describe 'progress' do
14
+ it 'should not die on an empty list' do
15
15
  exception = false
16
16
  begin
17
17
  progress([]) {}
18
18
  rescue
19
19
  exception = true
20
20
  end
21
- expect(exception).not_to be_true
21
+ expect(exception).not_to be true
22
22
  end
23
23
  end
24
-
25
- describe ".available_editor" do
26
- it "should not fail on available editors with shell arguments" do
24
+
25
+ describe '.available_editor' do
26
+ it 'should not fail on available editors with shell arguments' do
27
27
  expect(Commander::UI.available_editor('sh -c')).to eq('sh -c')
28
28
  end
29
29
  end
30
-
31
30
  end
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.2.1
4
+ version: 4.3.0
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: 2014-09-29 00:00:00.000000000 Z
12
+ date: 2015-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -67,17 +67,34 @@ dependencies:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rubocop
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.29.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.29.0
70
84
  description: The complete solution for Ruby command-line executables. Commander bridges
71
85
  the gap between other terminal related libraries you know and love (OptionParser,
72
86
  HighLine), while providing many new features, and an elegant API.
73
87
  email:
74
- - ggilder@tractionco.com
88
+ - gabriel@gabrielgilder.com
75
89
  executables:
76
90
  - commander
77
91
  extensions: []
78
92
  extra_rdoc_files: []
79
93
  files:
80
94
  - ".gitignore"
95
+ - ".rspec"
96
+ - ".rubocop.yml"
97
+ - ".rubocop_todo.yml"
81
98
  - ".travis.yml"
82
99
  - DEVELOPMENT
83
100
  - Gemfile
@@ -119,7 +136,7 @@ files:
119
136
  - spec/runner_spec.rb
120
137
  - spec/spec_helper.rb
121
138
  - spec/ui_spec.rb
122
- homepage: http://visionmedia.github.com/commander
139
+ homepage: https://github.com/tj/commander
123
140
  licenses:
124
141
  - MIT
125
142
  metadata: {}
@@ -138,8 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
155
  - !ruby/object:Gem::Version
139
156
  version: '0'
140
157
  requirements: []
141
- rubyforge_project: commander
142
- rubygems_version: 2.2.2
158
+ rubyforge_project:
159
+ rubygems_version: 2.4.3
143
160
  signing_key:
144
161
  specification_version: 4
145
162
  summary: The complete solution for Ruby command-line executables