rclopts 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,10 @@
1
1
  if RUBY_VERSION < '1.9.0'
2
+ require File.expand_path('../rclopts/cli_helper', __FILE__)
3
+ require File.expand_path('../rclopts/gem_info', __FILE__)
2
4
  require File.expand_path('../rclopts/required_arg_option_parser', __FILE__)
3
5
  else
6
+ require_relative 'rclopts/cli_helper'
7
+ require_relative 'rclopts/gem_info'
4
8
  require_relative 'rclopts/required_arg_option_parser'
5
9
  end
6
10
 
@@ -0,0 +1,14 @@
1
+ module Rclopts
2
+ module CliHelper
3
+ def self.process_args(option_parser, args)
4
+ begin
5
+ options, free_args = option_parser.process_args(args)
6
+ rescue Rclopts::RequiredArgOptionParser::RequiredArgOptionParserError => e
7
+ $stderr.puts e.message
8
+ exit 1
9
+ end
10
+ [options, free_args]
11
+ end
12
+ end
13
+ end
14
+
@@ -2,7 +2,7 @@ module Rclopts
2
2
  module GemInfo
3
3
  MAJOR_VERSION = 0
4
4
  MINOR_VERSION = 1
5
- PATCH_VERSION = 0
5
+ PATCH_VERSION = 1
6
6
 
7
7
  def self.version_string
8
8
  [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rclopts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
12
+ date: 2013-08-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Ruby command-line helpers
15
15
  email: rcook@rcook.org
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - LICENSE
21
21
  - lib/rclopts/gem_info.rb
22
+ - lib/rclopts/cli_helper.rb
22
23
  - lib/rclopts/required_arg_option_parser.rb
23
24
  - lib/rclopts.rb
24
25
  homepage: https://github.com/rcook/rclopts/