method_annotation 0.3.1 → 0.3.2

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: 4bc62c8971f19084f3a63abe630311f503fbf7bb
4
- data.tar.gz: 38b89482d48bef69aae4ae0c799bb9b6a37d1aeb
3
+ metadata.gz: 7919e9b3701659d77b3f905b771e63404748a1cc
4
+ data.tar.gz: aa5453960b263ea02826fd550de19f4221c44c74
5
5
  SHA512:
6
- metadata.gz: 56635664591df2b3aab37acd70fda1164ed47705e631a7dbefa6fab0bd642652c2d44e7e2977cf1bda2e067dd3e3d745218b54ff0baf1d93102e6629e7c06d1b
7
- data.tar.gz: 60f5f195f0fa08477a8cd8a9510034ddb2e80fd22f38174d3fd7ca581eaeaeb348314bce375b3318e8f731fa2a3727b943763812d63da7c82d308c2cbc5e7b97
6
+ metadata.gz: e70ada2049bee8409b54073857b69e3d8e10089f8e471384f7f376518650d04cd080ba290e3b1aa69d441dc93091b79b48b9ea15e940638b98f06c7aad128e2e
7
+ data.tar.gz: f0c668d89fb60e1a052a04325fb968386b7e24503a6a0e9f772b9aeffebb857fe8f3fecab71056741ac86249b3219d9112c79ec52599680c0209e82b016649ab
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- method_annotation (0.3.1)
4
+ method_annotation (0.3.2)
5
5
  activesupport (~> 4.2.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -156,6 +156,39 @@ About MethodAnnotation
156
156
  foo.bar
157
157
  => "return value"
158
158
 
159
+ - MethodAnnotation::WillImplemented
160
+
161
+ It method is expected to be implemented.
162
+
163
+ require 'method_annotation'
164
+
165
+ class Foo
166
+ include MethodAnnotation::Enable
167
+
168
+ will_implemented
169
+ def bar
170
+ end
171
+ end
172
+
173
+ class Hoge
174
+
175
+ def bar
176
+ puts 'hoge'
177
+ end
178
+ end
179
+
180
+ class Hogehoge
181
+ end
182
+
183
+ Foo.new.bar
184
+ => NotImplementedError: Please implement Foo#bar
185
+
186
+ Hoge.new.bar
187
+ => "hoge"
188
+
189
+ Hogehoge.new.bar
190
+ => NotImplementedError: Please implement Hogehoge#bar
191
+
159
192
  - MethodAnnotation::Trace
160
193
 
161
194
  It is will trace the method. This is still a prototype.
@@ -11,6 +11,7 @@ module MethodAnnotation
11
11
  eager_autoload do
12
12
  autoload :Cache
13
13
  autoload :Trace
14
+ autoload :WillImplemented
14
15
  end
15
16
  end
16
17
 
@@ -1,3 +1,3 @@
1
1
  module MethodAnnotation
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -0,0 +1,11 @@
1
+ module MethodAnnotation
2
+ class WillImplemented < MethodAnnotation::Base
3
+ self.annotation_name = 'will_implemented'
4
+ self.describe = 'This method is expected to be implemented'
5
+
6
+ before do |param|
7
+ fail NotImplementedError.new("Please implement #{self.class}##{param.method_name}")
8
+ end
9
+ end
10
+ end
11
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_annotation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - masatoshi-watanuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,6 +90,7 @@ files:
90
90
  - lib/method_annotation/parameter.rb
91
91
  - lib/method_annotation/trace.rb
92
92
  - lib/method_annotation/version.rb
93
+ - lib/method_annotation/will_implemented.rb
93
94
  - method_annotation.gemspec
94
95
  homepage: https://github.com/masatoshi-watanuki/gems/tree/master/method_annotation
95
96
  licenses: