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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e19c801fa8d90b3d311ee5276e4bbd51238dfbf
4
- data.tar.gz: ac184b19894c2ca8e1de34319e33cf2483cded2d
3
+ metadata.gz: d47c971913dc65b8a0e60d8eae6b75efed8b0b30
4
+ data.tar.gz: ca2bd010be4b715ed3fd24e444f174596739e2cd
5
5
  SHA512:
6
- metadata.gz: 47843ebb2efd89174bc995fab71b04cac0eb8592321f35426523367b92277301b008730312c3949b3d516c95fd758d2f3a7cebd61e4cf152d12ca7048c4b4a0d
7
- data.tar.gz: 9d5b45aa6b3ee512fe60968263c2dad02b1eb8f30685009dfe2f3be9dcd7978d7b5834fcd1e353917a8eab3c2e3f52a1f3a62d89aa868d89d421e192188e7c23
6
+ metadata.gz: ed7d60d488ce7c81e761d2370679b0ed6a48d4c138e37db56baec55c6baa35a94dcbc0c3bf42deba01e80cdc4d7c914a5d063cd1ec40484754720390a0932ebe
7
+ data.tar.gz: a39190b596c850e949ddca06c4bcdf5d121158ff09c2d433527f9f2d7cf050b151226898c485e361b1ccc275691e35004fb1b11cb6b5cc1c8d77b199e0a13d19
data/.hound.yml CHANGED
@@ -1,127 +1,3 @@
1
- # target_version:
2
- # rubocop v0.30.0
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
@@ -1,2 +1,4 @@
1
- inherit_from:
2
- - .hound.yml
1
+ inherit_from: ".onkcop.yml"
2
+
3
+ Metrics/ClassLength:
4
+ Max: 120
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ rvm:
3
3
  - 2.0
4
4
  - 2.1
5
5
  - 2.2
6
- - 2.3
6
+ - 2.3.0
7
7
  - ruby-head
8
8
  bundler_args: "--jobs=2"
9
9
  cache: bundler
@@ -23,5 +23,4 @@ notifications:
23
23
  matrix:
24
24
  allow_failures:
25
25
  - rvm: ruby-head
26
- - rvm: 2.3
27
26
  sudo: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v0.3.1...master)
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
@@ -150,7 +150,7 @@ go_princess: &go_princess
150
150
  series_name: go_princess
151
151
  title: Go!プリンセスプリキュア
152
152
  started_date: 2015-02-01
153
- # ended_date: 2016-01-
153
+ ended_date: 2016-01-31
154
154
  girls:
155
155
  - cure_flora
156
156
  - cure_mermaid
data/lib/rubicure.rb CHANGED
@@ -8,6 +8,7 @@ require "rubicure/girl"
8
8
  require "rubicure/core"
9
9
  require "rubicure/movie"
10
10
  require "rubicure/cure"
11
+ require "rubicure/errors"
11
12
 
12
13
  module Rubicure
13
14
  def self.core
data/lib/rubicure/core.rb CHANGED
@@ -26,7 +26,7 @@ module Rubicure
26
26
  each_with_series do |series|
27
27
  return series if series.on_air?(current_time)
28
28
  end
29
- raise "Not on air precure!"
29
+ raise NotOnAirError, "Not on air precure!"
30
30
  end
31
31
 
32
32
  alias_method :current, :now
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
- class << target
34
- def !
35
- humanize!
36
- @another_human_name ||= @__another_human_name
33
+ def target.!
34
+ humanize!
35
+ @another_human_name ||= @__another_human_name
37
36
 
38
- # setup @state_names
39
- state_names
37
+ # setup @state_names
38
+ state_names
40
39
 
41
- @state_names[0], @another_human_name = @another_human_name, @state_names[0]
42
- self
43
- end
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
- def rollback
46
- @state_names[0] = @__original_human_name
47
- @another_human_name = @__another_human_name
48
- self
49
- end
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
 
@@ -0,0 +1,9 @@
1
+ module Rubicure
2
+ class NotOnAirError < StandardError; end
3
+
4
+ class RequireTransformError < StandardError; end
5
+
6
+ class UnknownMovieError < StandardError; end
7
+
8
+ class UnknownSeriesError < StandardError; end
9
+ end
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 if state == 1
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
- 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
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
- def current_attack_message
153
- attack_messages[@current_state - 1]
154
- end
152
+ def current_attack_message
153
+ attack_messages[current_state - 1] if current_state > 0
154
+ end
155
155
 
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
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
- def method_missing(method_name, *args)
166
- # call Hashie::Extensions::MethodAccess#method_missing
167
- return super if has_key?(method_name)
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
- shortened_name = method_name.to_s.
170
- sub(/\Aprecure_|_precure\z/, "").
171
- sub(/!\z/, "")
169
+ shortened_name = method_name.to_s.
170
+ sub(/\Aprecure_|_precure\z/, "").
171
+ sub(/!\z/, "")
172
172
 
173
- return transform!(*args) if transform_calls.include?(shortened_name)
173
+ return transform!(*args) if transform_calls.include?(shortened_name)
174
174
 
175
- super
176
- end
175
+ super
176
+ end
177
177
  end
178
178
  end
@@ -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]
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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", "~> 3.0.0"
34
- spec.add_development_dependency "rspec-collection_matchers", "~> 1.0.0"
35
- spec.add_development_dependency "rspec-its", "~> 1.0.1"
36
- spec.add_development_dependency "rspec-parameterized", "~> 0.1.2"
37
- spec.add_development_dependency "rubocop", "~> 0.30.0"
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
@@ -17,7 +17,7 @@ describe Rubicure::Core do
17
17
  time_travel_to "2013-02-01"
18
18
  end
19
19
 
20
- it { expect { subject }.to raise_error }
20
+ it { expect { subject }.to raise_error Rubicure::NotOnAirError }
21
21
  end
22
22
  end
23
23
 
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
@@ -134,7 +134,7 @@ EOF
134
134
  subject { girl.attack! }
135
135
 
136
136
  context "When human" do
137
- it { expect { subject }.to raise_error }
137
+ it { expect { subject }.to raise_error Rubicure::RequireTransformError }
138
138
  end
139
139
 
140
140
  context "When precure" do
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) { Rubicure::Series.find(series_name) }
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.1
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: 2015-12-07 00:00:00.000000000 Z
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: 3.0.0
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: 3.0.0
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: 1.0.0
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: 1.0.0
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: 1.0.1
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: 1.0.1
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.1.2
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.1.2
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.30.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.30.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.4.5
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)".