rubicure 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/rubicure/series.rb +9 -1
- data/lib/rubicure/version.rb +1 -1
- data/spec/series_spec.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeb46d28b213353aca4275c0ba741d98e086f55b
|
4
|
+
data.tar.gz: c31f821d4ff1f92bc12ce35073d6e67189e0c1e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 916d0c137b2b6df38054b8e62e0bbdf06fe765ddacd83e84725a3e90e9d822ac41b1df494cd7edfa3461b7f54c8b2d4901e7c23671c74ee27b323f730f3da170
|
7
|
+
data.tar.gz: eb29d5cf2c5bf55f635db54a580306289ebd5e673ef899701f9535fafc5be7300ca64b1d5e8941583f782fdb4bf1f5107856b7ff8f5c6739a02591b03d69b6da
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](http://github.com/sue445/rubicure/compare/v0.2.
|
2
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.2.8...master)
|
3
|
+
|
4
|
+
## v0.2.8
|
5
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.2.7...v0.2.8)
|
6
|
+
|
7
|
+
* Impl Rubicure::Series#to_json
|
8
|
+
* https://github.com/sue445/rubicure/pull/83
|
3
9
|
|
4
10
|
## v0.2.7
|
5
11
|
[full changelog](http://github.com/sue445/rubicure/compare/v0.2.6...v0.2.7)
|
data/lib/rubicure/series.rb
CHANGED
@@ -55,7 +55,15 @@ module Rubicure
|
|
55
55
|
def each_with_girls
|
56
56
|
girls.each { |girl| yield girl }
|
57
57
|
end
|
58
|
-
|
58
|
+
alias_method_chain :each, :girls
|
59
|
+
|
60
|
+
def to_json
|
61
|
+
original_hash = {}
|
62
|
+
each_without_girls do |k, v|
|
63
|
+
original_hash[k] = v
|
64
|
+
end
|
65
|
+
original_hash.to_json
|
66
|
+
end
|
59
67
|
|
60
68
|
class << self
|
61
69
|
# @return [Array<Symbol>]
|
data/lib/rubicure/version.rb
CHANGED
data/spec/series_spec.rb
CHANGED
@@ -134,4 +134,19 @@ describe Rubicure::Series do
|
|
134
134
|
|
135
135
|
it { expect { |b| series.each_with_girls(&b) }.to yield_successive_args(Rubicure::Girl, Rubicure::Girl) }
|
136
136
|
end
|
137
|
+
|
138
|
+
describe "#to_json" do
|
139
|
+
subject { series.to_json }
|
140
|
+
|
141
|
+
let(:series) { Rubicure::Series.find(series_name) }
|
142
|
+
let(:series_name) { :splash_star }
|
143
|
+
|
144
|
+
let(:json) do
|
145
|
+
<<-JSON
|
146
|
+
{\"series_name\":\"splash_star\",\"title\":\"ふたりはプリキュア Splash☆Star\",\"started_date\":\"2006-02-05\",\"ended_date\":\"2007-01-28\",\"girls\":[\"cure_bloom\",\"cure_egret\"]}
|
147
|
+
JSON
|
148
|
+
end
|
149
|
+
|
150
|
+
it { should eq json.squish }
|
151
|
+
end
|
137
152
|
end
|