rubicure 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +3 -127
- data/.onkcop.yml +214 -0
- data/.rubocop.yml +4 -2
- data/.travis.yml +1 -2
- data/CHANGELOG.md +9 -1
- data/config/series.yml +1 -1
- data/lib/rubicure.rb +1 -0
- data/lib/rubicure/core.rb +1 -1
- data/lib/rubicure/cure.rb +15 -14
- data/lib/rubicure/errors.rb +9 -0
- data/lib/rubicure/girl.rb +27 -27
- data/lib/rubicure/movie.rb +1 -1
- data/lib/rubicure/series.rb +1 -1
- data/lib/rubicure/version.rb +1 -1
- data/rubicure.gemspec +10 -6
- data/spec/core_spec.rb +1 -1
- data/spec/cure_spec.rb +33 -0
- data/spec/girl_spec.rb +1 -1
- data/spec/movie_spec.rb +2 -2
- data/spec/series_spec.rb +5 -3
- metadata +25 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d47c971913dc65b8a0e60d8eae6b75efed8b0b30
|
4
|
+
data.tar.gz: ca2bd010be4b715ed3fd24e444f174596739e2cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed7d60d488ce7c81e761d2370679b0ed6a48d4c138e37db56baec55c6baa35a94dcbc0c3bf42deba01e80cdc4d7c914a5d063cd1ec40484754720390a0932ebe
|
7
|
+
data.tar.gz: a39190b596c850e949ddca06c4bcdf5d121158ff09c2d433527f9f2d7cf050b151226898c485e361b1ccc275691e35004fb1b11cb6b5cc1c8d77b199e0a13d19
|
data/.hound.yml
CHANGED
@@ -1,127 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
# Exclude autogenerated files
|
5
|
-
AllCops:
|
6
|
-
Exclude:
|
7
|
-
- "vendor/**/*" # rubocop config/default.yml
|
8
|
-
- "db/schema.rb"
|
9
|
-
DisplayCopNames: true
|
10
|
-
|
11
|
-
##################### Style ##################################
|
12
|
-
|
13
|
-
Style/AndOr:
|
14
|
-
EnforcedStyle: conditionals
|
15
|
-
|
16
|
-
Style/AsciiComments:
|
17
|
-
Enabled: false
|
18
|
-
|
19
|
-
Style/BlockDelimiters:
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Style/BracesAroundHashParameters:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/DeprecatedHashMethods:
|
26
|
-
Enabled: false
|
27
|
-
|
28
|
-
Style/Documentation:
|
29
|
-
Enabled: false
|
30
|
-
|
31
|
-
Style/DoubleNegation:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
Style/DotPosition:
|
35
|
-
EnforcedStyle: trailing
|
36
|
-
|
37
|
-
Style/EmptyElse:
|
38
|
-
EnforcedStyle: empty
|
39
|
-
|
40
|
-
Style/FormatString:
|
41
|
-
EnforcedStyle: percent
|
42
|
-
|
43
|
-
Style/GuardClause:
|
44
|
-
MinBodyLength: 5
|
45
|
-
|
46
|
-
Style/HashSyntax:
|
47
|
-
EnforcedStyle: ruby19_no_mixed_keys
|
48
|
-
Exclude:
|
49
|
-
- "**/*.rake"
|
50
|
-
- "Rakefile"
|
51
|
-
|
52
|
-
Style/IfUnlessModifier:
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
Style/IndentHash:
|
56
|
-
EnforcedStyle: consistent
|
57
|
-
|
58
|
-
Style/Lambda:
|
59
|
-
Enabled: false
|
60
|
-
|
61
|
-
Style/NumericLiterals:
|
62
|
-
MinDigits: 6
|
63
|
-
|
64
|
-
Style/PredicateName:
|
65
|
-
Enabled: false
|
66
|
-
|
67
|
-
Style/RedundantSelf:
|
68
|
-
Enabled: false
|
69
|
-
|
70
|
-
Style/RedundantReturn:
|
71
|
-
AllowMultipleReturnValues: true
|
72
|
-
|
73
|
-
Style/SignalException:
|
74
|
-
EnforcedStyle: only_raise
|
75
|
-
|
76
|
-
Style/SpaceAroundOperators:
|
77
|
-
MultiSpaceAllowedForOperators:
|
78
|
-
- "="
|
79
|
-
- "=>"
|
80
|
-
- "||"
|
81
|
-
|
82
|
-
Style/StringLiterals:
|
83
|
-
EnforcedStyle: double_quotes
|
84
|
-
|
85
|
-
Style/StringLiteralsInInterpolation:
|
86
|
-
Enabled: false
|
87
|
-
|
88
|
-
Style/SingleLineBlockParams:
|
89
|
-
Enabled: false
|
90
|
-
|
91
|
-
Style/SingleSpaceBeforeFirstArg:
|
92
|
-
Enabled: false
|
93
|
-
|
94
|
-
Style/TrailingComma:
|
95
|
-
EnforcedStyleForMultiline: comma
|
96
|
-
|
97
|
-
##################### Lint ##################################
|
98
|
-
|
99
|
-
Lint/UnderscorePrefixedVariableName:
|
100
|
-
Enabled: false
|
101
|
-
|
102
|
-
Lint/UnusedMethodArgument:
|
103
|
-
Enabled: false
|
104
|
-
|
105
|
-
##################### Metrics ##################################
|
106
|
-
|
107
|
-
Metrics/AbcSize:
|
108
|
-
Max: 30
|
109
|
-
|
110
|
-
Metrics/CyclomaticComplexity:
|
111
|
-
Max: 10
|
112
|
-
|
113
|
-
Metrics/LineLength:
|
114
|
-
Max: 160
|
115
|
-
Exclude:
|
116
|
-
- "db/migrate/*.rb"
|
117
|
-
|
118
|
-
Metrics/MethodLength:
|
119
|
-
Max: 20
|
120
|
-
Exclude:
|
121
|
-
- "db/migrate/*.rb"
|
122
|
-
|
123
|
-
Metrics/PerceivedComplexity:
|
124
|
-
Max: 8
|
125
|
-
|
126
|
-
Metrics/ClassLength:
|
127
|
-
Max: 120
|
1
|
+
ruby:
|
2
|
+
enabled: true
|
3
|
+
config_file: .rubocop.yml
|
data/.onkcop.yml
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
# target_version:
|
2
|
+
# rubocop v0.35.1
|
3
|
+
|
4
|
+
# 自動生成されるものはチェック対象から除外する
|
5
|
+
AllCops:
|
6
|
+
Exclude:
|
7
|
+
- "vendor/**/*" # rubocop config/default.yml
|
8
|
+
- "db/schema.rb"
|
9
|
+
DisplayCopNames: true
|
10
|
+
|
11
|
+
##################### Style ##################################
|
12
|
+
|
13
|
+
# redirect_to xxx and return のイディオムを維持したい
|
14
|
+
Style/AndOr:
|
15
|
+
EnforcedStyle: conditionals
|
16
|
+
|
17
|
+
# 日本語のコメントを許可する
|
18
|
+
Style/AsciiComments:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# do .. end から更にメソッドチェーンすると見づらいので
|
22
|
+
# auto-correct せず、自分で修正する
|
23
|
+
# spec 内は見た目が綺麗になるので許可
|
24
|
+
Style/BlockDelimiters:
|
25
|
+
AutoCorrect: false
|
26
|
+
Exclude:
|
27
|
+
- "spec/**/*"
|
28
|
+
|
29
|
+
# option 等、明示的にハッシュにした方が分かりやすい場合もある
|
30
|
+
Style/BracesAroundHashParameters:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
# Style/CollectionMethods 自体は無効になっているのだが、
|
34
|
+
# https://github.com/bbatsov/rubocop/issues/1084
|
35
|
+
# https://github.com/bbatsov/rubocop/issues/1334
|
36
|
+
# Performance/Detect がこの設定値を見るので PreferredMethods だけ変更しておく。
|
37
|
+
#
|
38
|
+
# デフォルト値から変えたのは
|
39
|
+
# find -> detect
|
40
|
+
# ActiveRecord の find と間違えやすいため
|
41
|
+
# reduce -> inject
|
42
|
+
# detect, reject, select と並べたときに韻を踏んでいるため。
|
43
|
+
# collect -> map を維持しているのは文字数が圧倒的に少ないため。
|
44
|
+
Style/CollectionMethods:
|
45
|
+
PreferredMethods:
|
46
|
+
detect: "detect"
|
47
|
+
find: "detect"
|
48
|
+
inject: "inject"
|
49
|
+
reduce: "inject"
|
50
|
+
|
51
|
+
# Hash#has_key? は許可したい
|
52
|
+
Style/DeprecatedHashMethods:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
# ドキュメントの無い public class を許可する
|
56
|
+
Style/Documentation:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
# !! のイディオムは積極的に使う
|
60
|
+
Style/DoubleNegation:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
# メソッドチェーンの改行は末尾に . を入れる
|
64
|
+
# REPL に貼り付けた際の暴発を防ぐため
|
65
|
+
Style/DotPosition:
|
66
|
+
EnforcedStyle: trailing
|
67
|
+
|
68
|
+
# 明示的に else で nil を返すのは分かりやすいので許可する
|
69
|
+
Style/EmptyElse:
|
70
|
+
EnforcedStyle: empty
|
71
|
+
|
72
|
+
# 桁揃えが綺麗にならないことが多いので migration は除外
|
73
|
+
Style/ExtraSpacing:
|
74
|
+
Exclude:
|
75
|
+
- "db/migrate/*.rb"
|
76
|
+
|
77
|
+
# いずれかに揃えるのならば `sprintf` や `format` より String#% が好きです
|
78
|
+
Style/FormatString:
|
79
|
+
EnforcedStyle: percent
|
80
|
+
|
81
|
+
# if 文の中に 3 行程度のブロックを書くぐらいは許容した方が現実的
|
82
|
+
Style/GuardClause:
|
83
|
+
MinBodyLength: 5
|
84
|
+
|
85
|
+
# rake タスクの順序の hash は rocket を許可する
|
86
|
+
Style/HashSyntax:
|
87
|
+
Exclude:
|
88
|
+
- "**/*.rake"
|
89
|
+
- "Rakefile"
|
90
|
+
|
91
|
+
# 条件式の方を意識させたい場合には後置の if/unless を使わない方が分かりやすい
|
92
|
+
Style/IfUnlessModifier:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
# ({ と hash を開始した場合に ( の位置にインデントさせる
|
96
|
+
# そもそも {} が必要ない可能性が高いが Style/BracesAroundHashParameters はチェックしないことにしたので
|
97
|
+
Style/IndentHash:
|
98
|
+
EnforcedStyle: consistent
|
99
|
+
|
100
|
+
# private/protected は一段深くインデントする
|
101
|
+
Style/IndentationConsistency:
|
102
|
+
EnforcedStyle: rails
|
103
|
+
|
104
|
+
# scope 等は複数行でも lambda ではなく ->{} で揃えた方が見た目が綺麗
|
105
|
+
Style/Lambda:
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
# 1_000_000 と区切り文字が 2 個以上必要になる場合のみ _ 区切りを必須にする
|
109
|
+
Style/NumericLiterals:
|
110
|
+
MinDigits: 7
|
111
|
+
|
112
|
+
# 正規表現にマッチさせた時の特殊変数の置き換えは Regex.last_match ではなく
|
113
|
+
# 名前付きキャプチャを使って参照したいので auto-correct しない
|
114
|
+
Style/PerlBackrefs:
|
115
|
+
AutoCorrect: false
|
116
|
+
|
117
|
+
# has_ から始まるメソッドは許可する
|
118
|
+
Style/PredicateName:
|
119
|
+
NamePrefixBlacklist:
|
120
|
+
- "is_"
|
121
|
+
- "have_"
|
122
|
+
NamePrefix:
|
123
|
+
- "is_"
|
124
|
+
- "have_"
|
125
|
+
|
126
|
+
# 特に model 内において、ローカル変数とメソッド呼び出しの区別をつけた方が分かりやすい場合が多い
|
127
|
+
Style/RedundantSelf:
|
128
|
+
Enabled: false
|
129
|
+
|
130
|
+
# 受け取り側で multiple assignment しろというのを明示
|
131
|
+
Style/RedundantReturn:
|
132
|
+
AllowMultipleReturnValues: true
|
133
|
+
|
134
|
+
# spec 内は見た目が綺麗になるので許可
|
135
|
+
Style/Semicolon:
|
136
|
+
Exclude:
|
137
|
+
- "spec/**/*"
|
138
|
+
|
139
|
+
# fail と使い分ける必要ナシ
|
140
|
+
Style/SignalException:
|
141
|
+
EnforcedStyle: only_raise
|
142
|
+
|
143
|
+
# `||` も align に使うことがあるので追加する
|
144
|
+
Style/SpaceAroundOperators:
|
145
|
+
MultiSpaceAllowedForOperators:
|
146
|
+
- "="
|
147
|
+
- "=>"
|
148
|
+
- "||"
|
149
|
+
|
150
|
+
# * 式展開したい場合に書き換えるのが面倒
|
151
|
+
# * 文章ではダブルクォートよりもシングルクォートの方が頻出する
|
152
|
+
# ことから EnforcedStyle: double_quotes 推奨
|
153
|
+
Style/StringLiterals:
|
154
|
+
EnforcedStyle: double_quotes
|
155
|
+
|
156
|
+
# auto-correct 時に Style/StringLiterals とカニバって無限ループになる (v0.28.0)
|
157
|
+
Style/StringLiteralsInInterpolation:
|
158
|
+
Enabled: false
|
159
|
+
|
160
|
+
# いくらなんでも inject { |a, e| } は短すぎるので分かりやすい名前をつけたい
|
161
|
+
Style/SingleLineBlockParams:
|
162
|
+
Enabled: false
|
163
|
+
|
164
|
+
# * migrate
|
165
|
+
# * jbuilder
|
166
|
+
# * model の association
|
167
|
+
# * controller の callback
|
168
|
+
# 辺りの桁揃えで引っかかるので全体的にチェックしない
|
169
|
+
Style/SingleSpaceBeforeFirstArg:
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
# 複数行の場合はケツカンマを入れる
|
173
|
+
Style/TrailingComma:
|
174
|
+
EnforcedStyleForMultiline: comma
|
175
|
+
|
176
|
+
##################### Lint ##################################
|
177
|
+
|
178
|
+
# * 同名のメソッドがある場合にローカル変数に `_` を付ける
|
179
|
+
# * 一時変数として `_` を付ける
|
180
|
+
# というテクニックは頻出する
|
181
|
+
Lint/UnderscorePrefixedVariableName:
|
182
|
+
Enabled: false
|
183
|
+
|
184
|
+
# 子クラスで実装させるつもりのメソッドで引っかかるので
|
185
|
+
Lint/UnusedMethodArgument:
|
186
|
+
Enabled: false
|
187
|
+
|
188
|
+
##################### Metrics ##################################
|
189
|
+
|
190
|
+
# 30 まではギリギリ許せる範囲だった
|
191
|
+
Metrics/AbcSize:
|
192
|
+
Max: 30
|
193
|
+
|
194
|
+
# 6 は強すぎるので緩める
|
195
|
+
Metrics/CyclomaticComplexity:
|
196
|
+
Max: 10
|
197
|
+
|
198
|
+
# * 警告 120文字
|
199
|
+
# * 禁止 160文字
|
200
|
+
# のイメージ
|
201
|
+
Metrics/LineLength:
|
202
|
+
Max: 160
|
203
|
+
Exclude:
|
204
|
+
- "db/migrate/*.rb"
|
205
|
+
|
206
|
+
# 20 行超えるのは migration ファイル以外滅多に無い
|
207
|
+
Metrics/MethodLength:
|
208
|
+
Max: 20
|
209
|
+
Exclude:
|
210
|
+
- "db/migrate/*.rb"
|
211
|
+
|
212
|
+
# 分岐の数。ガード句を多用しているとデフォルト 7 だと厳しい
|
213
|
+
Metrics/PerceivedComplexity:
|
214
|
+
Max: 8
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.
|
2
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.2...master)
|
3
|
+
|
4
|
+
## v0.3.2
|
5
|
+
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.1...v0.3.2)
|
6
|
+
|
7
|
+
* Add ended_date of "Go! Princess Precure"
|
8
|
+
* https://github.com/sue445/rubicure/pull/96
|
9
|
+
* Use unparser < 0.2.5 when ruby 2.0
|
10
|
+
* https://github.com/sue445/rubicure/pull/97
|
3
11
|
|
4
12
|
## v0.3.1
|
5
13
|
[full changelog](http://github.com/sue445/rubicure/compare/v0.3.0...v0.3.1)
|
data/config/series.yml
CHANGED
data/lib/rubicure.rb
CHANGED
data/lib/rubicure/core.rb
CHANGED
data/lib/rubicure/cure.rb
CHANGED
@@ -30,23 +30,24 @@ EOF
|
|
30
30
|
target.instance_variable_set(:@__original_human_name, original_human_name)
|
31
31
|
target.instance_variable_set(:@__another_human_name, another_human_name)
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
@another_human_name ||= @__another_human_name
|
33
|
+
def target.!
|
34
|
+
humanize!
|
35
|
+
@another_human_name ||= @__another_human_name
|
37
36
|
|
38
|
-
|
39
|
-
|
37
|
+
# setup @state_names
|
38
|
+
state_names
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
# rubocop:disable Style/ParallelAssignment
|
41
|
+
@state_names[0], @another_human_name = @another_human_name, @state_names[0]
|
42
|
+
# rubocop:enable Style/ParallelAssignment
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
self
|
45
|
+
end
|
46
|
+
|
47
|
+
def target.rollback
|
48
|
+
@state_names[0] = @__original_human_name
|
49
|
+
@another_human_name = @__another_human_name
|
50
|
+
self
|
50
51
|
end
|
51
52
|
end
|
52
53
|
|
data/lib/rubicure/girl.rb
CHANGED
@@ -35,7 +35,7 @@ module Rubicure
|
|
35
35
|
# @return [Rubicure::Girl] self
|
36
36
|
def transform!
|
37
37
|
state = inc_current_state
|
38
|
-
print_by_line transform_message
|
38
|
+
print_by_line transform_message if state == 1
|
39
39
|
|
40
40
|
self
|
41
41
|
end
|
@@ -48,7 +48,7 @@ module Rubicure
|
|
48
48
|
deprecate humanize: "Use #humanize! instead of #humanize"
|
49
49
|
|
50
50
|
def attack!
|
51
|
-
raise "require transform" if current_attack_message.blank?
|
51
|
+
raise RequireTransformError, "require transform" if current_attack_message.blank?
|
52
52
|
|
53
53
|
print_by_line current_attack_message
|
54
54
|
|
@@ -66,7 +66,7 @@ module Rubicure
|
|
66
66
|
birthday_date == date
|
67
67
|
end
|
68
68
|
|
69
|
-
def have_birthday?
|
69
|
+
def have_birthday? # rubocop:disable Style/PredicateName
|
70
70
|
respond_to?(:birthday)
|
71
71
|
end
|
72
72
|
alias_method :has_birthday?, :have_birthday?
|
@@ -143,36 +143,36 @@ module Rubicure
|
|
143
143
|
|
144
144
|
private
|
145
145
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
146
|
+
def inc_current_state
|
147
|
+
@current_state = current_state + 1
|
148
|
+
@current_state = 0 unless @current_state < state_names.length
|
149
|
+
@current_state
|
150
|
+
end
|
151
151
|
|
152
|
-
|
153
|
-
|
154
|
-
|
152
|
+
def current_attack_message
|
153
|
+
attack_messages[current_state - 1] if current_state > 0
|
154
|
+
end
|
155
155
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
156
|
+
def print_by_line(message)
|
157
|
+
index = 0
|
158
|
+
message.each_line do |line|
|
159
|
+
sleep(self.class.sleep_sec) if index > 0
|
160
|
+
@io.puts line
|
161
|
+
index += 1
|
162
|
+
end
|
162
163
|
end
|
163
|
-
end
|
164
164
|
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
def method_missing(method_name, *args)
|
166
|
+
# call Hashie::Extensions::MethodAccess#method_missing
|
167
|
+
return super if has_key?(method_name)
|
168
168
|
|
169
|
-
|
170
|
-
|
171
|
-
|
169
|
+
shortened_name = method_name.to_s.
|
170
|
+
sub(/\Aprecure_|_precure\z/, "").
|
171
|
+
sub(/!\z/, "")
|
172
172
|
|
173
|
-
|
173
|
+
return transform!(*args) if transform_calls.include?(shortened_name)
|
174
174
|
|
175
|
-
|
176
|
-
|
175
|
+
super
|
176
|
+
end
|
177
177
|
end
|
178
178
|
end
|
data/lib/rubicure/movie.rb
CHANGED
@@ -45,7 +45,7 @@ module Rubicure
|
|
45
45
|
# @return [Rubicure::Movie]
|
46
46
|
# @raise arg is invalid
|
47
47
|
def find(movie_name)
|
48
|
-
raise "unknown movie: #{movie_name}" unless valid?(movie_name)
|
48
|
+
raise UnknownMovieError, "unknown movie: #{movie_name}" unless valid?(movie_name)
|
49
49
|
|
50
50
|
@cache ||= {}
|
51
51
|
unless @cache[movie_name]
|
data/lib/rubicure/series.rb
CHANGED
@@ -105,7 +105,7 @@ module Rubicure
|
|
105
105
|
# @return [Rubicure::Series]
|
106
106
|
# @raise arg is not precure
|
107
107
|
def find(series_name)
|
108
|
-
raise "unknown series: #{series_name}" unless valid?(series_name)
|
108
|
+
raise UnknownSeriesError, "unknown series: #{series_name}" unless valid?(series_name)
|
109
109
|
|
110
110
|
@cache ||= {}
|
111
111
|
unless @cache[series_name]
|
data/lib/rubicure/version.rb
CHANGED
data/rubicure.gemspec
CHANGED
@@ -28,12 +28,16 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "codeclimate-test-reporter"
|
29
29
|
spec.add_development_dependency "coveralls"
|
30
30
|
spec.add_development_dependency "delorean"
|
31
|
-
spec.add_development_dependency "parser", ">= 2.2.0.1"
|
32
31
|
spec.add_development_dependency "rake"
|
33
|
-
spec.add_development_dependency "rspec"
|
34
|
-
spec.add_development_dependency "rspec-collection_matchers"
|
35
|
-
spec.add_development_dependency "rspec-its"
|
36
|
-
spec.add_development_dependency "rspec-parameterized"
|
37
|
-
spec.add_development_dependency "rubocop", "
|
32
|
+
spec.add_development_dependency "rspec"
|
33
|
+
spec.add_development_dependency "rspec-collection_matchers"
|
34
|
+
spec.add_development_dependency "rspec-its"
|
35
|
+
spec.add_development_dependency "rspec-parameterized"
|
36
|
+
spec.add_development_dependency "rubocop", "0.35.1"
|
38
37
|
spec.add_development_dependency "yard"
|
38
|
+
|
39
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.1.0")
|
40
|
+
# NOTE: unparser v0.2.5 drop support ruby < 2.1
|
41
|
+
spec.add_development_dependency "unparser", "< 0.2.5"
|
42
|
+
end
|
39
43
|
end
|
data/spec/core_spec.rb
CHANGED
data/spec/cure_spec.rb
CHANGED
@@ -84,4 +84,37 @@ describe "Cure" do
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
|
+
|
88
|
+
describe ".scarlet" do
|
89
|
+
describe "!" do
|
90
|
+
subject { !Cure.scarlet }
|
91
|
+
|
92
|
+
let(:girl) { Cure.scarlet }
|
93
|
+
|
94
|
+
after do
|
95
|
+
girl.rollback
|
96
|
+
girl.humanize!
|
97
|
+
end
|
98
|
+
|
99
|
+
context "called once" do
|
100
|
+
it { expect { subject }.to change { girl.name }.from("紅城トワ").to("トワイライト") }
|
101
|
+
end
|
102
|
+
|
103
|
+
context "called twice" do
|
104
|
+
before do
|
105
|
+
!Cure.scarlet
|
106
|
+
end
|
107
|
+
|
108
|
+
it { expect { subject }.to change { girl.name }.from("トワイライト").to("紅城トワ") }
|
109
|
+
end
|
110
|
+
|
111
|
+
context "after transform" do
|
112
|
+
before do
|
113
|
+
girl.transform!
|
114
|
+
end
|
115
|
+
|
116
|
+
it { expect { subject }.to change { girl.name }.from("キュアスカーレット").to("トワイライト") }
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
87
120
|
end
|
data/spec/girl_spec.rb
CHANGED
data/spec/movie_spec.rb
CHANGED
@@ -34,9 +34,9 @@ describe Rubicure::Movie do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
context "when not exists" do
|
37
|
-
let(:movie_name) { :ashita_no_nadja
|
37
|
+
let(:movie_name) { :ashita_no_nadja }
|
38
38
|
|
39
|
-
it { expect { subject }.to raise_error }
|
39
|
+
it { expect { subject }.to raise_error Rubicure::UnknownMovieError }
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/spec/series_spec.rb
CHANGED
@@ -120,16 +120,16 @@ describe Rubicure::Series do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
context "when not exists" do
|
123
|
-
let(:series_name) { :ashita_no_nadja
|
123
|
+
let(:series_name) { :ashita_no_nadja }
|
124
124
|
|
125
|
-
it { expect { subject }.to raise_error }
|
125
|
+
it { expect { subject }.to raise_error Rubicure::UnknownSeriesError }
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
129
|
describe "#each_with_girls" do
|
130
130
|
subject { series.each_with_girls }
|
131
131
|
|
132
|
-
let(:series)
|
132
|
+
let(:series) { Rubicure::Series.find(series_name) }
|
133
133
|
let(:series_name) { :splash_star }
|
134
134
|
|
135
135
|
it { expect { |b| series.each_with_girls(&b) }.to yield_successive_args(Rubicure::Girl, Rubicure::Girl) }
|
@@ -141,11 +141,13 @@ describe Rubicure::Series do
|
|
141
141
|
let(:series) { Rubicure::Series.find(series_name) }
|
142
142
|
let(:series_name) { :splash_star }
|
143
143
|
|
144
|
+
# rubocop:disable Metrics/LineLength
|
144
145
|
let(:json) do
|
145
146
|
<<-JSON
|
146
147
|
{\"series_name\":\"splash_star\",\"title\":\"ふたりはプリキュア Splash☆Star\",\"started_date\":\"2006-02-05\",\"ended_date\":\"2007-01-28\",\"girls\":[\"cure_bloom\",\"cure_egret\"]}
|
147
148
|
JSON
|
148
149
|
end
|
150
|
+
# rubocop:enable Metrics/LineLength
|
149
151
|
|
150
152
|
it { should eq json.squish }
|
151
153
|
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: parser
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 2.2.0.1
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 2.2.0.1
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: rake
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,72 +126,72 @@ dependencies:
|
|
140
126
|
name: rspec
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
|
-
- - "
|
129
|
+
- - ">="
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
131
|
+
version: '0'
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
|
-
- - "
|
136
|
+
- - ">="
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
138
|
+
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: rspec-collection_matchers
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
156
142
|
requirements:
|
157
|
-
- - "
|
143
|
+
- - ">="
|
158
144
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
145
|
+
version: '0'
|
160
146
|
type: :development
|
161
147
|
prerelease: false
|
162
148
|
version_requirements: !ruby/object:Gem::Requirement
|
163
149
|
requirements:
|
164
|
-
- - "
|
150
|
+
- - ">="
|
165
151
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
152
|
+
version: '0'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: rspec-its
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
|
-
- - "
|
157
|
+
- - ">="
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
159
|
+
version: '0'
|
174
160
|
type: :development
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
|
-
- - "
|
164
|
+
- - ">="
|
179
165
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
166
|
+
version: '0'
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
168
|
name: rspec-parameterized
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
184
170
|
requirements:
|
185
|
-
- - "
|
171
|
+
- - ">="
|
186
172
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0
|
173
|
+
version: '0'
|
188
174
|
type: :development
|
189
175
|
prerelease: false
|
190
176
|
version_requirements: !ruby/object:Gem::Requirement
|
191
177
|
requirements:
|
192
|
-
- - "
|
178
|
+
- - ">="
|
193
179
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0
|
180
|
+
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: rubocop
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
|
-
- -
|
185
|
+
- - '='
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
187
|
+
version: 0.35.1
|
202
188
|
type: :development
|
203
189
|
prerelease: false
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
205
191
|
requirements:
|
206
|
-
- -
|
192
|
+
- - '='
|
207
193
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
194
|
+
version: 0.35.1
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
196
|
name: yard
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -230,6 +216,7 @@ files:
|
|
230
216
|
- ".coveralls.yml"
|
231
217
|
- ".gitignore"
|
232
218
|
- ".hound.yml"
|
219
|
+
- ".onkcop.yml"
|
233
220
|
- ".rspec"
|
234
221
|
- ".rubocop.yml"
|
235
222
|
- ".tachikoma.yml"
|
@@ -258,6 +245,7 @@ files:
|
|
258
245
|
- lib/rubicure/concerns/util.rb
|
259
246
|
- lib/rubicure/core.rb
|
260
247
|
- lib/rubicure/cure.rb
|
248
|
+
- lib/rubicure/errors.rb
|
261
249
|
- lib/rubicure/girl.rb
|
262
250
|
- lib/rubicure/movie.rb
|
263
251
|
- lib/rubicure/series.rb
|
@@ -292,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
280
|
version: '0'
|
293
281
|
requirements: []
|
294
282
|
rubyforge_project:
|
295
|
-
rubygems_version: 2.
|
283
|
+
rubygems_version: 2.5.1
|
296
284
|
signing_key:
|
297
285
|
specification_version: 4
|
298
286
|
summary: All about Japanese battle heroine "Pretty Cure (Precure)".
|