sickle 0.2.0 → 0.3.0

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: 9d6d7d2d6dfd2681a01e6779dcdbe4852c61a686
4
- data.tar.gz: 9d83e74583c8cab836c632ad26770da8479e1850
3
+ metadata.gz: 05f685b42a45b06451fd11b7942e8fdf01d9cb44
4
+ data.tar.gz: 03a7527ee840f4f63c557acb29f312beca1fefa0
5
5
  SHA512:
6
- metadata.gz: f6366d4ec7476621c4b293c6002bf7f961ab4ef797512ef4e4da8375f25788777b8927cec56827f1f79513fedbc11644b0e4fb422e111f1a9d6c501c3940af69
7
- data.tar.gz: b03c524c935117688ebcd826dbe3196218598658736ba075bc9cdfe8a0e730471b546289a02cb70fe48c84a4f95931c7173375f29ca52fd58c7ee84d38bad8d4
6
+ metadata.gz: f17497ea2b1218b6546076232e3f68802c39c49e326b6e9f3a8757bd84baa45c638ed1a1fc0d3906173e33708591173efd8a7d934e70ae59835540833caeb86f
7
+ data.tar.gz: 8d4f3e33fd6a27a1552c01d451393fed9f0d64ce026871fa4ac4f42cf8613f0421942cb9751e008b462e17c5b939de6670c3765139d9428dfb8f41a1458fa227
@@ -1,12 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
3
  - 1.9.3
5
4
  - 1.9.2
6
5
  - 2.0.0
7
6
  - jruby-19mode
8
- - rbx-18mode
9
7
  - rbx-19mode
10
8
  - ruby-head
11
9
  - jruby-head
12
- - ree
data/README.md CHANGED
@@ -18,6 +18,10 @@ Sickle is dead simple library for building complex command line tools. A lot of
18
18
  * Usage and help for free
19
19
  * No external dependencies (only stdlib optparse)
20
20
 
21
+ #### Requirements
22
+
23
+ * Ruby: 1.9.x, 2.0.x, jruby (1.9), rbx (1.9)
24
+
21
25
 
22
26
  ## Installation
23
27
 
data/Rakefile CHANGED
@@ -7,3 +7,4 @@ Rake::TestTask.new do |t|
7
7
  t.verbose = true
8
8
  end
9
9
 
10
+ task :default => :test
@@ -0,0 +1,3 @@
1
+ test:
2
+ override:
3
+ - bundle exec rake
@@ -77,16 +77,20 @@ module Sickle
77
77
 
78
78
  def register(parser, results)
79
79
  if @type == :boolean
80
- parser.on("--#{@name}", opts[:desc]) do
80
+ parser.on("--#{cli_name}", opts[:desc]) do
81
81
  results[@name] = true
82
82
  end
83
83
  else
84
- parser.on("--#{@name} #{@name.upcase}") do |v|
84
+ parser.on("--#{cli_name} #{@name.upcase}") do |v|
85
85
  results[@name] = coerce(v)
86
86
  end
87
87
  end
88
88
  end
89
89
 
90
+ def cli_name
91
+ @name.to_s.tr("_", "-")
92
+ end
93
+
90
94
  def coerce(value)
91
95
  case @default
92
96
  when Fixnum
@@ -174,7 +178,7 @@ module Sickle
174
178
  end
175
179
 
176
180
  def __display_option(opt)
177
- " --#{opt.name} (default: #{opt.default})"
181
+ " --#{opt.cli_name} (default: #{opt.default})"
178
182
  end
179
183
  end
180
184
 
@@ -1,3 +1,3 @@
1
1
  module Sickle
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -21,5 +21,4 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "minitest"
24
- spec.add_development_dependency "turn"
25
24
  end
@@ -1,6 +1,5 @@
1
- require "minitest/spec"
2
1
  require "minitest/autorun"
3
- require "turn"
2
+ require "minitest/pride"
4
3
 
5
4
  require File.join(File.dirname(__FILE__), "test_app")
6
5
 
@@ -24,7 +23,7 @@ describe Sickle do
24
23
  end
25
24
 
26
25
  it "correct commands options" do
27
- App.__commands["task1"].options.keys.must_equal [:quiet]
26
+ App.__commands["task1"].options.keys.must_equal [:quiet, :with_prefix]
28
27
  App.__commands["task2"].options.keys.must_equal [:fast, :slow, :number]
29
28
  end
30
29
  end
@@ -32,9 +31,9 @@ describe Sickle do
32
31
  describe "Runner" do
33
32
  it "task1" do
34
33
  App.run(["task1", "x", "y"]).must_equal(
35
- ["task1", "x", "y", "def", false, false, false])
36
- App.run(["task1", "x", "y", "z", "--verbose"]).must_equal(
37
- ["task1", "x", "y", "z", false, true, false])
34
+ ["task1", "x", "y", "def", false, false, false, false])
35
+ App.run(["task1", "x", "y", "z", "--verbose", "--with-prefix"]).must_equal(
36
+ ["task1", "x", "y", "z", false, true, false, true])
38
37
  end
39
38
 
40
39
  it "task2" do
@@ -50,8 +50,9 @@ class App
50
50
 
51
51
  desc "Run task 1"
52
52
  option :quiet
53
+ option :with_prefix
53
54
  def task1(a, b, c = "def")
54
- p ["task1", a, b, c, options[:quiet], options[:verbose], options[:debug]]
55
+ p ["task1", a, b, c, options[:quiet], options[:verbose], options[:debug], options[:with_prefix]]
55
56
  end
56
57
 
57
58
  desc "Run task 2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sickle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tymon Tobolski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-17 00:00:00.000000000 Z
11
+ date: 2013-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: turn
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description: Sickle is dead simple library for building complex command line tools.
70
56
  email:
71
57
  - i@teamon.eu
@@ -79,6 +65,7 @@ files:
79
65
  - LICENSE.txt
80
66
  - README.md
81
67
  - Rakefile
68
+ - circle.yml
82
69
  - lib/sickle.rb
83
70
  - lib/sickle/version.rb
84
71
  - sickle.gemspec
@@ -113,3 +100,4 @@ test_files:
113
100
  - spec/main_spec.rb
114
101
  - spec/test_app.rb
115
102
  - spec/test_run.rb
103
+ has_rdoc: