mercenary 0.3.4 → 0.3.5

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: 8fb90c2919ac0f15c0eeb8abe22cdd13eee58c81
4
- data.tar.gz: 737fed7cc73e411561b1393d69e0774e93af84a7
3
+ metadata.gz: b9f4dfe1178635732a9da7f3221db5cab85da88f
4
+ data.tar.gz: d1ddfc45773425b1a91016111189625a4a6f8bc1
5
5
  SHA512:
6
- metadata.gz: eb6aa3eeb814791f20449a7e728b1f497c94359011787e3919eb402b753fafe4fe7852481ada652a9fe25926a5fc9d56faef21549359dd604211cc36e8776b61
7
- data.tar.gz: e46388cb5e91489ca638e7b3ce44d3c5dd1090c5d9c149400b79fdd3ccddca27ba57616fb4f46dc7d9a94b596da490c50a7c1851146da966968e9d4e5fdf602e
6
+ metadata.gz: 43845c7d35b7cae824bc238a5bdfa340bb15ed4dde3444ffb4dee893acb104e5e769694aed071b0cf74a1c5657b019d402c21a2b6857b5fc3a368cb8ba3803dd
7
+ data.tar.gz: d2398c2e216c6c5c2e286e3c254b0d7a65038bc6c4e50a6711b6fbb05fe8bbe3c9bd258b93e154a9ae496f2a11c3cec41cdfb528f7eec80894a2115baba93da4
@@ -2,7 +2,10 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.0
5
+ - 2.1
6
+ sudo: false
7
+ cache: bundler
8
+ before_script: bundle update
6
9
  script: "./script/cibuild"
7
10
  notifications:
8
11
  email:
@@ -1,13 +1,14 @@
1
- ## HEAD
2
-
3
- ### Major Enhancements
4
-
5
- ### Minor Enhancements
1
+ ## 0.3.5 / 2014-11-12
6
2
 
7
3
  ### Bug Fixes
8
4
 
5
+ * Capture `OptionsParser::InvalidOption` and show a nice error message (#38)
6
+ * Absolute paths for requires and autoloads (#39)
7
+
9
8
  ### Development Fixes
10
9
 
10
+ * Bump to RSpec 3 (#40)
11
+
11
12
  ## 0.3.4 / 2014-07-11
12
13
 
13
14
  ### Bug Fixes
@@ -1,15 +1,12 @@
1
- lib = File.expand_path('../', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
-
4
- require "mercenary/version"
1
+ require File.expand_path("../mercenary/version", __FILE__)
5
2
  require "optparse"
6
3
  require "logger"
7
4
 
8
5
  module Mercenary
9
- autoload :Command, "mercenary/command"
10
- autoload :Option, "mercenary/option"
11
- autoload :Presenter, "mercenary/presenter"
12
- autoload :Program, "mercenary/program"
6
+ autoload :Command, File.expand_path("../mercenary/command", __FILE__)
7
+ autoload :Option, File.expand_path("../mercenary/option", __FILE__)
8
+ autoload :Presenter, File.expand_path("../mercenary/presenter", __FILE__)
9
+ autoload :Program, File.expand_path("../mercenary/program", __FILE__)
13
10
 
14
11
  # Public: Instantiate a new program and execute.
15
12
  #
@@ -27,7 +27,14 @@ module Mercenary
27
27
  cmd = super(argv, opts, @config)
28
28
  end
29
29
 
30
- @optparse.parse!(argv)
30
+ begin
31
+ @optparse.parse!(argv)
32
+ rescue OptionParser::InvalidOption => e
33
+ logger.error "Whoops, we can't understand your command."
34
+ logger.error "#{e.message}"
35
+ logger.error "Run your command again with the --help switch to see available options."
36
+ abort
37
+ end
31
38
 
32
39
  logger.debug("Parsed config: #{@config.inspect}")
33
40
 
@@ -1,3 +1,3 @@
1
1
  module Mercenary
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rspec", "~> 2.14"
23
+ spec.add_development_dependency "rspec", "~> 3.0"
24
24
  end
@@ -28,8 +28,8 @@ describe(Mercenary::Option) do
28
28
 
29
29
  it "compares itself with other options well" do
30
30
  new_option = described_class.new(config_key, ['-l', '--largo', description])
31
- expect(option.eql?(new_option)).to be_true
32
- expect(option.hash.eql?(new_option.hash)).to be_true
31
+ expect(option.eql?(new_option)).to be(true)
32
+ expect(option.hash.eql?(new_option.hash)).to be(true)
33
33
  end
34
34
 
35
35
  it "has a custom #hash" do
@@ -72,7 +72,7 @@ describe(Mercenary::Option) do
72
72
  let(:description) { nil }
73
73
 
74
74
  it "knows there is no description" do
75
- expect(option.description).to be_nil
75
+ expect(option.description).to be(nil)
76
76
  end
77
77
 
78
78
  it "knows both inputs are switches" do
@@ -3,7 +3,6 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'mercenary'
4
4
 
5
5
  RSpec.configure do |config|
6
- config.treat_symbols_as_metadata_keys_with_true_values = true
7
6
  config.run_all_when_everything_filtered = true
8
7
  config.filter_run :focus
9
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercenary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-12 00:00:00.000000000 Z
12
+ date: 2014-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '2.14'
48
+ version: '3.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '2.14'
55
+ version: '3.0'
56
56
  description: Lightweight and flexible library for writing command-line apps in Ruby.
57
57
  email:
58
58
  - tom@mojombo.com