rubicure 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: 9eaedd51eb5a6f8711b02e805ed6ff5df4f2ba86ecc8a36a994e932744eb6aba
4
- data.tar.gz: 4f69d58ad1faf672177f74ccd66baae3d1c7d6c18602ee88da164e7d96e89433
3
+ metadata.gz: 77576d01a0785c3932fca19034134f7cd731520060bdfdcf79ee8967cff6e267
4
+ data.tar.gz: 7d5a5dda89f8ccb92351f977b83f4aae2884e88c093baf99f5b6fc41998d5c6d
5
5
  SHA512:
6
- metadata.gz: 63aec3560071736f04ab722f3fbb37a1317d3664b4ac219cc931e3b2edb8b32d92b7f946b34fcee16bf1dfafcdcf555b20671b8797319eacdd3753c0fddf0fb7
7
- data.tar.gz: 424dd82141401d8e7543c18702e483b3258ce12bbc25918ac43e8afb8612f05fdf9058bf819e900ca6c22d9de1a120eef75d54e9dccd4118df7192c75c7c3433
6
+ metadata.gz: 168ce2b5cc01000cd47ce2ee90c3d96abc14406dcfbf69002a0199eeb7d43dc018360ad81da5e0d239fedcb94425e3b63d3ac0e6f0656a21833acc7f571a0df0
7
+ data.tar.gz: ee3514f8b22234dc7b2bb8bc3c19df339f7a445d960a77567c082e63649de3227342f914bff267fd2186d618eccb3fc372274dc74d019f15a8455228a64b86ee
@@ -1,5 +1,11 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v1.1.1...master)
2
+ [full changelog](http://github.com/sue445/rubicure/compare/v1.1.2...master)
3
+
4
+ ## v1.1.2
5
+ [full changelog](http://github.com/sue445/rubicure/compare/v1.1.1...v1.1.2)
6
+
7
+ * Add Cure Etoile Birthday :birthday:
8
+ * https://github.com/sue445/rubicure/pull/167
3
9
 
4
10
  ## v1.1.1
5
11
  [full changelog](http://github.com/sue445/rubicure/compare/v1.1.0...v1.1.1)
data/README.md CHANGED
@@ -482,6 +482,15 @@ Precure.dream_stars.map(&:precure_name)
482
482
  #=> ["キュアフローラ", "キュアマーメイド", "キュアトゥインクル", "キュアスカーレット", "キュアミラクル", "キュアマジカル", "キュアフェリーチェ", "キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ"]
483
483
  ```
484
484
 
485
+ ### `Precure.super_stars`
486
+ ```ruby
487
+ Precure.super_stars.count
488
+ #=> 12
489
+
490
+ Precure.super_stars.map(&:precure_name)
491
+ #=> ["キュアミラクル", "キュアマジカル", "キュアフェリーチェ", "キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ", "キュアパルフェ", "キュアエール", "キュアアンジュ", "キュアエトワール"]
492
+ ```
493
+
485
494
  ### Equivalence
486
495
  ```ruby
487
496
  yayoi = Cure.peace.dup
@@ -55,7 +55,7 @@ cure_etoile: &cure_etoile
55
55
  cast_name: 小倉唯
56
56
  color: yellow
57
57
  created_date: 2018-03-04 # episode 5
58
- # birthday:
58
+ birthday: 4/8
59
59
  transform_message: |-
60
60
  ミライクリスタル!
61
61
  ハートキラっと!
@@ -22,12 +22,14 @@ module Precure
22
22
  end
23
23
 
24
24
  module Shiny
25
+ # @return [Rubicure::Girl] Shiny luminous
25
26
  def self.luminous
26
27
  Rubicure::Girl.find(:luminous)
27
28
  end
28
29
  end
29
30
 
30
31
  module Milky
32
+ # @return [Rubicure::Girl] Milky rose
31
33
  def self.rose
32
34
  Rubicure::Girl.find(:rose)
33
35
  end
@@ -2,7 +2,8 @@ module Rubicure
2
2
  module Concerns
3
3
  # utility methods
4
4
  module Util
5
- # @param arg
5
+ # @param arg [Date,Time,String]
6
+ #
6
7
  # @return [Date] arg is String or Date
7
8
  # @return [Time] arg is Time
8
9
  # @return [nil] arg is other
@@ -28,8 +28,16 @@ module Rubicure
28
28
  unmarked_precure.respond_to?(name)
29
29
  end
30
30
 
31
- # @return [Series] current precure
32
- # @raise not onair!
31
+ # rubocop:disable Metrics/LineLength
32
+
33
+ # get current precure series
34
+ # @return [Rubicure::Series] current precure
35
+ #
36
+ # @raise [NotOnAirError] not onair!
37
+ #
38
+ # @example
39
+ # Precure.now
40
+ # #=> {:series_name=>"go_princess", :title=>"Go!プリンセスプリキュア", :started_date=>Sun, 01 Feb 2015, :girls=>["cure_flora", "cure_mermaid", "cure_twinkle", "cure_scarlet"]}
33
41
  def now
34
42
  current_time = Time.now
35
43
  each_with_series do |series|
@@ -37,11 +45,56 @@ module Rubicure
37
45
  end
38
46
  raise NotOnAirError, "Not on air precure!"
39
47
  end
48
+ # rubocop:enable Metrics/LineLength
40
49
 
41
50
  alias_method :current, :now
42
51
 
52
+ # Get precure all stars
53
+ #
43
54
  # @param [Time,Date,String,Symbol] arg Time, Date or date like String (ex. "2013-12-16")
55
+ #
44
56
  # @return [Array<Rubicure::Girl>]
57
+ #
58
+ # @example precure all stars
59
+ # Precure.all_stars.count
60
+ # Precure.all_stars.map(&:precure_name)
61
+ # # returns current precure count and names
62
+ #
63
+ # Precure.all_stars.include?(Cure.echo)
64
+ # #=> false
65
+ #
66
+ # Precure.all_stars("2013-10-26").count
67
+ # #=> 33
68
+ #
69
+ # Precure.all_stars(:dx).count
70
+ # #=> 14
71
+ #
72
+ # Precure.all_stars(:dx2).count
73
+ # #=> 17
74
+ #
75
+ # Precure.all_stars(:dx3).count
76
+ # #=> 21
77
+ #
78
+ # Precure.all_stars(:new_stage).count
79
+ # #=> 29
80
+ # Precure.all_stars(:new_stage).include?(Cure.echo)
81
+ # #=> true
82
+ #
83
+ # Precure.all_stars(:new_stage2).count
84
+ # #=> 32
85
+ #
86
+ # Precure.all_stars(:new_stage3).count
87
+ # #=> 37
88
+ # Precure.all_stars(:new_stage3).include?(Cure.echo)
89
+ # #=> true
90
+ #
91
+ # Precure.all_stars(:spring_carnival).count
92
+ # #=> 40
93
+ #
94
+ # Precure.all_stars(:sing_together_miracle_magic).count
95
+ # #=> 44
96
+ # Precure.all_stars(:sing_together_miracle_magic).include?(Cure.echo)
97
+ # #=> true
45
98
  def all_stars(arg = Time.current)
46
99
  extra_girls = []
47
100
 
@@ -66,8 +119,22 @@ module Rubicure
66
119
  all_girls(date) - [Cure.echo] + extra_girls
67
120
  end
68
121
 
122
+ # Get all precures
123
+ #
69
124
  # @param [Time,Date] arg Time, Date or date like String (ex. "2013-12-16")
70
- # @return [Array<Rubicure::Girl>]
125
+ #
126
+ # @return [Array<Rubicure::Girl>] all precures
127
+ #
128
+ # @example
129
+ # Precure.all_girls.count
130
+ # Precure.all_girls.map(&:precure_name)
131
+ # # returns current precure count and names
132
+ #
133
+ # Precure.all_girls("2013-10-26").count
134
+ # #=> 33
135
+ #
136
+ # Precure.all_girls.include?(Cure.echo)
137
+ # #=> true
71
138
  def all_girls(arg = Time.current)
72
139
  date = to_date(arg)
73
140
 
@@ -85,6 +152,16 @@ module Rubicure
85
152
 
86
153
  alias_method :all, :all_girls
87
154
 
155
+ # Get precure dream stars
156
+ #
157
+ # @return [Array<Rubicure::Girl>] precure dream stars
158
+ #
159
+ # @example
160
+ # Precure.dream_stars.count
161
+ # #=> 12
162
+ #
163
+ # Precure.dream_stars.map(&:precure_name)
164
+ # #=> ["キュアフローラ", "キュアマーメイド", "キュアトゥインクル", "キュアスカーレット", "キュアミラクル", "キュアマジカル", "キュアフェリーチェ", "キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ"]
88
165
  def dream_stars
89
166
  return @dream_stars if @dream_stars
90
167
  girls = Precure.go_princess.girls + Precure.maho_girls.girls + Precure.a_la_mode.girls
@@ -95,6 +172,16 @@ module Rubicure
95
172
  @dream_stars
96
173
  end
97
174
 
175
+ # Get precure super stars
176
+ #
177
+ # @return [Array<Rubicure::Girl>] precure super stars
178
+ #
179
+ # @example
180
+ # Precure.super_stars.count
181
+ # #=> 12
182
+ #
183
+ # Precure.super_stars.map(&:precure_name)
184
+ # #=> ["キュアミラクル", "キュアマジカル", "キュアフェリーチェ", "キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ", "キュアパルフェ", "キュアエール", "キュアアンジュ", "キュアエトワール"]
98
185
  def super_stars
99
186
  return @super_stars if @super_stars
100
187
  girls = Precure.maho_girls.girls + Precure.a_la_mode.girls + Precure.hugtto.girls
@@ -24,16 +24,19 @@ module Rubicure
24
24
 
25
25
  attr_accessor :io
26
26
 
27
+ # @return [Integer]
27
28
  def current_state
28
29
  @current_state ||= 0
29
30
  end
30
31
 
32
+ # @return [Array<String>]
31
33
  def state_names
32
34
  state_names = [human_name, precure_name]
33
35
  state_names += Array.wrap(extra_names) if respond_to?(:extra_names)
34
36
  state_names
35
37
  end
36
38
 
39
+ # @return [Boolean]
37
40
  def ==(other)
38
41
  other.is_a?(self.class) && self.human_name == other.human_name
39
42
  end
@@ -45,7 +48,28 @@ module Rubicure
45
48
  alias_method :to_s, :name
46
49
 
47
50
  # human -> precure ( -> extra forms ) -> human ...
51
+ #
52
+ # @param style [Symbol]
53
+ #
48
54
  # @return [Rubicure::Girl] self
55
+ #
56
+ # @example
57
+ # yayoi = Cure.peace
58
+ #
59
+ # yayoi.name
60
+ # #=> "黄瀬やよい"
61
+ #
62
+ # yayoi.transform!
63
+ #
64
+ # # (レディ?)
65
+ # # プリキュア・スマイルチャージ!
66
+ # # (ゴー!ゴー!レッツ・ゴー!ピース!!)
67
+ # # ピカピカピカリンジャンケンポン! キュアピース!
68
+ # # 5つの光が導く未来!
69
+ # # 輝け!スマイルプリキュア!
70
+ #
71
+ # yayoi.name
72
+ # #=> "キュアピース"
49
73
  def transform!(style = nil)
50
74
  if style
51
75
  raise "Unknown style: #{style}" unless has_transform_style?(style)
@@ -58,12 +82,34 @@ module Rubicure
58
82
  self
59
83
  end
60
84
 
85
+ # Rollback to human
86
+ #
87
+ # @example
88
+ # yayoi = Cure.peace
89
+ # yayoi.transform!
90
+ # yayoi.name
91
+ # #=> "キュアピース"
92
+ #
93
+ # yayoi.humanize!
94
+ # yayoi.name
95
+ # #=> "黄瀬やよい"
61
96
  def humanize!
62
97
  @current_state = 0
63
98
  @current_transform_style = nil
64
99
  self
65
100
  end
66
101
 
102
+ # Attack to enemy
103
+ #
104
+ # @raise [RequireTransformError] current form is human
105
+ #
106
+ # @example
107
+ # yayoi = Cure.peace
108
+ # yayoi.transform!
109
+ #
110
+ # yayoi.attack!
111
+ #
112
+ # # プリキュア!ピースサンダー!!
67
113
  def attack!
68
114
  raise RequireTransformError, "require transform" if current_attack_message.blank?
69
115
 
@@ -72,6 +118,15 @@ module Rubicure
72
118
  current_attack_message
73
119
  end
74
120
 
121
+ # Whether `date` is her birthday
122
+ #
123
+ # @param date [Date]
124
+ #
125
+ # @return [Boolean]
126
+ #
127
+ # @example
128
+ # Cure.twinkle.birthday?(Date.parse("2015-9-12"))
129
+ # #=> true
75
130
  def birthday?(date = Date.today)
76
131
  return false unless have_birthday?
77
132
 
@@ -83,11 +138,24 @@ module Rubicure
83
138
  birthday_date == date
84
139
  end
85
140
 
141
+ # Whether she has birthday
142
+ #
143
+ # @return [Boolean]
144
+ #
145
+ # @example
146
+ # Cure.peace.have_birthday?
147
+ # #=> false
148
+ #
149
+ # Cure.twinkle.has_birthday?
150
+ # #=> true
86
151
  def have_birthday? # rubocop:disable Naming/PredicateName
87
152
  has_key?(:birthday)
88
153
  end
89
154
  alias_method :has_birthday?, :have_birthday?
90
155
 
156
+ # returns `human_full_name` or `human_name`
157
+ #
158
+ # @return [String]
91
159
  def full_name
92
160
  human_full_name.presence || human_name
93
161
  end
@@ -10,6 +10,7 @@ module Rubicure
10
10
  @config = nil
11
11
 
12
12
  # @param [Rubicure::Series,Rubicure::Girl] other
13
+ #
13
14
  # @return [Boolean] other is same Rubicure::Series or Rubicure::Series include Rubicure::Girl
14
15
  def ===(other)
15
16
  case other
@@ -22,7 +23,11 @@ module Rubicure
22
23
  end
23
24
  end
24
25
 
26
+ # Whether series is on air
27
+ #
25
28
  # @param [Time,Date,String] arg Time, Date or date like String (ex. "2013-12-16")
29
+ #
30
+ # @return [Boolean]
26
31
  def on_air?(arg)
27
32
  date = to_date(arg)
28
33
 
@@ -57,6 +62,7 @@ module Rubicure
57
62
  girls.each(&block)
58
63
  end
59
64
 
65
+ # @return [String] json string
60
66
  def to_json(*_args)
61
67
  original_hash = {}
62
68
  each_without_girls do |k, v|
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "1.1.1".freeze
2
+ VERSION = "1.1.2".freeze
3
3
  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.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-05 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport