frosting 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/frosting.gemspec +2 -2
- data/lib/frosting/repository.rb +5 -1
- data/lib/frosting/version.rb +1 -1
- data/spec/frosting/repository_spec.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 932f60f83154d1f82d66cae72c30d360c3159114
|
4
|
+
data.tar.gz: a0da567f277e1c85390f3a93b1b790e9a5bfff1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13715220b56d6b97d6e3273725b4512ff96f053c889fbcf7cef50dd030fd445457b82492feda752af2cc6d266d702232a8dadc7440c70620a9a07a0402c21b39
|
7
|
+
data.tar.gz: d0af2aa99517c3ad5036edd8e27c1915b4522b66c3e511e01964e18e9e507fbf486acc0122dbb521ae12b298c28f958e0c1c21abde6415ea8924663f14dd5925
|
data/frosting.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'frosting'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '
|
3
|
+
s.version = '0.0.7'
|
4
|
+
s.date = '2016-01-26'
|
5
5
|
s.summary = "Let's make presenters easy."
|
6
6
|
s.description = "Adds some methods to your controllers and a base presenter. Get that presentation logic out of your models."
|
7
7
|
s.authors = ["Ben Eddy", "Jon Evans"]
|
data/lib/frosting/repository.rb
CHANGED
@@ -31,13 +31,17 @@ module Frosting
|
|
31
31
|
class PresentedCollection < SimpleDelegator
|
32
32
|
include Enumerable
|
33
33
|
|
34
|
-
delegate :each, to: :presented_collection
|
34
|
+
delegate :each, :to_a, to: :presented_collection
|
35
35
|
|
36
36
|
def initialize(collection, options)
|
37
37
|
@options = options
|
38
38
|
super(collection)
|
39
39
|
end
|
40
40
|
|
41
|
+
def +(other)
|
42
|
+
to_a + other.to_a
|
43
|
+
end
|
44
|
+
|
41
45
|
private
|
42
46
|
|
43
47
|
def presented_collection
|
data/lib/frosting/version.rb
CHANGED
@@ -77,12 +77,17 @@ module Frosting
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it "presents each item in the collection with options" do
|
80
|
-
expect(presented_collection.
|
80
|
+
expect(presented_collection.to_a).to eq [presented_resource]
|
81
81
|
end
|
82
82
|
|
83
83
|
it "still acts like the original collection" do
|
84
84
|
expect(presented_collection.test_method).to eq "cats"
|
85
85
|
end
|
86
|
+
|
87
|
+
it "allows addition of presented collections" do
|
88
|
+
expect((presented_collection + presented_collection).to_a).
|
89
|
+
to eq [presented_resource, presented_resource]
|
90
|
+
end
|
86
91
|
end
|
87
92
|
end
|
88
93
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frosting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eddy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|