uber 0.0.9 → 0.0.10

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: 496f58fb856e20541ca2984b42e5ff34d6e5ce8d
4
- data.tar.gz: 4344bb9b85e4e8ebaa198b1b532045b01cb6ebd9
3
+ metadata.gz: c817ac8bf31287641d793288fd317cb89818c834
4
+ data.tar.gz: 79d88494f259334a88606b95bd4f1e3315d9248f
5
5
  SHA512:
6
- metadata.gz: 5adad36ffeacd88e2b0e66aeec0d99eb4f7b51baa8bfaeef89045d23bfbf6adcb70c7d6a94f0fbdecb1fe7a9137b15c07775a9ebdaf9cc9e430119c9fda76c6f
7
- data.tar.gz: 78c7dbe731c85b2d8150e020b5d5afeda6bb9cf247d9706cc9fd39c06aad16c7da9cdb4b877479534daed35cbb3cba5f46bcecbc018aacac1daf82a97dded431
6
+ metadata.gz: 1ef9075f772764e736bfee3213d525be71d65ef1b23b23fa787bc0886f748d8a59049c567648c20e6aacd06b8f5c7ecfea10f17d775b14ea401e8eeaf7b15d65
7
+ data.tar.gz: e9441a4deb06ba1630bb7e06bebebbb7f679b5448a6013a878caa9f108f64a8d1817ab5e0ce11445dbffa3957929156b20c6771fe8fce836a55f9a1703a2e763
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.10
2
+
3
+ * Builders are _not_ inherited to subclasses. This allows instantiating subclasses directly without running builders.
4
+
1
5
  # 0.0.9
2
6
 
3
7
  * Add `Uber::Builder`.
data/README.md CHANGED
@@ -229,8 +229,9 @@ Listener.build({}) #=> Listener
229
229
  Listener.build({current_user: @current_user}) #=> SignedIn
230
230
  ```
231
231
 
232
- This pattern is used in [Cells](https://github.com/apotonick/cells), [Trailblazer](https://github.com/apotonick/trailblazer) and soon Reform and Representable/Roar, too.
232
+ Note that builders are _not_ inherited to subclasses. This allows instantiating subclasses directly without running builders.
233
233
 
234
+ This pattern is used in [Cells](https://github.com/apotonick/cells), [Trailblazer](https://github.com/apotonick/trailblazer) and soon Reform and Representable/Roar, too.
234
235
 
235
236
  # Version
236
237
 
data/lib/uber/builder.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'uber/inheritable_attr'
2
-
3
1
  module Uber
4
2
  # When included, allows to add builder on the class level.
5
3
  #
@@ -21,10 +19,13 @@ module Uber
21
19
  # end
22
20
  module Builder
23
21
  def self.included(base)
24
- base.extend(ClassMethods)
25
- base.extend(InheritableAttr)
26
- base.inheritable_attr :builders
27
- base.builders = []
22
+ base.class_eval do
23
+ def self.builders
24
+ @builders ||= []
25
+ end
26
+
27
+ extend ClassMethods
28
+ end
28
29
  end
29
30
 
30
31
  class Constant
@@ -1,3 +1,3 @@
1
1
  module Uber
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
data/test/builder_test.rb CHANGED
@@ -49,11 +49,11 @@ class BuilderTest < MiniTest::Spec
49
49
  it { Track.build({hit: true}).must_be_instance_of Hit }
50
50
 
51
51
 
52
- # test inheritance.
52
+ # test inheritance. builder do not inherit.
53
53
  class Play < Song
54
54
  end
55
55
 
56
56
  it { Play.build({}).must_be_instance_of Play }
57
- it { Play.build({evergreen: true}).must_be_instance_of Evergreen }
58
- it { Play.build({hit: true}).must_be_instance_of Hit }
57
+ it { Play.build({evergreen: true}).must_be_instance_of Play }
58
+ it { Play.build({hit: true}).must_be_instance_of Play }
59
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-08 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.2.1
91
+ rubygems_version: 2.2.2
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Gem-authoring tools like class method inheritance in modules, dynamic options
@@ -102,4 +102,3 @@ test_files:
102
102
  - test/test_helper.rb
103
103
  - test/version_test.rb
104
104
  - test/zeugs.rb
105
- has_rdoc: