slop 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
- 3.1.0
2
- -----
1
+ 3.1.1 (2012-04-24)
2
+ ------------------
3
+
4
+ * Ensure separators before any options are still being processed (#62)
5
+
6
+ 3.1.0 (2012-04-23)
7
+ ------------------
3
8
 
4
9
  * Allow options to be fetched via underscores instead of dashes
5
10
  (as a fallback) (Eric Anderson, #51)
data/lib/slop.rb CHANGED
@@ -4,7 +4,7 @@ require 'slop/commands'
4
4
  class Slop
5
5
  include Enumerable
6
6
 
7
- VERSION = '3.1.0'
7
+ VERSION = '3.1.1'
8
8
 
9
9
  # The main Error class, all Exception classes inherit from this class.
10
10
  class Error < StandardError; end
@@ -349,7 +349,14 @@ class Slop
349
349
  optstr = opts.each_with_index.map { |o, i|
350
350
  (str = @separators[i + 1]) ? [o, str].join("\n") : o
351
351
  }.join("\n")
352
- config[:banner] ? config[:banner] + "\n" + optstr : optstr
352
+
353
+ if config[:banner]
354
+ config[:banner] << "\n"
355
+ config[:banner] << "#{@separators[0]}\n" if @separators[0]
356
+ config[:banner] + optstr
357
+ else
358
+ optstr
359
+ end
353
360
  end
354
361
  alias help to_s
355
362
 
data/slop.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'slop'
3
- s.version = '3.1.0'
3
+ s.version = '3.1.1'
4
4
  s.summary = 'Option gathering made easy'
5
5
  s.description = 'A simple DSL for gathering options and parsing the command line'
6
6
  s.author = 'Lee Jarvis'
data/test/slop_test.rb CHANGED
@@ -295,6 +295,12 @@ class SlopTest < TestCase
295
295
  on :bar
296
296
  end
297
297
  assert_equal " --foo \nhello\nworld\n --bar ", opts.help
298
+
299
+ opts = Slop.new do
300
+ banner "foo"
301
+ separator "bar"
302
+ end
303
+ assert_equal "foo\nbar\n", opts.help
298
304
  end
299
305
 
300
306
  test "printing help with :help => true" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-23 00:00:00.000000000 Z
12
+ date: 2012-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70221805243820 !ruby/object:Gem::Requirement
16
+ requirement: &70218307194080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70221805243820
24
+ version_requirements: *70218307194080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &70221805243060 !ruby/object:Gem::Requirement
27
+ requirement: &70218307193220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70221805243060
35
+ version_requirements: *70218307193220
36
36
  description: A simple DSL for gathering options and parsing the command line
37
37
  email: lee@jarvis.co
38
38
  executables: []
@@ -68,7 +68,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  segments:
70
70
  - 0
71
- hash: -2177478579712084864
71
+ hash: 2699776983474295895
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: -2177478579712084864
80
+ hash: 2699776983474295895
81
81
  requirements: []
82
82
  rubyforge_project:
83
83
  rubygems_version: 1.8.11