rubicure 0.2.9 → 0.3.0

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
  SHA1:
3
- metadata.gz: 66925fa71c31832811a63c3c9de85a290ede59ca
4
- data.tar.gz: 95bdf2c29a1846d2aa0d7cefe8a85adc10c1af57
3
+ metadata.gz: e7f768c160d2e1eb2f64b0d3b0643444a6aac2e8
4
+ data.tar.gz: 0400f5697b1bbbad9a4f2d4fa5aae4e1fadb2da7
5
5
  SHA512:
6
- metadata.gz: 22348b32b4743d3221b7f09fc180f105c9a310d56537110a53e9d4c21ac6cfc3200ad529808ab3db6250cbbeffffc60df2dee51a0649a85c4ba52532354b677a
7
- data.tar.gz: 936084f19b59988ed596b1a88164a221f2cc416ba831bf1354c7a9b0315da5812f3b2f00075d5cdb92ef462e5f9de27ff11ec9de2348cbbf33e6c5366b24a5c9
6
+ metadata.gz: 5caf845181760e55e59a1b8f4a3b56580c5f20ff59dda6b32e99d8b937f7945378dc4075893b2df8bbc8e51c08eac1ed4db222d4c1184cb5913c97c23799ccd8
7
+ data.tar.gz: b50216ad9489def328e5c29dc5fc71b0e5afa63892368cb92cc212bca9c3fd0bce423b8fc93ae3432b8a731a862af2f4d57431da4e1d1db3b807aca2215b7e22
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 2.0
4
4
  - 2.1
5
5
  - 2.2
6
+ - 2.3
6
7
  - ruby-head
7
8
  bundler_args: "--jobs=2"
8
9
  cache: bundler
@@ -22,4 +23,5 @@ notifications:
22
23
  matrix:
23
24
  allow_failures:
24
25
  - rvm: ruby-head
26
+ - rvm: 2.3
25
27
  sudo: false
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v0.2.9...master)
2
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.3.0...master)
3
3
 
4
- ## 0.2.9
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 @@ shiny_luminous: &shiny_luminous
5
5
  cast_name: 田中理恵
6
6
  created_date: 2005-03-06 # episode 5
7
7
  color: yellow
8
+ birthday: 9/9
8
9
  transform_message: |-
9
10
  ルミナス・シャイニングストリーム!
10
11
  輝く命、シャイニールミナス!
@@ -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
- human_name: 日向咲
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
- human_name: 美翔舞
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
 
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "0.2.9"
2
+ VERSION = "0.3.0"
3
3
  end
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
@@ -104,6 +104,7 @@ RSpec.configure do |config|
104
104
  config.order = :random
105
105
 
106
106
  config.include Delorean
107
+ config.include TestUtil
107
108
 
108
109
  config.before(:each) do
109
110
  Rubicure::Girl.sleep_sec = 0
@@ -0,0 +1,9 @@
1
+ module TestUtil
2
+ def time(str)
3
+ Time.zone.parse(str)
4
+ end
5
+
6
+ def date(str)
7
+ Date.parse(str)
8
+ end
9
+ 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: 0.2.9
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-08-29 00:00:00.000000000 Z
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: