rubicure 0.2.9 → 0.3.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/.travis.yml +2 -0
- data/CHANGELOG.md +8 -2
- data/README.md +62 -0
- data/config/girls/001_unmarked.yml +2 -0
- data/config/girls/002_max_heart.yml +1 -0
- data/config/girls/003_splash_star.yml +4 -8
- data/config/girls/010_dokidoki.yml +4 -0
- data/config/girls/012_go_princess.yml +4 -0
- data/lib/rubicure/girl.rb +16 -0
- data/lib/rubicure/version.rb +1 -1
- data/spec/girl_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/util/test_util.rb +9 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7f768c160d2e1eb2f64b0d3b0643444a6aac2e8
|
4
|
+
data.tar.gz: 0400f5697b1bbbad9a4f2d4fa5aae4e1fadb2da7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5caf845181760e55e59a1b8f4a3b56580c5f20ff59dda6b32e99d8b937f7945378dc4075893b2df8bbc8e51c08eac1ed4db222d4c1184cb5913c97c23799ccd8
|
7
|
+
data.tar.gz: b50216ad9489def328e5c29dc5fc71b0e5afa63892368cb92cc212bca9c3fd0bce423b8fc93ae3432b8a731a862af2f4d57431da4e1d1db3b807aca2215b7e22
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](http://github.com/sue445/rubicure/compare/v0.
|
2
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.0...master)
|
3
3
|
|
4
|
-
##
|
4
|
+
## v0.3.0
|
5
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.2.9...v0.3.0)
|
6
|
+
|
7
|
+
* Impl `Girl#birthday?` and `Girl#have_birthday?`
|
8
|
+
* https://github.com/sue445/rubicure/pull/86
|
9
|
+
|
10
|
+
## v0.2.9
|
5
11
|
[full changelog](http://github.com/sue445/rubicure/compare/v0.2.8.1...v0.2.9)
|
6
12
|
|
7
13
|
* Support turnover to towa-sama
|
data/README.md
CHANGED
@@ -495,9 +495,71 @@ Precure.all_stars.group_by{ |girl| girl.color }.map{ |color, girls| [color, girl
|
|
495
495
|
#=> [["pink", 9], ["yellow", 9], ["blue", 8], ["purple", 4], ["red", 4], ["white", 3], ["green", 2], ["black", 1]]
|
496
496
|
```
|
497
497
|
|
498
|
+
### birthday and birthday?
|
499
|
+
```ruby
|
500
|
+
Cure.peace.respond_to?(:birthday)
|
501
|
+
#=> false
|
502
|
+
|
503
|
+
Cure.twinkle.respond_to?(:birthday)
|
504
|
+
#=> true
|
505
|
+
Cure.twinkle.birthday
|
506
|
+
#=> "9/12"
|
507
|
+
|
508
|
+
Date.today
|
509
|
+
#=> Tue, 24 Nov 2015
|
510
|
+
irb(main):010:0> Cure.twinkle.birthday?
|
511
|
+
#=> false
|
512
|
+
|
513
|
+
Cure.twinkle.birthday?(Date.parse("2015-9-12"))
|
514
|
+
#=> true
|
515
|
+
|
516
|
+
Precure.all_stars.select(&:have_birthday?).map(&:human_name)
|
517
|
+
#=> ["美墨なぎさ", "雪城ほのか", "九条ひかり", "日向咲", "美翔舞", "相田マナ", "菱川六花", "四葉ありす", "剣崎真琴", "春野はるか", "海藤みなみ", "天ノ川きらら", "紅城トワ"]
|
518
|
+
|
519
|
+
Precure.all_stars.select(&:have_birthday?).map(&:human_name).count
|
520
|
+
#=> 13
|
521
|
+
```
|
522
|
+
|
498
523
|
## More reference
|
499
524
|
http://rubydoc.info/gems/rubicure/frames
|
500
525
|
|
526
|
+
## API Server is available!
|
527
|
+
https://rubicure.herokuapp.com/
|
528
|
+
|
529
|
+
```sh
|
530
|
+
$ curl -s https://rubicure.herokuapp.com/series/go_princess.json | jq .
|
531
|
+
{
|
532
|
+
"series_name": "go_princess",
|
533
|
+
"title": "Go!プリンセスプリキュア",
|
534
|
+
"started_date": "2015-02-01",
|
535
|
+
"girls": [
|
536
|
+
"cure_flora",
|
537
|
+
"cure_mermaid",
|
538
|
+
"cure_twinkle",
|
539
|
+
"cure_scarlett"
|
540
|
+
]
|
541
|
+
}
|
542
|
+
|
543
|
+
$ curl -s https://rubicure.herokuapp.com/girls/cure_twinkle.json | jq .
|
544
|
+
{
|
545
|
+
"girl_name": "cure_twinkle",
|
546
|
+
"human_name": "天ノ川きらら",
|
547
|
+
"precure_name": "キュアトゥインクル",
|
548
|
+
"cast_name": "山村響",
|
549
|
+
"color": "yellow",
|
550
|
+
"created_date": "2015-02-22",
|
551
|
+
"transform_message": "プリキュア!プリンセスエンゲージ!\nきらめく星のプリンセス!キュアトゥインクル!\n強く、やさしく、美しく!\nGo!プリンセスプリキュア!\n冷たい檻に閉ざされた夢、返していただきますわ!\nお覚悟はよろしくて?",
|
552
|
+
"extra_names": null,
|
553
|
+
"attack_messages": [
|
554
|
+
"エクスチェンジ!モードエレガント!\nキラキラ、星よ!プリキュア・トゥインクル・ハミング!\n(ドリーミング)\nごきげんよう\n"
|
555
|
+
],
|
556
|
+
"transform_calls": [
|
557
|
+
"princess_engage"
|
558
|
+
]
|
559
|
+
}
|
560
|
+
```
|
561
|
+
|
562
|
+
|
501
563
|
## Contributing
|
502
564
|
|
503
565
|
1. Fork it
|
@@ -5,6 +5,7 @@ cure_black: &cure_black
|
|
5
5
|
cast_name: 本名陽子
|
6
6
|
created_date: 2004-02-01 # episode 1
|
7
7
|
color: black
|
8
|
+
birthday: 10/10
|
8
9
|
transform_message: |-
|
9
10
|
デュアル・オーロラ・ウェイブ!!
|
10
11
|
光の使者、キュアブラック!
|
@@ -29,6 +30,7 @@ cure_white: &cure_white
|
|
29
30
|
cast_name: ゆかな
|
30
31
|
created_date: 2004-02-01 # episode 1
|
31
32
|
color: white
|
33
|
+
birthday: 4/4
|
32
34
|
transform_message: |-
|
33
35
|
デュアル・オーロラ・ウェイブ!!
|
34
36
|
光の使者、キュアホワイト!
|
@@ -5,6 +5,7 @@ cure_bloom: &cure_bloom
|
|
5
5
|
cast_name: 樹元オリエ
|
6
6
|
created_date: 2006-02-05 # episode 1
|
7
7
|
color: pink
|
8
|
+
birthday: 8/7
|
8
9
|
transform_message: |-
|
9
10
|
デュアル・スピリチュアル・パワー!
|
10
11
|
花開け大地に!
|
@@ -28,6 +29,7 @@ cure_egret: &cure_egret
|
|
28
29
|
cast_name: 榎本温子
|
29
30
|
created_date: 2006-02-05 # episode 1
|
30
31
|
color: white
|
32
|
+
birthday: 11/20
|
31
33
|
transform_message: |-
|
32
34
|
デュアル・スピリチュアル・パワー!
|
33
35
|
羽ばたけ空に!
|
@@ -45,9 +47,8 @@ cure_egret: &cure_egret
|
|
45
47
|
transform_calls:
|
46
48
|
- dual_spiritual_power
|
47
49
|
cure_bright: &cure_bright
|
48
|
-
|
50
|
+
<<: *cure_bloom
|
49
51
|
precure_name: キュアブライト
|
50
|
-
cast_name: 樹元オリエ
|
51
52
|
color: yellow
|
52
53
|
created_date: 2006-09-03 # episode 30
|
53
54
|
transform_message: |-
|
@@ -62,12 +63,9 @@ cure_bright: &cure_bright
|
|
62
63
|
精霊の光よ、命の煌きよ!
|
63
64
|
希望へ導け、2つの心!
|
64
65
|
プリキュア・スパイラルスタースプラッシュ!!
|
65
|
-
transform_calls:
|
66
|
-
- dual_spiritual_power
|
67
66
|
cure_windy: &cure_windy
|
68
|
-
|
67
|
+
<<: *cure_egret
|
69
68
|
precure_name: キュアウィンディ
|
70
|
-
cast_name: 榎本温子
|
71
69
|
created_date: 2006-09-03 # episode 30
|
72
70
|
color: white
|
73
71
|
transform_message: |-
|
@@ -82,8 +80,6 @@ cure_windy: &cure_windy
|
|
82
80
|
精霊の光よ、命の煌きよ!
|
83
81
|
希望へ導け、2つの心!
|
84
82
|
プリキュア・スパイラルスタースプラッシュ!!
|
85
|
-
transform_calls:
|
86
|
-
- dual_spiritual_power
|
87
83
|
bloom:
|
88
84
|
<<: *cure_bloom
|
89
85
|
egret:
|
@@ -5,6 +5,7 @@ cure_heart: &cure_heart
|
|
5
5
|
cast_name: 生天目仁美
|
6
6
|
created_date: 2013-02-03 # episode 1
|
7
7
|
color: pink
|
8
|
+
birthday: 8/4
|
8
9
|
transform_message: |-
|
9
10
|
プリキュアラブリンク!
|
10
11
|
L! O! V! E!
|
@@ -28,6 +29,7 @@ cure_diamond: &cure_diamond
|
|
28
29
|
cast_name: 寿美菜子
|
29
30
|
created_date: 2013-02-17 # episode 3
|
30
31
|
color: blue
|
32
|
+
birthday: 9/17
|
31
33
|
transform_message: |-
|
32
34
|
プリキュアラブリンク!
|
33
35
|
L! O! V! E!
|
@@ -48,6 +50,7 @@ cure_rosetta: &cure_rosetta
|
|
48
50
|
cast_name: 渕上舞
|
49
51
|
created_date: 2013-02-24 # episode 4
|
50
52
|
color: yellow
|
53
|
+
birthday: 5/28
|
51
54
|
transform_message: |-
|
52
55
|
プリキュアラブリンク!
|
53
56
|
L! O! V! E!
|
@@ -68,6 +71,7 @@ cure_sword: &cure_sword
|
|
68
71
|
cast_name: 宮本佳那子
|
69
72
|
created_date: 2013-02-03 # episode 1
|
70
73
|
color: purple
|
74
|
+
birthday: 11/4
|
71
75
|
transform_message: |-
|
72
76
|
プリキュアラブリンク!
|
73
77
|
L! O! V! E!
|
@@ -5,6 +5,7 @@ cure_flora: &cure_flora
|
|
5
5
|
cast_name: 嶋村侑
|
6
6
|
color: pink
|
7
7
|
created_date: 2015-02-01 # episode 1
|
8
|
+
birthday: 4/10
|
8
9
|
transform_message: |-
|
9
10
|
プリキュア!プリンセスエンゲージ!
|
10
11
|
咲き誇る花のプリンセス!キュアフローラ!
|
@@ -27,6 +28,7 @@ cure_mermaid: &cure_mermaid
|
|
27
28
|
cast_name: 浅野真澄
|
28
29
|
color: blue
|
29
30
|
created_date: 2015-02-08 # episode 2
|
31
|
+
birthday: 7/20
|
30
32
|
transform_message: |-
|
31
33
|
プリキュア!プリンセスエンゲージ!
|
32
34
|
澄み渡る海のプリンセス!キュアマーメイド!
|
@@ -50,6 +52,7 @@ cure_twinkle: &cure_twinkle
|
|
50
52
|
cast_name: 山村響
|
51
53
|
color: yellow
|
52
54
|
created_date: 2015-02-22 # episode 4
|
55
|
+
birthday: 9/12
|
53
56
|
transform_message: |-
|
54
57
|
プリキュア!プリンセスエンゲージ!
|
55
58
|
きらめく星のプリンセス!キュアトゥインクル!
|
@@ -73,6 +76,7 @@ cure_scarlett: &cure_scarlett
|
|
73
76
|
cast_name: 沢城みゆき
|
74
77
|
color: red
|
75
78
|
created_date: 2015-07-05 # episode 22
|
79
|
+
birthday: 12/15
|
76
80
|
transform_message: |-
|
77
81
|
プリキュア!プリンセスエンゲージ!
|
78
82
|
深紅の炎のプリンセス!キュアスカーレット!
|
data/lib/rubicure/girl.rb
CHANGED
@@ -55,6 +55,22 @@ module Rubicure
|
|
55
55
|
current_attack_message
|
56
56
|
end
|
57
57
|
|
58
|
+
def birthday?(date = Date.today)
|
59
|
+
return false unless have_birthday?
|
60
|
+
|
61
|
+
# NOTE: birthday is "mm/dd"
|
62
|
+
month, day = birthday.split("/")
|
63
|
+
|
64
|
+
birthday_date = Date.new(date.year, month.to_i, day.to_i)
|
65
|
+
|
66
|
+
birthday_date == date
|
67
|
+
end
|
68
|
+
|
69
|
+
def have_birthday?
|
70
|
+
respond_to?(:birthday)
|
71
|
+
end
|
72
|
+
alias_method :has_birthday?, :have_birthday?
|
73
|
+
|
58
74
|
class << self
|
59
75
|
attr_writer :sleep_sec
|
60
76
|
|
data/lib/rubicure/version.rb
CHANGED
data/spec/girl_spec.rb
CHANGED
@@ -223,4 +223,32 @@ EOF
|
|
223
223
|
it { expect(girl).to be_yellow }
|
224
224
|
it { expect(girl).not_to be_pink }
|
225
225
|
end
|
226
|
+
|
227
|
+
describe "birthday?" do
|
228
|
+
subject { girl.birthday?(curent_date) }
|
229
|
+
|
230
|
+
let(:curent_date) { Date.today }
|
231
|
+
|
232
|
+
context "has birthday" do
|
233
|
+
let(:girl) { Cure.flora }
|
234
|
+
|
235
|
+
context "curent_time is birthday" do
|
236
|
+
let(:curent_date) { date("2015-04-10") }
|
237
|
+
|
238
|
+
it { should be true }
|
239
|
+
end
|
240
|
+
|
241
|
+
context "curent_time is not birthday" do
|
242
|
+
let(:curent_date) { date("2015-04-11") }
|
243
|
+
|
244
|
+
it { should be false }
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
context "don't have birthday" do
|
249
|
+
let(:girl) { Cure.peace }
|
250
|
+
|
251
|
+
it { should be false }
|
252
|
+
end
|
253
|
+
end
|
226
254
|
end
|
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.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -271,6 +271,7 @@ files:
|
|
271
271
|
- spec/rubicure_spec.rb
|
272
272
|
- spec/series_spec.rb
|
273
273
|
- spec/spec_helper.rb
|
274
|
+
- spec/support/util/test_util.rb
|
274
275
|
homepage: https://github.com/sue445/rubicure
|
275
276
|
licenses:
|
276
277
|
- MIT
|
@@ -303,4 +304,5 @@ test_files:
|
|
303
304
|
- spec/rubicure_spec.rb
|
304
305
|
- spec/series_spec.rb
|
305
306
|
- spec/spec_helper.rb
|
307
|
+
- spec/support/util/test_util.rb
|
306
308
|
has_rdoc:
|