rubicure 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile +6 -0
- data/README.md +49 -0
- data/config/girls/013_maho_girls.yml +95 -0
- data/config/series.yml +11 -0
- data/lib/rubicure.rb +5 -0
- data/lib/rubicure/cure.rb +2 -5
- data/lib/rubicure/girl.rb +40 -7
- data/lib/rubicure/version.rb +1 -1
- data/rubicure.gemspec +5 -0
- data/spec/core_spec.rb +1 -1
- data/spec/girl_spec.rb +60 -0
- data/spec/series_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fae0537c853d35ba5e753116a9748859c4775e7
|
4
|
+
data.tar.gz: 03b6c1f88f47cdba3da1683c34203f9e9f64239c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6434a47a5a103ae1f60c9e05ff1f11561f9b606843da0cd354343c0e4d32cf4ef73bbc8e0e13b5cbf7312c7f7145ca45595874efa2cdebec05908cb24c4c7ceb
|
7
|
+
data.tar.gz: f5cfd2fafb286cd6c7aee36a3ff191c3d5c5f42246dd9d8724300ada4edfff6a892a19cc9ef83ecf6cadde27ebc46779aeaebaf74c594bd89b575c810e59e659
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](http://github.com/sue445/rubicure/compare/v0.
|
2
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.4.0...master)
|
3
|
+
|
4
|
+
## v0.4.0
|
5
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.2...v0.4.0)
|
6
|
+
|
7
|
+
* Add maho girls precure
|
8
|
+
* https://github.com/sue445/rubicure/pull/94
|
3
9
|
|
4
10
|
## v0.3.2
|
5
11
|
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.1...v0.3.2)
|
data/Gemfile
CHANGED
@@ -2,3 +2,9 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in rubicure.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.1.0")
|
7
|
+
# NOTE: build is failed when use ruby 2.0 and rspec-parameterized 0.3.0+
|
8
|
+
# https://travis-ci.org/sue445/rubicure/jobs/114266855
|
9
|
+
gem "rspec-parameterized", "< 0.3.0"
|
10
|
+
end
|
data/README.md
CHANGED
@@ -331,6 +331,55 @@ Cure.fortune.kirarin_star_symphony!
|
|
331
331
|
ハピネスチャージプリキュア!
|
332
332
|
```
|
333
333
|
|
334
|
+
### When [Maho Girls PreCure!](https://en.wikipedia.org/wiki/Maho_Girls_PreCure!)
|
335
|
+
```ruby
|
336
|
+
mirai = Cure.miracle
|
337
|
+
|
338
|
+
mirai.name
|
339
|
+
# => "朝日奈みらい"
|
340
|
+
|
341
|
+
mirai.cure_up_rapapa! :diamond
|
342
|
+
# or
|
343
|
+
mirai.transform! :diamond
|
344
|
+
|
345
|
+
キュアップ・ラパパ! ダイヤ!
|
346
|
+
ミラクル・マジカル・ジュエリーレ!
|
347
|
+
ふたりの奇跡!キュアミラクル!
|
348
|
+
魔法つかいプリキュア!!
|
349
|
+
|
350
|
+
mirai.name
|
351
|
+
# => "キュアミラクル(ダイヤスタイル)"
|
352
|
+
|
353
|
+
mirai.attack!
|
354
|
+
リンクルステッキ!
|
355
|
+
ダイヤ!永遠の輝きを私達の手に!
|
356
|
+
フルフルリンクル!
|
357
|
+
プリキュア!ダイヤモンドエターナル!
|
358
|
+
|
359
|
+
mirai.humanize!
|
360
|
+
|
361
|
+
mirai.name
|
362
|
+
# => "朝日奈みらい"
|
363
|
+
|
364
|
+
mirai.cure_up_rapapa! :ruby
|
365
|
+
# or
|
366
|
+
mirai.transform! :ruby
|
367
|
+
|
368
|
+
キュアップ・ラパパ! ルビー!
|
369
|
+
ミラクル・マジカル・ジュエリーレ!
|
370
|
+
ふたりの奇跡!キュアミラクル!
|
371
|
+
魔法つかいプリキュア!!
|
372
|
+
|
373
|
+
mirai.name
|
374
|
+
# => "キュアミラクル(ルビースタイル)"
|
375
|
+
|
376
|
+
mirai.attack!
|
377
|
+
リンクルステッキ!
|
378
|
+
ルビー!紅の情熱よ私達の手に!
|
379
|
+
フルフルリンクル!
|
380
|
+
プリキュア!ルビーパッショナーレ!
|
381
|
+
```
|
382
|
+
|
334
383
|
### Precure allstars
|
335
384
|
```ruby
|
336
385
|
Precure.all_stars.count
|
@@ -0,0 +1,95 @@
|
|
1
|
+
cure_miracle: &cure_miracle
|
2
|
+
girl_name: cure_miracle
|
3
|
+
human_name: 朝日奈みらい
|
4
|
+
precure_name: キュアミラクル
|
5
|
+
cast_name: 高橋李依
|
6
|
+
color: pink
|
7
|
+
created_date: 2016-02-07 # episode 1
|
8
|
+
birthday: 6/12
|
9
|
+
extra_names:
|
10
|
+
transform_calls:
|
11
|
+
- cure_up_rapapa
|
12
|
+
transform_styles:
|
13
|
+
diamond:
|
14
|
+
girl_name: cure_miracle_diamond
|
15
|
+
precure_name: キュアミラクル(ダイヤスタイル)
|
16
|
+
color: pink
|
17
|
+
created_date: 2016-02-07 # episode 1
|
18
|
+
transform_message: |-
|
19
|
+
キュアップ・ラパパ! ダイヤ!
|
20
|
+
ミラクル・マジカル・ジュエリーレ!
|
21
|
+
ふたりの奇跡!キュアミラクル!
|
22
|
+
魔法つかいプリキュア!!
|
23
|
+
attack_messages:
|
24
|
+
- |
|
25
|
+
リンクルステッキ!
|
26
|
+
ダイヤ!永遠の輝きを私達の手に!
|
27
|
+
フルフルリンクル!
|
28
|
+
プリキュア!ダイヤモンドエターナル!
|
29
|
+
|
30
|
+
ruby:
|
31
|
+
girl_name: cure_miracle_ruby
|
32
|
+
precure_name: キュアミラクル(ルビースタイル)
|
33
|
+
color: red
|
34
|
+
created_date: 2016-02-21 # episode 3
|
35
|
+
transform_message: |-
|
36
|
+
キュアップ・ラパパ! ルビー!
|
37
|
+
ミラクル・マジカル・ジュエリーレ!
|
38
|
+
ふたりの奇跡!キュアミラクル!
|
39
|
+
魔法つかいプリキュア!!
|
40
|
+
attack_messages:
|
41
|
+
- |
|
42
|
+
リンクルステッキ!
|
43
|
+
ルビー!紅の情熱よ私達の手に!
|
44
|
+
フルフルリンクル!
|
45
|
+
プリキュア!ルビーパッショナーレ!
|
46
|
+
|
47
|
+
cure_magical: &cure_magical
|
48
|
+
girl_name: cure_magical
|
49
|
+
human_name: リコ
|
50
|
+
precure_name: キュアマジカル
|
51
|
+
cast_name: 堀江由衣
|
52
|
+
color: blue
|
53
|
+
created_date: 2016-02-07 # episode 1
|
54
|
+
birthday: 11/12
|
55
|
+
extra_names:
|
56
|
+
transform_calls:
|
57
|
+
- cure_up_rapapa
|
58
|
+
transform_styles:
|
59
|
+
diamond:
|
60
|
+
girl_name: cure_magical_ruby
|
61
|
+
precure_name: キュアマジカル(ダイヤスタイル)
|
62
|
+
color: red
|
63
|
+
created_date: 2016-02-07 # episode 1
|
64
|
+
transform_message:
|
65
|
+
キュアップ・ラパパ! ルビー!
|
66
|
+
ミラクル・マジカル・ジュエリーレ!
|
67
|
+
ふたりの魔法!キュアマジカル!
|
68
|
+
魔法つかいプリキュア!!
|
69
|
+
attack_messages:
|
70
|
+
- |
|
71
|
+
リンクルステッキ!
|
72
|
+
ルビー!紅の情熱よ私達の手に!
|
73
|
+
フルフルリンクル!
|
74
|
+
プリキュア!ルビーパッショナーレ!
|
75
|
+
ruby:
|
76
|
+
girl_name: cure_magical_ruby
|
77
|
+
precure_name: キュアマジカル(ルビースタイル)
|
78
|
+
color: red
|
79
|
+
created_date: 2016-02-21 # episode 3
|
80
|
+
transform_message:
|
81
|
+
キュアップ・ラパパ! ルビー!
|
82
|
+
ミラクル・マジカル・ジュエリーレ!
|
83
|
+
ふたりの魔法!キュアマジカル!
|
84
|
+
魔法つかいプリキュア!!
|
85
|
+
attack_messages:
|
86
|
+
- |
|
87
|
+
リンクルステッキ!
|
88
|
+
ルビー!紅の情熱よ私達の手に!
|
89
|
+
フルフルリンクル!
|
90
|
+
プリキュア!ルビーパッショナーレ!
|
91
|
+
|
92
|
+
miracle:
|
93
|
+
<<: *cure_miracle
|
94
|
+
magical:
|
95
|
+
<<: *cure_magical
|
data/config/series.yml
CHANGED
@@ -158,3 +158,14 @@ go_princess: &go_princess
|
|
158
158
|
- cure_scarlet
|
159
159
|
go_princess_precure:
|
160
160
|
<<: *go_princess
|
161
|
+
#######################################################
|
162
|
+
maho_girls: &maho_girls
|
163
|
+
series_name: maho_girls
|
164
|
+
title: 魔法つかいプリキュア!
|
165
|
+
started_date: 2016-02-07
|
166
|
+
# ended_date: 2017-01-
|
167
|
+
girls:
|
168
|
+
- cure_miracle
|
169
|
+
- cure_magical
|
170
|
+
maho_girls_precure:
|
171
|
+
<<: *maho_girls
|
data/lib/rubicure.rb
CHANGED
data/lib/rubicure/cure.rb
CHANGED
@@ -34,18 +34,15 @@ EOF
|
|
34
34
|
humanize!
|
35
35
|
@another_human_name ||= @__another_human_name
|
36
36
|
|
37
|
-
# setup @state_names
|
38
|
-
state_names
|
39
|
-
|
40
37
|
# rubocop:disable Style/ParallelAssignment
|
41
|
-
|
38
|
+
self[:human_name], @another_human_name = @another_human_name, self[:human_name]
|
42
39
|
# rubocop:enable Style/ParallelAssignment
|
43
40
|
|
44
41
|
self
|
45
42
|
end
|
46
43
|
|
47
44
|
def target.rollback
|
48
|
-
|
45
|
+
self[:human_name] = @__original_human_name
|
49
46
|
@another_human_name = @__another_human_name
|
50
47
|
self
|
51
48
|
end
|
data/lib/rubicure/girl.rb
CHANGED
@@ -7,6 +7,20 @@ module Rubicure
|
|
7
7
|
class Girl < Hash
|
8
8
|
include Hashie::Extensions::MethodAccess
|
9
9
|
|
10
|
+
ATTRIBUTES = [
|
11
|
+
:girl_name,
|
12
|
+
:human_name,
|
13
|
+
:precure_name,
|
14
|
+
:cast_name,
|
15
|
+
:color,
|
16
|
+
:created_date,
|
17
|
+
:birthday,
|
18
|
+
:transform_message,
|
19
|
+
:extra_names,
|
20
|
+
:attack_messages,
|
21
|
+
:transform_calls,
|
22
|
+
].freeze
|
23
|
+
|
10
24
|
attr_writer :io
|
11
25
|
|
12
26
|
def current_state
|
@@ -14,11 +28,9 @@ module Rubicure
|
|
14
28
|
end
|
15
29
|
|
16
30
|
def state_names
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@state_names += Array.wrap(extra_names) if respond_to?(:extra_names)
|
21
|
-
@state_names
|
31
|
+
state_names = [human_name, precure_name]
|
32
|
+
state_names += Array.wrap(extra_names) if respond_to?(:extra_names)
|
33
|
+
state_names
|
22
34
|
end
|
23
35
|
|
24
36
|
def ==(other)
|
@@ -33,7 +45,12 @@ module Rubicure
|
|
33
45
|
|
34
46
|
# human -> precure ( -> extra forms ) -> human ...
|
35
47
|
# @return [Rubicure::Girl] self
|
36
|
-
def transform!
|
48
|
+
def transform!(style = nil)
|
49
|
+
if style
|
50
|
+
raise "Unknown style: #{style}" unless has_transform_style?(style)
|
51
|
+
@current_transform_style = style
|
52
|
+
end
|
53
|
+
|
37
54
|
state = inc_current_state
|
38
55
|
print_by_line transform_message if state == 1
|
39
56
|
|
@@ -42,6 +59,7 @@ module Rubicure
|
|
42
59
|
|
43
60
|
def humanize!
|
44
61
|
@current_state = 0
|
62
|
+
@current_transform_style = nil
|
45
63
|
self
|
46
64
|
end
|
47
65
|
alias_method :humanize, :humanize!
|
@@ -67,10 +85,20 @@ module Rubicure
|
|
67
85
|
end
|
68
86
|
|
69
87
|
def have_birthday? # rubocop:disable Style/PredicateName
|
70
|
-
|
88
|
+
has_key?(:birthday)
|
71
89
|
end
|
72
90
|
alias_method :has_birthday?, :have_birthday?
|
73
91
|
|
92
|
+
ATTRIBUTES.each do |attribute|
|
93
|
+
define_method attribute do
|
94
|
+
if @current_transform_style
|
95
|
+
dig(:transform_styles, @current_transform_style, attribute) || self[attribute]
|
96
|
+
else
|
97
|
+
self[attribute]
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
74
102
|
class << self
|
75
103
|
attr_writer :sleep_sec
|
76
104
|
|
@@ -143,6 +171,11 @@ module Rubicure
|
|
143
171
|
|
144
172
|
private
|
145
173
|
|
174
|
+
def has_transform_style?(style)
|
175
|
+
return false unless respond_to?(:transform_styles)
|
176
|
+
transform_styles.keys.map(&:to_sym).include?(style.to_sym)
|
177
|
+
end
|
178
|
+
|
146
179
|
def inc_current_state
|
147
180
|
@current_state = current_state + 1
|
148
181
|
@current_state = 0 unless @current_state < state_names.length
|
data/lib/rubicure/version.rb
CHANGED
data/rubicure.gemspec
CHANGED
@@ -24,10 +24,15 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "hashie", ">= 2.0.5"
|
25
25
|
spec.add_dependency "sengiri_yaml", ">= 0.0.2"
|
26
26
|
|
27
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.3.0")
|
28
|
+
spec.add_dependency "backport_dig"
|
29
|
+
end
|
30
|
+
|
27
31
|
spec.add_development_dependency "bundler", ">= 1.3.5"
|
28
32
|
spec.add_development_dependency "codeclimate-test-reporter"
|
29
33
|
spec.add_development_dependency "coveralls"
|
30
34
|
spec.add_development_dependency "delorean"
|
35
|
+
spec.add_development_dependency "pry-byebug"
|
31
36
|
spec.add_development_dependency "rake"
|
32
37
|
spec.add_development_dependency "rspec"
|
33
38
|
spec.add_development_dependency "rspec-collection_matchers"
|
data/spec/core_spec.rb
CHANGED
data/spec/girl_spec.rb
CHANGED
@@ -85,6 +85,66 @@ EOF
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
describe "transform!" do
|
89
|
+
context "when Cure miracle" do
|
90
|
+
let(:girl) do
|
91
|
+
girl = Rubicure::Girl[
|
92
|
+
girl_name: "cure_miracle",
|
93
|
+
human_name: "朝日奈みらい",
|
94
|
+
precure_name: "キュアミラクル",
|
95
|
+
cast_name: "高橋李依",
|
96
|
+
created_date: "2016-02-07",
|
97
|
+
extra_names: nil,
|
98
|
+
transform_message: nil,
|
99
|
+
attack_messages: nil,
|
100
|
+
transform_calls: ["cure_up_rapapa"],
|
101
|
+
color: "pink",
|
102
|
+
birthday: "6/12",
|
103
|
+
transform_styles: {
|
104
|
+
diamond: {
|
105
|
+
precure_name: "キュアミラクル(ダイヤスタイル)",
|
106
|
+
transform_message: "",
|
107
|
+
},
|
108
|
+
ruby: {
|
109
|
+
precure_name: "キュアミラクル(ルビースタイル)",
|
110
|
+
transform_message: "",
|
111
|
+
},
|
112
|
+
},
|
113
|
+
]
|
114
|
+
|
115
|
+
girl.io = mock_io
|
116
|
+
girl
|
117
|
+
end
|
118
|
+
|
119
|
+
context "transform! with diamond" do
|
120
|
+
before do
|
121
|
+
girl.transform!(:diamond)
|
122
|
+
end
|
123
|
+
|
124
|
+
it { expect(girl.name).to eq "キュアミラクル(ダイヤスタイル)" }
|
125
|
+
it { expect(girl.state_names).to eq ["朝日奈みらい", "キュアミラクル(ダイヤスタイル)"] }
|
126
|
+
end
|
127
|
+
|
128
|
+
context "transform! with ruby" do
|
129
|
+
before do
|
130
|
+
girl.transform!(:ruby)
|
131
|
+
end
|
132
|
+
|
133
|
+
it { expect(girl.name).to eq "キュアミラクル(ルビースタイル)" }
|
134
|
+
it { expect(girl.state_names).to eq ["朝日奈みらい", "キュアミラクル(ルビースタイル)"] }
|
135
|
+
end
|
136
|
+
|
137
|
+
context "cure_up_rapapa! with diamond" do
|
138
|
+
before do
|
139
|
+
girl.cure_up_rapapa!(:diamond)
|
140
|
+
end
|
141
|
+
|
142
|
+
it { expect(girl.name).to eq "キュアミラクル(ダイヤスタイル)" }
|
143
|
+
it { expect(girl.state_names).to eq ["朝日奈みらい", "キュアミラクル(ダイヤスタイル)"] }
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
88
148
|
describe "#==" do
|
89
149
|
subject { girl == other_girl }
|
90
150
|
|
data/spec/series_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubicure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-byebug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rake
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,6 +253,7 @@ files:
|
|
239
253
|
- config/girls/010_dokidoki.yml
|
240
254
|
- config/girls/011_happiness_charge.yml
|
241
255
|
- config/girls/012_go_princess.yml
|
256
|
+
- config/girls/013_maho_girls.yml
|
242
257
|
- config/movies.yml
|
243
258
|
- config/series.yml
|
244
259
|
- lib/rubicure.rb
|