rubicure 1.0.0.pre2 → 1.0.0.pre3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c1cad6a95b079098637acf02fa89d4285235ca8
4
- data.tar.gz: d52fb184daabf5e00a1e5f328bb46b10ba375ffa
3
+ metadata.gz: c176af2bff658da89c24243c92da38146630a597
4
+ data.tar.gz: 0ad486115ec51b5f0fd317b8fe9e88e1621080d1
5
5
  SHA512:
6
- metadata.gz: 9035f345de085e3e1ba40074ab3822621a35ff6c15a24cffcb577d2240420b298f35192aac9893fa542d24df4b1866dc938656f0f8b68313b2e27e58c48b56aa
7
- data.tar.gz: 76b0bb2243515b2e9e08cb05757db0ba7aa06fa9e77b564afaf83e91130a4737a42135e25f71e8c670c9b3318722e4dd8ac2370ca8bb8702bfb2272f45ff8fd8
6
+ metadata.gz: 6ed03551dd1464f1db0fa78ccd13b24da2d3a1a5bd5cd44d9313695b15f7f97dbd8a1c8b4a21147a55e0b375375f526f71b17178c967ddcc725c7551f8c08507
7
+ data.tar.gz: 7da17c3bec7e18f4cb6eb97212fdbd26ac793a40c4b5ba433fea7d36ab859bb1002895e7d588c7b52930ae431bb220c86f6f8f373690bd37e9edce57ebccd53e
@@ -2,19 +2,27 @@
2
2
  [full changelog](http://github.com/sue445/rubicure/compare/v0.4.12...master)
3
3
 
4
4
  ## v1.0.0
5
- [full changelog](http://github.com/sue445/rubicure/compare/v0.4.12...v1.0.0.pre1)
6
5
 
7
6
  ### Breaking changes :bomb:
8
7
  * Remove `Girl#humanize`
9
- * https://github.com/sue445/rubicure/pull/124
8
+ * https://github.com/sue445/rubicure/pull/124
10
9
  * Drop support ruby 2.0 and 2.1
11
- * https://github.com/sue445/rubicure/pull/122
10
+ * https://github.com/sue445/rubicure/pull/122
12
11
  * Rename: human name of cure princess
13
- * https://github.com/sue445/rubicure/pull/133
14
-
12
+ * https://github.com/sue445/rubicure/pull/133
13
+ * `Precure.all_stars` returns only from "Futari wa Pretty Cure" to "Maho Girls PreCure"
14
+ * https://github.com/sue445/rubicure/pull/138
15
+ * https://github.com/sue445/rubicure/issues/136
16
+ * i.e. "Kirakira Precure Alamode" is not included
17
+ * If necessary, please rewrite as follows.
18
+ * `Precure.all_stars` -> `Precure.all_girls`
19
+
15
20
  ### Enhancements
16
21
  * Impl `Girl#full_name`
17
22
  * https://github.com/sue445/rubicure/pull/135
23
+ * Impl `Precure.all_girls` (a.k.a. `Precure.all`)
24
+ * https://github.com/sue445/rubicure/pull/138
25
+ * https://github.com/sue445/rubicure/issues/136
18
26
 
19
27
  ## v0.4.12
20
28
  [full changelog](http://github.com/sue445/rubicure/compare/v0.4.11...v0.4.12)
data/README.md CHANGED
@@ -417,10 +417,11 @@ Cure.miracle.full_name
417
417
  ### Precure allstars
418
418
  ```ruby
419
419
  Precure.all_stars.count
420
- #=> 36
421
-
422
420
  Precure.all_stars.map(&:precure_name)
423
- #=> ["キュアブラック", "キュアホワイト", "シャイニールミナス", "キュアブルーム", "キュアイーグレット", "キュアドリーム", "キュアルージュ", "キュアレモネード", "キュアミント", "キュアアクア", "ミルキィローズ", "キュアピーチ", "キュアベリー", "キュアパイン", "キュアパッション", "キュアブロッサム", "キュアマリン", "キュアサンシャイン", "キュアムーンライト", "キュアメロディ", "キュアリズム", "キュアビート", "キュアミューズ", "キュアハッピー", "キュアサニー", "キュアピース", "キュアマーチ", "キュアビューティ", "キュアハート", "キュアダイヤモンド", "キュアロゼッタ", "キュアソード", "キュアエース", "キュアラブリー", "キュアプリンセス", "キュアハニー"]
421
+ # returns current precure count and names
422
+
423
+ Precure.all_stars.include?(Cure.echo)
424
+ #=> false
424
425
 
425
426
  Precure.all_stars("2013-10-26").count
426
427
  #=> 33
@@ -458,6 +459,22 @@ Precure.all_stars(:sing_together_miracle_magic).include?(Cure.echo)
458
459
 
459
460
  and [more aliases!](config/movies.yml)
460
461
 
462
+ ### `Precure.all_girls` (a.k.a. `Precure.all`)
463
+ ```ruby
464
+ Precure.all_girls.count
465
+ Precure.all_girls.map(&:precure_name)
466
+ # returns current precure count and names
467
+
468
+ Precure.all_girls("2013-10-26").count
469
+ #=> 33
470
+
471
+ Precure.all_girls.include?(Cure.echo)
472
+ #=> true
473
+ ```
474
+
475
+ #### `Precure.all_girls` vs `Precure.all_stars`
476
+ * `Precure.all_girls` returns all precure. (includes "Kirakira Precure Alamode")
477
+ * `Precure.all_stars` returns only from "Futari wa Pretty Cure" to "Maho Girls PreCure"
461
478
 
462
479
  ### Equivalence
463
480
  ```ruby
@@ -3,7 +3,7 @@ cure_echo: &cure_echo
3
3
  human_name: 坂上あゆみ
4
4
  precure_name: キュアエコー
5
5
  cast_name: 能登麻美子
6
- created_date:
6
+ created_date: 2012-03-17
7
7
  color: white
8
8
  transform_message: |-
9
9
  みんなの思いを守るために
@@ -34,15 +34,6 @@ module Rubicure
34
34
  # @param [Time,Date,String,Symbol] arg Time, Date or date like String (ex. "2013-12-16")
35
35
  # @return [Array<Rubicure::Girl>]
36
36
  def all_stars(arg = Time.current)
37
- unless @all_stars
38
- @all_stars = []
39
- Rubicure::Girl.names.each do |girl_name|
40
- @all_stars << Rubicure::Girl.find(girl_name)
41
- end
42
-
43
- @all_stars.uniq!(&:human_name)
44
- end
45
-
46
37
  extra_girls = []
47
38
 
48
39
  # args is Time or Date
@@ -58,10 +49,28 @@ module Rubicure
58
49
  end
59
50
  end
60
51
 
61
- girls = @all_stars.select { |girl| girl.created_date && girl.created_date <= date }
62
- girls + extra_girls
52
+ all_girls(date) - [Cure.echo] + extra_girls
53
+ end
54
+
55
+ # @param [Time,Date] arg Time, Date or date like String (ex. "2013-12-16")
56
+ # @return [Array<Rubicure::Girl>]
57
+ def all_girls(arg = Time.current)
58
+ date = to_date(arg)
59
+
60
+ unless @all_girls
61
+ @all_girls = []
62
+ Rubicure::Girl.names.each do |girl_name|
63
+ @all_girls << Rubicure::Girl.find(girl_name)
64
+ end
65
+
66
+ @all_girls.uniq!(&:human_name)
67
+ end
68
+
69
+ @all_girls.select { |girl| girl.created_date && girl.created_date <= date }
63
70
  end
64
71
 
72
+ alias_method :all, :all_girls
73
+
65
74
  # iterate with :unmarked, :max_heart, ...
66
75
  #
67
76
  # @yield series
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "1.0.0.pre2"
2
+ VERSION = "1.0.0.pre3"
3
3
  end
@@ -48,6 +48,7 @@ describe Rubicure::Core do
48
48
 
49
49
  where(:arg, :expected_count, :include_cure_echo) do
50
50
  "2009-03-20" | 14 | false
51
+ "2017-01-17" | 44 | false
51
52
  Date.parse("2010-03-20") | 17 | false
52
53
  Time.parse("2011-03-19") | 21 | false
53
54
 
@@ -78,4 +79,33 @@ describe Rubicure::Core do
78
79
  end
79
80
  end
80
81
  end
82
+
83
+ describe "#all_girls" do
84
+ context "Without arg" do
85
+ subject { instance.all_girls }
86
+
87
+ let(:precure_count) { 45 }
88
+
89
+ its(:count) { should == precure_count }
90
+ it { should include Cure.echo }
91
+ end
92
+
93
+ context "With arg" do
94
+ subject { instance.all_girls(arg) }
95
+
96
+ using RSpec::Parameterized::TableSyntax
97
+
98
+ where(:arg, :expected_count, :include_cure_echo) do
99
+ "2009-03-20" | 14 | false
100
+ "2017-01-17" | 45 | true
101
+ Date.parse("2010-03-20") | 17 | false
102
+ Time.parse("2011-03-19") | 21 | false
103
+ end
104
+
105
+ with_them do
106
+ its(:count) { should == expected_count }
107
+ it { expect(subject.include?(Cure.echo)).to be include_cure_echo }
108
+ end
109
+ end
110
+ end
81
111
  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.0.0.pre2
4
+ version: 1.0.0.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2017-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport