rubicure 1.2.4 → 1.2.5

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
  SHA256:
3
- metadata.gz: a13193ce853614419b8fb6d427ef51fbbef9e8adef7c5dc4747cff076e8af2e0
4
- data.tar.gz: 5f386d5c0c5ee00661aac9daf659dc4b236dffb4ff748e4626ec5ab682b6cc7f
3
+ metadata.gz: c10b38d1a27f170a5ae44cfa02e4566964f4069d2c57954ad730588102fefe85
4
+ data.tar.gz: afbcd8896a0583f6a305c5dd0993df2a5058f13f35104fadc7325201ff27b92f
5
5
  SHA512:
6
- metadata.gz: ea131dc4a3847d9730acf5071ef0a717f100e6d9c9e9ce554c5699ea807ce1675adbbc917edc48b1d26442e11a80ab78420e3b1e0c7930daa083b6903118aa4a
7
- data.tar.gz: a4217920b499d1ff1549626c2b1e1da4dcc227d73bab9a2c87f55260106c9bc691982dd1664a22254572dd292678a712ef50bb63d5762fbf4b8fca8bc736f9af
6
+ metadata.gz: 5760e3ead69a7578931860e72b38e577574146bbde37d97c250f1f39d77ff7e640a069867c9a0db7806c16951edc6ee3e57e98053bf620eabd7cbfe50aa46637
7
+ data.tar.gz: b7b8211cdb3e2739fd66cdcf0841e2985727d57efe3a378175a35482d84621b9abd7cd98942846c111f07f4e92f08dc1df60500fbf3dda31c9cceb894990394b
@@ -1,5 +1,11 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v1.2.4...master)
2
+ [full changelog](http://github.com/sue445/rubicure/compare/v1.2.5...master)
3
+
4
+ ## v1.2.5
5
+ [full changelog](http://github.com/sue445/rubicure/compare/v1.2.4...v1.2.5)
6
+
7
+ * Impl `Cure.cosmo.transform!(:rainbow_perfume)`
8
+ * https://github.com/sue445/rubicure/pull/210
3
9
 
4
10
  ## v1.2.4
5
11
  [full changelog](http://github.com/sue445/rubicure/compare/v1.2.3...v1.2.4)
data/README.md CHANGED
@@ -649,6 +649,15 @@ Go!プリンセスプリキュア
649
649
  => "トワイライト"
650
650
  ```
651
651
 
652
+ ### Cure.cosmo.transform!(:rainbow_perfume)
653
+ ```ruby
654
+ Cure.cosmo.transform!(:rainbow_perfume)
655
+ レインボーパフュームいくニャン!
656
+
657
+ Cure.cosmo.name
658
+ #=> one of "マオ", "ブルーキャット" or "バケニャーン"
659
+ ```
660
+
652
661
  ## Color methods
653
662
  ```ruby
654
663
  >> Cure.peace.color
@@ -10,6 +10,11 @@ require "rubicure/core"
10
10
  require "rubicure/movie"
11
11
  require "rubicure/cure"
12
12
  require "rubicure/errors"
13
+ require "rubicure/cure_cosmo"
14
+ require "rubicure/cure_peace"
15
+ require "rubicure/cure_passion"
16
+ require "rubicure/cure_beat"
17
+ require "rubicure/cure_scarlet"
13
18
 
14
19
  begin
15
20
  require "backport_dig"
@@ -5,25 +5,6 @@ module Cure
5
5
  end
6
6
  end
7
7
 
8
- [Cure.peace, Cure.cure_peace].each do |peace|
9
- class << peace
10
- HANDS =
11
- (["グー"] * 13) +
12
- (["チョキ"] * 14) +
13
- (["パー"] * 15) +
14
- ["グッチョッパー"]
15
- MESSAGE = <<JANKEN.freeze
16
- ピカピカピカリン
17
- ジャンケンポン!
18
- (%s)
19
- JANKEN
20
- def pikarin_janken
21
- print_by_line(MESSAGE % HANDS.sample)
22
- end
23
- alias_method :janken, :pikarin_janken
24
- end
25
- end
26
-
27
8
  def self.define_turnover_methods(target, original_human_name, another_human_name)
28
9
  target.instance_variable_set(:@__original_human_name, original_human_name)
29
10
  target.instance_variable_set(:@__another_human_name, another_human_name)
@@ -43,16 +24,4 @@ JANKEN
43
24
  self
44
25
  end
45
26
  end
46
-
47
- [Cure.passion, Cure.cure_passion].each do |passion|
48
- define_turnover_methods(passion, "東せつな", "イース")
49
- end
50
-
51
- [Cure.beat, Cure.cure_beat].each do |beat|
52
- define_turnover_methods(beat, "黒川エレン", "セイレーン")
53
- end
54
-
55
- [Cure.scarlet, Cure.cure_scarlet].each do |scarlet|
56
- define_turnover_methods(scarlet, "紅城トワ", "トワイライト")
57
- end
58
27
  end
@@ -0,0 +1,3 @@
1
+ [Cure.beat, Cure.cure_beat].each do |beat|
2
+ Cure.define_turnover_methods(beat, "黒川エレン", "セイレーン")
3
+ end
@@ -0,0 +1,24 @@
1
+ module Cure
2
+ module CosmoExt
3
+ def transform!(style = nil)
4
+ return super(style) unless style == :rainbow_perfume
5
+
6
+ humanize!
7
+
8
+ self[:human_name] = %w[マオ ブルーキャット バケニャーン].sample
9
+
10
+ print_by_line "レインボーパフュームいくニャン!"
11
+
12
+ self
13
+ end
14
+
15
+ def rollback
16
+ self[:human_name] = "ユニ"
17
+ self
18
+ end
19
+ end
20
+ end
21
+
22
+ [Cure.cosmo, Cure.cure_cosmo].each do |cosmo|
23
+ cosmo.singleton_class.prepend(Cure::CosmoExt)
24
+ end
@@ -0,0 +1,3 @@
1
+ [Cure.passion, Cure.cure_passion].each do |passion|
2
+ Cure.define_turnover_methods(passion, "東せつな", "イース")
3
+ end
@@ -0,0 +1,18 @@
1
+ [Cure.peace, Cure.cure_peace].each do |peace|
2
+ class << peace
3
+ HANDS =
4
+ (["グー"] * 13) +
5
+ (["チョキ"] * 14) +
6
+ (["パー"] * 15) +
7
+ ["グッチョッパー"]
8
+ MESSAGE = <<JANKEN.freeze
9
+ ピカピカピカリン
10
+ ジャンケンポン!
11
+ (%s)
12
+ JANKEN
13
+ def pikarin_janken
14
+ print_by_line(MESSAGE % HANDS.sample)
15
+ end
16
+ alias_method :janken, :pikarin_janken
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ [Cure.scarlet, Cure.cure_scarlet].each do |scarlet|
2
+ Cure.define_turnover_methods(scarlet, "紅城トワ", "トワイライト")
3
+ end
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "1.2.4".freeze
2
+ VERSION = "1.2.5".freeze
3
3
  end
@@ -0,0 +1,32 @@
1
+ describe "Cure.beat" do # rubocop:disable RSpec/DescribeClass
2
+ describe "!" do
3
+ subject { !Cure.beat }
4
+
5
+ let(:girl) { Cure.beat }
6
+
7
+ after do
8
+ girl.rollback
9
+ girl.humanize!
10
+ end
11
+
12
+ context "called once" do
13
+ it { expect { subject }.to change { girl.name }.from("黒川エレン").to("セイレーン") }
14
+ end
15
+
16
+ context "called twice" do
17
+ before do
18
+ !Cure.beat
19
+ end
20
+
21
+ it { expect { subject }.to change { girl.name }.from("セイレーン").to("黒川エレン") }
22
+ end
23
+
24
+ context "after transform" do
25
+ before do
26
+ girl.transform!
27
+ end
28
+
29
+ it { expect { subject }.to change { girl.name }.from("キュアビート").to("セイレーン") }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,37 @@
1
+ describe "Cure.cosmo" do # rubocop:disable RSpec/DescribeClass
2
+ let(:girl) { Cure.cosmo }
3
+
4
+ after do
5
+ girl.rollback
6
+ end
7
+
8
+ describe "#transform!" do
9
+ context "with :rainbow_perfume" do
10
+ subject { girl.transform!(:rainbow_perfume) }
11
+
12
+ it "change to either マオ, ブルーキャット or バケニャーン" do
13
+ subject
14
+
15
+ expect(girl.name).to match(/^(マオ|ブルーキャット|バケニャーン)$/)
16
+ end
17
+ end
18
+
19
+ context "without arg" do
20
+ subject { girl.transform! }
21
+
22
+ it { expect { subject }.to change { girl.name }.from("ユニ").to("キュアコスモ") }
23
+ end
24
+ end
25
+
26
+ describe "#rollback" do
27
+ subject { girl.rollback }
28
+
29
+ it "rollback to ユニ" do
30
+ girl.transform!(:rainbow_perfume)
31
+
32
+ subject
33
+
34
+ expect(girl.name).to eq "ユニ"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,32 @@
1
+ describe "Cure.passion" do # rubocop:disable RSpec/DescribeClass
2
+ describe "!" do
3
+ subject { !Cure.passion }
4
+
5
+ let(:girl) { Cure.passion }
6
+
7
+ after do
8
+ girl.rollback
9
+ girl.humanize!
10
+ end
11
+
12
+ context "called once" do
13
+ it { expect { subject }.to change { girl.name }.from("東せつな").to("イース") }
14
+ end
15
+
16
+ context "called twice" do
17
+ before do
18
+ !Cure.passion
19
+ end
20
+
21
+ it { expect { subject }.to change { girl.name }.from("イース").to("東せつな") }
22
+ end
23
+
24
+ context "after transform" do
25
+ before do
26
+ girl.transform!
27
+ end
28
+
29
+ it { expect { subject }.to change { girl.name }.from("キュアパッション").to("イース") }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ describe "Cure.peace" do # rubocop:disable RSpec/DescribeClass
2
+ describe "#pikarin_janken" do
3
+ subject { girl.pikarin_janken }
4
+
5
+ shared_examples :do_janken do
6
+ it { should match(/ピカピカピカリン\nジャンケンポン!\n(.+)/) }
7
+ end
8
+
9
+ context "When peace" do
10
+ let(:girl) { Cure.peace }
11
+
12
+ it_behaves_like :do_janken
13
+ end
14
+
15
+ context "When cure_peace" do
16
+ let(:girl) { Cure.cure_peace }
17
+
18
+ it_behaves_like :do_janken
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,32 @@
1
+ describe "Cure.scarlet" do # rubocop:disable RSpec/DescribeClass
2
+ describe "!" do
3
+ subject { !Cure.scarlet }
4
+
5
+ let(:girl) { Cure.scarlet }
6
+
7
+ after do
8
+ girl.rollback
9
+ girl.humanize!
10
+ end
11
+
12
+ context "called once" do
13
+ it { expect { subject }.to change { girl.name }.from("紅城トワ").to("トワイライト") }
14
+ end
15
+
16
+ context "called twice" do
17
+ before do
18
+ !Cure.scarlet
19
+ end
20
+
21
+ it { expect { subject }.to change { girl.name }.from("トワイライト").to("紅城トワ") }
22
+ end
23
+
24
+ context "after transform" do
25
+ before do
26
+ girl.transform!
27
+ end
28
+
29
+ it { expect { subject }.to change { girl.name }.from("キュアスカーレット").to("トワイライト") }
30
+ end
31
+ end
32
+ end
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: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-30 00:00:00.000000000 Z
11
+ date: 2019-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -304,6 +304,11 @@ files:
304
304
  - lib/rubicure/concerns/util.rb
305
305
  - lib/rubicure/core.rb
306
306
  - lib/rubicure/cure.rb
307
+ - lib/rubicure/cure_beat.rb
308
+ - lib/rubicure/cure_cosmo.rb
309
+ - lib/rubicure/cure_passion.rb
310
+ - lib/rubicure/cure_peace.rb
311
+ - lib/rubicure/cure_scarlet.rb
307
312
  - lib/rubicure/errors.rb
308
313
  - lib/rubicure/girl.rb
309
314
  - lib/rubicure/movie.rb
@@ -315,7 +320,11 @@ files:
315
320
  - spec/config/series_checker_spec.rb
316
321
  - spec/rubicure/concerns/gengou_spec.rb
317
322
  - spec/rubicure/core_spec.rb
318
- - spec/rubicure/cure_spec.rb
323
+ - spec/rubicure/cure_beat_spec.rb
324
+ - spec/rubicure/cure_cosmo_spec.rb
325
+ - spec/rubicure/cure_passion_spec.rb
326
+ - spec/rubicure/cure_peace_spec.rb
327
+ - spec/rubicure/cure_scarlet_spec.rb
319
328
  - spec/rubicure/girl_spec.rb
320
329
  - spec/rubicure/movie_spec.rb
321
330
  - spec/rubicure/rubicure_spec.rb
@@ -344,7 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
353
  - !ruby/object:Gem::Version
345
354
  version: '0'
346
355
  requirements: []
347
- rubygems_version: 3.0.3
356
+ rubygems_version: 3.0.6
348
357
  signing_key:
349
358
  specification_version: 4
350
359
  summary: All about Japanese battle heroine "Pretty Cure (Precure)".
@@ -353,7 +362,11 @@ test_files:
353
362
  - spec/config/series_checker_spec.rb
354
363
  - spec/rubicure/concerns/gengou_spec.rb
355
364
  - spec/rubicure/core_spec.rb
356
- - spec/rubicure/cure_spec.rb
365
+ - spec/rubicure/cure_beat_spec.rb
366
+ - spec/rubicure/cure_cosmo_spec.rb
367
+ - spec/rubicure/cure_passion_spec.rb
368
+ - spec/rubicure/cure_peace_spec.rb
369
+ - spec/rubicure/cure_scarlet_spec.rb
357
370
  - spec/rubicure/girl_spec.rb
358
371
  - spec/rubicure/movie_spec.rb
359
372
  - spec/rubicure/rubicure_spec.rb
@@ -1,122 +0,0 @@
1
- describe "Cure" do # rubocop:disable RSpec/DescribeClass
2
- describe ".peace" do
3
- describe "#pikarin_janken" do
4
- subject { girl.pikarin_janken }
5
-
6
- shared_examples :do_janken do
7
- it { should match(/ピカピカピカリン\nジャンケンポン!\n(.+)/) }
8
- end
9
-
10
- context "When peace" do
11
- let(:girl) { Cure.peace }
12
-
13
- it_behaves_like :do_janken
14
- end
15
-
16
- context "When cure_peace" do
17
- let(:girl) { Cure.cure_peace }
18
-
19
- it_behaves_like :do_janken
20
- end
21
- end
22
- end
23
-
24
- describe ".passion" do
25
- describe "!" do
26
- subject { !Cure.passion }
27
-
28
- let(:girl) { Cure.passion }
29
-
30
- after do
31
- girl.rollback
32
- girl.humanize!
33
- end
34
-
35
- context "called once" do
36
- it { expect { subject }.to change { girl.name }.from("東せつな").to("イース") }
37
- end
38
-
39
- context "called twice" do
40
- before do
41
- !Cure.passion
42
- end
43
-
44
- it { expect { subject }.to change { girl.name }.from("イース").to("東せつな") }
45
- end
46
-
47
- context "after transform" do
48
- before do
49
- girl.transform!
50
- end
51
-
52
- it { expect { subject }.to change { girl.name }.from("キュアパッション").to("イース") }
53
- end
54
- end
55
- end
56
-
57
- describe ".beat" do
58
- describe "!" do
59
- subject { !Cure.beat }
60
-
61
- let(:girl) { Cure.beat }
62
-
63
- after do
64
- girl.rollback
65
- girl.humanize!
66
- end
67
-
68
- context "called once" do
69
- it { expect { subject }.to change { girl.name }.from("黒川エレン").to("セイレーン") }
70
- end
71
-
72
- context "called twice" do
73
- before do
74
- !Cure.beat
75
- end
76
-
77
- it { expect { subject }.to change { girl.name }.from("セイレーン").to("黒川エレン") }
78
- end
79
-
80
- context "after transform" do
81
- before do
82
- girl.transform!
83
- end
84
-
85
- it { expect { subject }.to change { girl.name }.from("キュアビート").to("セイレーン") }
86
- end
87
- end
88
- end
89
-
90
- describe ".scarlet" do
91
- describe "!" do
92
- subject { !Cure.scarlet }
93
-
94
- let(:girl) { Cure.scarlet }
95
-
96
- after do
97
- girl.rollback
98
- girl.humanize!
99
- end
100
-
101
- context "called once" do
102
- it { expect { subject }.to change { girl.name }.from("紅城トワ").to("トワイライト") }
103
- end
104
-
105
- context "called twice" do
106
- before do
107
- !Cure.scarlet
108
- end
109
-
110
- it { expect { subject }.to change { girl.name }.from("トワイライト").to("紅城トワ") }
111
- end
112
-
113
- context "after transform" do
114
- before do
115
- girl.transform!
116
- end
117
-
118
- it { expect { subject }.to change { girl.name }.from("キュアスカーレット").to("トワイライト") }
119
- end
120
- end
121
- end
122
- end