sickle 0.1.0 → 0.1.1

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: 03ca9b3349e1160e67bf4a7377b1c8ecbae4994c
4
- data.tar.gz: e9e1e24472aa2adb8187c71252b419fbffb4b13f
3
+ metadata.gz: c06036c890b687b9b31db7c53c1257557f3b17ac
4
+ data.tar.gz: 54b6d5568832346a90feef14ee5503123ed8a7a2
5
5
  SHA512:
6
- metadata.gz: 1c5ee9bb8e2d698b345aa890e4f12085b2d69b38223be0fbbcc914f11d3a1b73a6c9fe2ceb59a74e1f8f3156dbc904c4f66b33c6a6dbb85074e4c451fcd1a722
7
- data.tar.gz: 99d5204b414e825d52c9ef011c3f6490677f9d6bc32c904fb0cc05a03b9dc610ec6785d86fa1edef53c60c5be9eef0065960d7787ce2514042ecb6f9ce55ac2a
6
+ metadata.gz: bf0531a520789a8092b9a7d191fd0599addef42b488504c38a2767223559d3d9078239176206bf62c906bfdd427a247d425de8e7f82f2c6104708129d3fbb9f5
7
+ data.tar.gz: c0e54de12d2a377ea44122a568afc7d7256fa73caa6c85631c3648758572313a2cd6fbed88b69f39d08449f6e48335e55788d3278e3435e69f66b5d7c3e2216e
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.3
5
+ - 1.9.2
6
+ - 2.0.0
7
+ - jruby-19mode
8
+ - rbx-18mode
9
+ - rbx-19mode
10
+ - ruby-head
11
+ - jruby-head
12
+ - ree
data/README.md CHANGED
@@ -1,8 +1,13 @@
1
+ [![Code Climate](https://codeclimate.com/github/teamon/sickle.png)](https://codeclimate.com/github/teamon/sickle)
2
+ [![Build Status](https://travis-ci.org/teamon/sickle.png?branch=master)](https://travis-ci.org/teamon/sickle)
3
+ [![Gem Version](https://badge.fury.io/rb/sickle.png)](https://rubygems.org/gems/sickle)
4
+ [![Coverage Status](https://coveralls.io/repos/teamon/sickle/badge.png?branch=master)](https://coveralls.io/r/teamon/sickle)
5
+
1
6
  # Sickle
2
7
 
3
8
  ## Description
4
9
 
5
- Sickle is dead simple library for building complex command line tools.
10
+ Sickle is dead simple library for building complex command line tools. A lot of ideas and examples were inspired by [thor](https://github.com/wycats/thor).
6
11
 
7
12
  #### Features:
8
13
 
data/lib/sickle.rb CHANGED
@@ -66,7 +66,7 @@ module Sickle
66
66
  def initialize(name, opts)
67
67
  @name, @opts = name, opts
68
68
 
69
- @default = opts[:default] || false
69
+ @default = opts.has_key?(:default) ? opts[:default] : false
70
70
 
71
71
  if @default == true || @default == false
72
72
  @type = :boolean
@@ -1,3 +1,3 @@
1
1
  module Sickle
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/sickle.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Sickle::VERSION
9
9
  spec.authors = ["Tymon Tobolski"]
10
10
  spec.email = ["i@teamon.eu"]
11
- spec.description = %q{sickle}
12
- spec.summary = %q{sickle}
11
+ spec.description = %q{Sickle is dead simple library for building complex command line tools.}
12
+ spec.summary = %q{Sickle is dead simple library for building complex command line tools.}
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
@@ -12,7 +12,7 @@ describe Sickle do
12
12
 
13
13
  it "list of commands" do
14
14
  App.__commands.keys.must_equal(
15
- %w(task1 task2 conflict sub:sub1 sub:conflict other:other1 other:conflict nosub))
15
+ %w(help task1 task2 conflict test_option sub:sub1 sub:conflict other:other1 other:conflict nosub))
16
16
  end
17
17
 
18
18
  it "correct commands descriptions" do
@@ -64,5 +64,10 @@ describe Sickle do
64
64
  App.run(%w(sub:conflict)).must_equal ["sub1:conflict"]
65
65
  App.run(%w(other:conflict)).must_equal ["other1:conflict"]
66
66
  end
67
+
68
+ it "option with nil default" do
69
+ App.run(%w(test_option)).must_equal ["test_option", nil]
70
+ App.run(%w(test_option --null foo)).must_equal ["test_option", "foo"]
71
+ end
67
72
  end
68
73
  end
data/spec/test_app.rb CHANGED
@@ -63,6 +63,11 @@ class App
63
63
  p ["app:conflict"]
64
64
  end
65
65
 
66
+ option :null, :default => nil
67
+ def test_option
68
+ p ["test_option", options[:null]]
69
+ end
70
+
66
71
 
67
72
  include_modules :sub => Sub,
68
73
  :other => Other
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.1.0
4
+ version: 0.1.1
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-05 00:00:00.000000000 Z
11
+ date: 2013-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: sickle
69
+ description: Sickle is dead simple library for building complex command line tools.
70
70
  email:
71
71
  - i@teamon.eu
72
72
  executables: []
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - .gitignore
77
+ - .travis.yml
77
78
  - Gemfile
78
79
  - LICENSE.txt
79
80
  - README.md
@@ -81,7 +82,7 @@ files:
81
82
  - lib/sickle.rb
82
83
  - lib/sickle/version.rb
83
84
  - sickle.gemspec
84
- - spec/runner_spec.rb
85
+ - spec/main_spec.rb
85
86
  - spec/test_app.rb
86
87
  - spec/test_run.rb
87
88
  homepage: ''
@@ -107,8 +108,8 @@ rubyforge_project:
107
108
  rubygems_version: 2.0.0
108
109
  signing_key:
109
110
  specification_version: 4
110
- summary: sickle
111
+ summary: Sickle is dead simple library for building complex command line tools.
111
112
  test_files:
112
- - spec/runner_spec.rb
113
+ - spec/main_spec.rb
113
114
  - spec/test_app.rb
114
115
  - spec/test_run.rb