interjectable 0.2.0 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +21 -0
- data/README.md +1 -1
- data/lib/interjectable.rb +2 -2
- data/lib/interjectable/version.rb +1 -1
- data/spec/interjectable_spec.rb +13 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d810c4b31d398d621d728de427a57e078be0a83
|
4
|
+
data.tar.gz: dcc2d93576e3f08436a32527719e6a56b24a998f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307d9bb43b2faaf88ac043c32f1ef693ebd7871ef586403f1a9909064896e15269d59d1f335753ca43dec477bb21755367ff36e7406b12e3efde6006ce9738eb
|
7
|
+
data.tar.gz: 3f33bc63f27d399025beb5b19009d38de81f196b38b26bd8d884df878bb619992c58cd7bc0120cfce1b4ec6ec237be06acc98227e60d97ab3d0cc620fb5a7b3c
|
data/CHANGES.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
# v0.2.0
|
4
|
+
|
5
|
+
Small feature.
|
6
|
+
|
7
|
+
- Added `Interjectable#inject_static` for sharing values across multiple
|
8
|
+
instances.
|
9
|
+
|
10
|
+
# v0.0.2
|
11
|
+
|
12
|
+
Small patch.
|
13
|
+
|
14
|
+
- Updated `Interjectable#inject` to only call dependencies once, including
|
15
|
+
results with falsy values.
|
16
|
+
|
17
|
+
# v0.0.1
|
18
|
+
|
19
|
+
Initial release.
|
20
|
+
|
21
|
+
- Added `Interjectable#inject`
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Interjectable has one module (`Interjectable`) and two methods. Use them like so
|
|
16
16
|
|
17
17
|
```ruby
|
18
18
|
class MyClass
|
19
|
-
|
19
|
+
include Interjectable
|
20
20
|
|
21
21
|
# defines helper methods on instances that memoize values per instance
|
22
22
|
inject(:dependency) { SomeOtherClass.new }
|
data/lib/interjectable.rb
CHANGED
data/spec/interjectable_spec.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Interjectable do
|
4
|
-
|
5
|
-
let(:klass) { Class.new { extend Interjectable } }
|
4
|
+
shared_examples_for "an interjectable class" do
|
6
5
|
let(:instance) { klass.new }
|
7
6
|
|
8
7
|
describe "#inject" do
|
@@ -89,4 +88,16 @@ describe Interjectable do
|
|
89
88
|
end
|
90
89
|
end
|
91
90
|
end
|
91
|
+
|
92
|
+
context "when extended" do
|
93
|
+
let(:klass) { Class.new { extend Interjectable } }
|
94
|
+
|
95
|
+
it_should_behave_like "an interjectable class"
|
96
|
+
end
|
97
|
+
|
98
|
+
context "when included" do
|
99
|
+
let(:klass) { Class.new { extend Interjectable } }
|
100
|
+
|
101
|
+
it_should_behave_like "an interjectable class"
|
102
|
+
end
|
92
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interjectable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Margolis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
|
+
- CHANGES.md
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|