optopus 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +1 -1
  2. data/lib/optopus.rb +6 -6
  3. metadata +3 -3
data/README CHANGED
@@ -40,7 +40,7 @@ gem install optopus
40
40
  # @options.each { ... }
41
41
  end
42
42
 
43
- exception do |e|
43
+ error do |e|
44
44
  $stderr.puts e.message
45
45
  exit 1
46
46
  end
data/lib/optopus.rb CHANGED
@@ -34,8 +34,8 @@ module Optopus
34
34
  @opts.add_after(block)
35
35
  end
36
36
 
37
- def exception(&block)
38
- @opts.add_exception(block)
37
+ def error(&block)
38
+ @opts.add_error(block)
39
39
  end
40
40
  end # DefinerContext
41
41
 
@@ -102,8 +102,8 @@ module Optopus
102
102
  @on_after = block
103
103
  end
104
104
 
105
- def add_exception(block)
106
- @on_exception = block
105
+ def add_error(block)
106
+ @on_error = block
107
107
  end
108
108
 
109
109
  def parse!
@@ -158,8 +158,8 @@ module Optopus
158
158
 
159
159
  return options
160
160
  rescue => e
161
- if @on_exception
162
- @on_exception.call(e)
161
+ if @on_error
162
+ @on_error.call(e)
163
163
  else
164
164
  raise e
165
165
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optopus
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - winebarrel