rubicure 0.2.4 → 0.2.5

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: d38c61db3035bced7576e2a703812081e47a3116
4
- data.tar.gz: 40e371fd5fef7eac80b98d575754f93fbc3d5346
3
+ metadata.gz: 6c80e77cad5c6641ce8388a541660de5711750f6
4
+ data.tar.gz: 3170324d8e5caaea97a16fc5a1bcde2e1fbde261
5
5
  SHA512:
6
- metadata.gz: 0ca461c75d1a26bbf13963c9c52bf3a28b43d14cb3b4780b77fbd12b77a616a0bb45a66c79248c8e0cb47d7908bcb0878e5d2407969a6c99fc0c9a5c5f23677d
7
- data.tar.gz: f18b74fcd7eafb469db638ab3c5261102c5d47f1463f5e576b8fb79162b4133dc2fc4599a323d4a1948ebe3f7e8a7624ed49a9eb72cdb31b447814de5564706c
6
+ metadata.gz: 85f590162caacf2ae584444fc3539f6ef9d882a0aa81e9c0787cb363af442e33a57817e86a70e9a39196be6f3346c0b186d4b849793be5c73a487ff74ea81050
7
+ data.tar.gz: d6c07c54fd2566fe7bc29fd647f5523d4dd0c670b9000de7318c81f53b5b76f4812620419b7193b50ac1b7f90bbf5ce50a7dac0e55e52be748cd9d3e9627855a
data/.hound.yml CHANGED
@@ -1,25 +1,127 @@
1
- Style/LineLength:
2
- Description: 'Limit lines to 130 characters.'
3
- Max: 130
4
- Style/SpaceInsideParens:
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:
5
17
  Enabled: false
6
- Style/SpaceBeforeBlockBraces:
18
+
19
+ Style/BlockDelimiters:
7
20
  Enabled: false
8
- StringLiterals:
21
+
22
+ Style/BracesAroundHashParameters:
9
23
  Enabled: false
10
- Style/TrailingComma:
24
+
25
+ Style/DeprecatedHashMethods:
26
+ Enabled: false
27
+
28
+ Style/Documentation:
11
29
  Enabled: false
12
- Style/BlockComments:
30
+
31
+ Style/DoubleNegation:
13
32
  Enabled: false
14
- Style/NilComparison:
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:
15
53
  Enabled: false
16
- Style/Documentation:
54
+
55
+ Style/IndentHash:
56
+ EnforcedStyle: consistent
57
+
58
+ Style/Lambda:
17
59
  Enabled: false
18
- Style/RegexpLiteral:
60
+
61
+ Style/NumericLiterals:
62
+ MinDigits: 6
63
+
64
+ Style/PredicateName:
19
65
  Enabled: false
66
+
67
+ Style/RedundantSelf:
68
+ Enabled: false
69
+
70
+ Style/RedundantReturn:
71
+ AllowMultipleReturnValues: true
72
+
20
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:
21
89
  Enabled: false
22
- Style/CaseEquality:
90
+
91
+ Style/SingleSpaceBeforeFirstArg:
92
+ Enabled: false
93
+
94
+ Style/TrailingComma:
95
+ EnforcedStyleForMultiline: comma
96
+
97
+ ##################### Lint ##################################
98
+
99
+ Lint/UnderscorePrefixedVariableName:
23
100
  Enabled: false
24
- Style/SpaceBeforeComma:
101
+
102
+ Lint/UnusedMethodArgument:
25
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
data/.rubocop.yml CHANGED
@@ -1,23 +1,2 @@
1
- Style/LineLength:
2
- Description: 'Limit lines to 130 characters.'
3
- Max: 130
4
- Style/SpaceInsideParens:
5
- Enabled: false
6
- Style/SpaceBeforeBlockBraces:
7
- Enabled: false
8
- StringLiterals:
9
- Enabled: false
10
- Style/TrailingComma:
11
- Enabled: false
12
- Style/BlockComments:
13
- Enabled: false
14
- Style/NilComparison:
15
- Enabled: false
16
- Style/Documentation:
17
- Enabled: false
18
- Style/RegexpLiteral:
19
- Enabled: false
20
- Style/SignalException:
21
- Enabled: false
22
- Style/CaseEquality:
23
- Enabled: false
1
+ inherit_from:
2
+ - .hound.yml
data/.tachikoma.yml ADDED
@@ -0,0 +1 @@
1
+ strategy: 'bundler'
data/.travis.yml CHANGED
@@ -5,6 +5,7 @@ rvm:
5
5
  - 2.2
6
6
  - ruby-head
7
7
  bundler_args: "--jobs=2"
8
+ cache: bundler
8
9
  before_script:
9
10
  - export CODECLIMATE_REPO_TOKEN=8e9db6ee5f3818e87287a6393086c2ccb9b1b83106c5bfb972211abefd2fe162
10
11
  - export COVERAGE=true
data/CHANGELOG.md CHANGED
@@ -1,13 +1,19 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v0.2.4...master)
2
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.2.5...master)
3
3
 
4
- ## v0.2.3
4
+ ## v0.2.5
5
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.2.4...v0.2.5)
6
+
7
+ * Fix typo
8
+ * https://github.com/sue445/rubicure/pull/78
9
+
10
+ ## v0.2.4
5
11
  [full changelog](http://github.com/sue445/rubicure/compare/v0.2.3...v0.2.4)
6
12
 
7
13
  * Tweak transform message
8
14
  * https://github.com/sue445/rubicure/pull/76
9
15
 
10
- ## v0.2.2
16
+ ## v0.2.3
11
17
  [full changelog](http://github.com/sue445/rubicure/compare/v0.2.2.1...v0.2.3)
12
18
 
13
19
  * Add Go! Princess Precure
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in rubicure.gemspec
4
4
  gemspec
data/Rakefile CHANGED
@@ -5,7 +5,6 @@ RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
7
 
8
- require 'yard'
8
+ require "yard"
9
9
 
10
10
  YARD::Rake::YardocTask.new
11
-
@@ -36,7 +36,7 @@ cure_mermaid: &cure_mermaid
36
36
  attack_messages:
37
37
  - |
38
38
  エクスチェンジ!モードエレガント!
39
- 高鳴れ、海よ!プリンセス・マーメイド・リップル!
39
+ 高鳴れ、海よ!プリキュア・マーメイド・リップル!
40
40
  (ドリーミング)
41
41
  ごきげんよう
42
42
  transform_calls:
@@ -58,7 +58,7 @@ cure_twinkle: &cure_twinkle
58
58
  attack_messages:
59
59
  - |
60
60
  エクスチェンジ!モードエレガント!
61
- キラキラ、星よ!プリンセス・トゥインクル・ハミング!
61
+ キラキラ、星よ!プリキュア・トゥインクル・ハミング!
62
62
  (ドリーミング)
63
63
  ごきげんよう
64
64
  transform_calls:
data/lib/rubicure.rb CHANGED
@@ -1,6 +1,6 @@
1
- require 'active_support/all'
2
- require 'yaml'
3
- require 'hashie'
1
+ require "active_support/all"
2
+ require "yaml"
3
+ require "hashie"
4
4
  require "rubicure/version"
5
5
  require "rubicure/concerns/util"
6
6
  require "rubicure/series"
data/lib/rubicure/core.rb CHANGED
@@ -40,7 +40,7 @@ module Rubicure
40
40
  @all_stars << Rubicure::Girl.find(girl_name)
41
41
  end
42
42
 
43
- @all_stars.uniq! { |girl| girl.human_name }
43
+ @all_stars.uniq!(&:human_name)
44
44
  end
45
45
 
46
46
  begin
data/lib/rubicure/cure.rb CHANGED
@@ -10,10 +10,10 @@ module Cure
10
10
  [Cure.peace, Cure.cure_peace].each do |peace|
11
11
  class << peace
12
12
  HANDS =
13
- (['グー'] * 13) +
14
- (['チョキ'] * 14) +
15
- (['パー'] * 15) +
16
- ['グッチョッパー']
13
+ (["グー"] * 13) +
14
+ (["チョキ"] * 14) +
15
+ (["パー"] * 15) +
16
+ ["グッチョッパー"]
17
17
  MESSAGE = <<EOF
18
18
  ピカピカピカリン
19
19
  ジャンケンポン!
@@ -22,7 +22,7 @@ EOF
22
22
  def pikarin_janken
23
23
  print_by_line(MESSAGE % HANDS.sample)
24
24
  end
25
- alias janken pikarin_janken
25
+ alias_method :janken, :pikarin_janken
26
26
  end
27
27
  end
28
28
 
data/lib/rubicure/girl.rb CHANGED
@@ -9,14 +9,8 @@ module Rubicure
9
9
 
10
10
  attr_writer :io
11
11
 
12
- @@cache = {}
13
- @@config = nil
14
- @@colors = nil
15
- @@sleep_sec = 1
16
-
17
12
  def current_state
18
13
  @current_state ||= 0
19
- @current_state
20
14
  end
21
15
 
22
16
  def state_names
@@ -35,7 +29,7 @@ module Rubicure
35
29
  def name
36
30
  state_names[current_state]
37
31
  end
38
- alias to_s name
32
+ alias_method :to_s, :name
39
33
 
40
34
  # human -> precure ( -> extra forms ) -> human ...
41
35
  # @return [Rubicure::Girl] self
@@ -50,7 +44,7 @@ module Rubicure
50
44
  @current_state = 0
51
45
  self
52
46
  end
53
- alias :humanize :humanize!
47
+ alias_method :humanize, :humanize!
54
48
  deprecate humanize: "Use #humanize! instead of #humanize"
55
49
 
56
50
  def attack!
@@ -61,63 +55,68 @@ module Rubicure
61
55
  current_attack_message
62
56
  end
63
57
 
64
- # @param girl_name [Symbol]
65
- # @return [Rubicure::Girl]
66
- def self.find(girl_name)
67
- raise "unknown girl: #{girl_name}" unless valid?(girl_name)
58
+ class << self
59
+ attr_writer :sleep_sec
68
60
 
69
- unless @@cache[girl_name]
70
- girl_config = config[girl_name] || {}
71
- @@cache[girl_name] = Rubicure::Girl[girl_config].tap{ |girl| girl.io = $stdout }
72
- end
61
+ # @param girl_name [Symbol]
62
+ # @return [Rubicure::Girl]
63
+ def find(girl_name)
64
+ raise "unknown girl: #{girl_name}" unless valid?(girl_name)
73
65
 
74
- @@cache[girl_name]
75
- end
66
+ @cache ||= {}
67
+ unless @cache[girl_name]
68
+ girl_config = config[girl_name] || {}
69
+ @cache[girl_name] = Rubicure::Girl[girl_config].tap { |girl| girl.io = $stdout }
70
+ end
76
71
 
77
- # @return [Array<Symbol>]
78
- def self.names
79
- config.keys
80
- end
72
+ @cache[girl_name]
73
+ end
81
74
 
82
- # @return [Array<Symbol>]
83
- def self.uniq_names
84
- config.each_with_object([]) do |(name, girl), uniq_names|
85
- uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:precure_name] == girl[:precure_name] }
75
+ # @return [Array<Symbol>]
76
+ def names
77
+ config.keys
86
78
  end
87
- end
88
79
 
89
- # @return [Hash] content of config/girls/*.yml
90
- def self.config
91
- unless @@config
92
- @@config = SengiriYaml.load_dir("#{File.dirname(__FILE__)}/../../config/girls").deep_symbolize_keys
80
+ # @return [Array<Symbol>]
81
+ def uniq_names
82
+ config.each_with_object([]) do |(name, girl), uniq_names|
83
+ uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:precure_name] == girl[:precure_name] }
84
+ end
93
85
  end
94
- @@config
95
- end
96
86
 
97
- # @return [Hash] content of config/precure.yml
98
- def self.reload_config!
99
- @@cache = {}
100
- @@config = nil
101
- @@colors = nil
102
- config
103
- end
87
+ # @return [Hash] content of config/girls/*.yml
88
+ def config
89
+ unless @config
90
+ @config = SengiriYaml.load_dir("#{File.dirname(__FILE__)}/../../config/girls").deep_symbolize_keys
91
+ end
92
+ @config
93
+ end
104
94
 
105
- # @param [Symbol] girl_name
106
- def self.valid?(girl_name)
107
- names.include?(girl_name)
108
- end
95
+ # @return [Hash] content of config/precure.yml
96
+ def reload_config!
97
+ @cache = {}
98
+ @config = nil
99
+ @colors = nil
100
+ config
101
+ end
109
102
 
110
- def self.sleep_sec=(sleep_sec)
111
- @@sleep_sec = sleep_sec
112
- end
103
+ # @param [Symbol] girl_name
104
+ def valid?(girl_name)
105
+ names.include?(girl_name)
106
+ end
107
+
108
+ def sleep_sec
109
+ @sleep_sec ||= 1
110
+ end
113
111
 
114
- # return defined colors
115
- # @return [Array<Symbol>]
116
- def self.colors
117
- unless @@colors
118
- @@colors = config.values.each_with_object([]) { |girl, colors| colors << girl[:color].to_sym }.uniq.sort
112
+ # return defined colors
113
+ # @return [Array<Symbol>]
114
+ def colors
115
+ unless @colors
116
+ @colors = config.values.each_with_object([]) { |girl, colors| colors << girl[:color].to_sym }.uniq.sort
117
+ end
118
+ @colors
119
119
  end
120
- @@colors
121
120
  end
122
121
 
123
122
  colors.each do |color|
@@ -141,7 +140,7 @@ module Rubicure
141
140
  def print_by_line(message)
142
141
  index = 0
143
142
  message.each_line do |line|
144
- sleep(@@sleep_sec) if index > 0
143
+ sleep(self.class.sleep_sec) if index > 0
145
144
  @io.puts line
146
145
  index += 1
147
146
  end
@@ -152,8 +151,8 @@ module Rubicure
152
151
  return super if has_key?(method_name)
153
152
 
154
153
  shortened_name = method_name.to_s.
155
- sub(%r/\Aprecure_|_precure\z/, "").
156
- sub(%r/!\z/, "")
154
+ sub(/\Aprecure_|_precure\z/, "").
155
+ sub(/!\z/, "")
157
156
 
158
157
  return transform!(*args) if transform_calls.include?(shortened_name)
159
158
 
@@ -5,58 +5,58 @@ module Rubicure
5
5
  class Movie < Hash
6
6
  include Hashie::Extensions::MethodAccess
7
7
 
8
- @@cache = {}
9
- @@config = nil
8
+ class << self
9
+ # @return [Array<Symbol>]
10
+ def names
11
+ config.keys
12
+ end
10
13
 
11
- # @return [Array<Symbol>]
12
- def self.names
13
- config.keys
14
- end
14
+ # @return [Array<Symbol>]
15
+ def uniq_names
16
+ uniq_names = []
17
+ config.each do |name, series|
18
+ uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:title] == series[:title] }
19
+ end
20
+ uniq_names
21
+ end
15
22
 
16
- # @return [Array<Symbol>]
17
- def self.uniq_names
18
- uniq_names = []
19
- config.each do |name, series|
20
- uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:title] == series[:title] }
23
+ # @return [Hash] content of config/movies.yml
24
+ def config
25
+ unless @config
26
+ config_file = "#{File.dirname(__FILE__)}/../../config/movies.yml"
27
+ @config = YAML.load_file(config_file).deep_symbolize_keys
28
+ end
29
+ @config
21
30
  end
22
- uniq_names
23
- end
24
31
 
25
- # @return [Hash] content of config/movies.yml
26
- def self.config
27
- unless @@config
28
- config_file = "#{File.dirname(__FILE__)}/../../config/movies.yml"
29
- @@config = YAML.load_file(config_file).deep_symbolize_keys
32
+ # @return [Hash] content of config/movies.yml
33
+ def reload_config!
34
+ @cache = {}
35
+ @config = nil
36
+ config
30
37
  end
31
- @@config
32
- end
33
38
 
34
- # @return [Hash] content of config/movies.yml
35
- def self.reload_config!
36
- @@cache = {}
37
- @@config = nil
38
- config
39
- end
39
+ # @param [Symbol] series_name
40
+ def valid?(series_name)
41
+ names.include?(series_name)
42
+ end
40
43
 
41
- # @param [Symbol] series_name
42
- def self.valid?(series_name)
43
- names.include?(series_name)
44
- end
44
+ # @param movie_name [Symbol]
45
+ # @return [Rubicure::Movie]
46
+ # @raise arg is invalid
47
+ def find(movie_name)
48
+ raise "unknown movie: #{movie_name}" unless valid?(movie_name)
45
49
 
46
- # @param movie_name [Symbol]
47
- # @return [Rubicure::Movie]
48
- # @raise arg is invalid
49
- def self.find(movie_name)
50
- raise "unknown movie: #{movie_name}" unless valid?(movie_name)
50
+ @cache ||= {}
51
+ unless @cache[movie_name]
52
+ movie_config = config[movie_name] || {}
53
+ movie_config.reject! { |_k, v| v.nil? }
51
54
 
52
- unless @@cache[movie_name]
53
- movie_config = config[movie_name] || {}
54
- movie_config.reject! { |k, v| v.nil? }
55
+ @cache[movie_name] = Rubicure::Movie[movie_config]
56
+ end
55
57
 
56
- @@cache[movie_name] = Rubicure::Movie[movie_config]
58
+ @cache[movie_name]
57
59
  end
58
-
59
- @@cache[movie_name]
60
60
  end
61
61
  end
62
62
  end
@@ -6,8 +6,8 @@ module Rubicure
6
6
  include Rubicure::Concerns::Util
7
7
  include Enumerable
8
8
 
9
- @@cache = {}
10
- @@config = nil
9
+ @cache = {}
10
+ @config = nil
11
11
 
12
12
  # @param [Rubicure::Series,Rubicure::Girl] other
13
13
  # @return [Boolean] other is same Rubicure::Series or Rubicure::Series include Rubicure::Girl
@@ -28,7 +28,7 @@ module Rubicure
28
28
  if respond_to?(:started_date)
29
29
  if respond_to?(:ended_date)
30
30
  # ended title
31
- return (started_date .. ended_date).cover?(date)
31
+ return (started_date..ended_date).cover?(date)
32
32
  else
33
33
  # on air title
34
34
  return started_date <= date
@@ -55,57 +55,60 @@ module Rubicure
55
55
  def each_with_girls
56
56
  girls.each { |girl| yield girl }
57
57
  end
58
- alias :each :each_with_girls
58
+ alias_method :each, :each_with_girls
59
59
 
60
- # @return [Array<Symbol>]
61
- def self.names
62
- config.keys
63
- end
60
+ class << self
61
+ # @return [Array<Symbol>]
62
+ def names
63
+ config.keys
64
+ end
64
65
 
65
- # @return [Array<Symbol>]
66
- def self.uniq_names
67
- uniq_names = []
68
- config.each do |name, series|
69
- uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:title] == series[:title] }
66
+ # @return [Array<Symbol>]
67
+ def uniq_names
68
+ uniq_names = []
69
+ config.each do |name, series|
70
+ uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:title] == series[:title] }
71
+ end
72
+ uniq_names
70
73
  end
71
- uniq_names
72
- end
73
74
 
74
- # @return [Hash] content of config/series.yml
75
- def self.config
76
- unless @@config
77
- config_file = "#{File.dirname(__FILE__)}/../../config/series.yml"
78
- @@config = YAML.load_file(config_file).deep_symbolize_keys
75
+ # @return [Hash] content of config/series.yml
76
+ def config
77
+ unless @config
78
+ config_file = "#{File.dirname(__FILE__)}/../../config/series.yml"
79
+ @config = YAML.load_file(config_file).deep_symbolize_keys
80
+ end
81
+ @config
79
82
  end
80
- @@config
81
- end
82
83
 
83
- # @return [Hash] content of config/precure.yml
84
- def self.reload_config!
85
- @@cache = {}
86
- @@config = nil
87
- config
88
- end
84
+ # @return [Hash] content of config/precure.yml
85
+ def reload_config!
86
+ @cache = {}
87
+ @config = nil
88
+ config
89
+ end
89
90
 
90
- # @param [Symbol] series_name
91
- def self.valid?(series_name)
92
- names.include?(series_name)
93
- end
91
+ # @param [Symbol] series_name
92
+ def valid?(series_name)
93
+ names.include?(series_name)
94
+ end
94
95
 
95
- # @param series_name [Symbol]
96
- # @return [Rubicure::Series]
97
- # @raise arg is not precure
98
- def self.find(series_name)
99
- raise "unknown series: #{series_name}" unless valid?(series_name)
96
+ # @param series_name [Symbol]
97
+ # @return [Rubicure::Series]
98
+ # @raise arg is not precure
99
+ def find(series_name)
100
+ raise "unknown series: #{series_name}" unless valid?(series_name)
100
101
 
101
- unless @@cache[series_name]
102
- series_config = config[series_name] || {}
103
- series_config.reject! { |k, v| v.nil? }
102
+ @cache ||= {}
103
+ unless @cache[series_name]
104
+ series_config = config[series_name] || {}
105
+ series_config.reject! { |_k, v| v.nil? }
104
106
 
105
- @@cache[series_name] = Rubicure::Series[series_config]
106
- end
107
+ @cache[series_name] = Rubicure::Series[series_config]
108
+ end
107
109
 
108
- @@cache[series_name]
110
+ @cache[series_name]
111
+ end
109
112
  end
110
113
  end
111
114
  end
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
data/lib/ubicure.rb CHANGED
@@ -1 +1 @@
1
- require 'rubicure'
1
+ require "rubicure"
data/rubicure.gemspec CHANGED
@@ -1,21 +1,21 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'rubicure/version'
4
+ require "rubicure/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "rubicure"
8
8
  spec.version = Rubicure::VERSION
9
9
  spec.authors = ["sue445"]
10
10
  spec.email = ["sue445@sue445.net"]
11
- spec.description = %q{All about Japanese battle heroine "Pretty Cure (Precure)".}
12
- spec.summary = %q{All about Japanese battle heroine "Pretty Cure (Precure)".}
11
+ spec.description = 'All about Japanese battle heroine "Pretty Cure (Precure)".'
12
+ spec.summary = 'All about Japanese battle heroine "Pretty Cure (Precure)".'
13
13
  spec.homepage = "https://github.com/sue445/rubicure"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.required_ruby_version = '>= 2.0.0'
16
+ spec.required_ruby_version = ">= 2.0.0"
17
17
 
18
- spec.files = `git ls-files`.split($/)
18
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ["lib"]
@@ -34,6 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "rspec-collection_matchers", "~> 1.0.0"
35
35
  spec.add_development_dependency "rspec-its", "~> 1.0.1"
36
36
  spec.add_development_dependency "rspec-parameterized", "~> 0.1.2"
37
- spec.add_development_dependency "rubocop", "~> 0.26.1"
37
+ spec.add_development_dependency "rubocop", "~> 0.30.0"
38
38
  spec.add_development_dependency "yard"
39
39
  end
data/spec/core_spec.rb CHANGED
@@ -62,7 +62,7 @@ EOS
62
62
  context "Without arg" do
63
63
  subject { instance.all_stars }
64
64
 
65
- let(:precure_count){ 40 }
65
+ let(:precure_count) { 40 }
66
66
 
67
67
  its(:count) { should == precure_count }
68
68
  end
data/spec/cure_spec.rb CHANGED
@@ -1,19 +1,19 @@
1
1
  describe "Cure" do
2
2
  describe ".peace" do
3
3
  describe "#pikarin_janken" do
4
- subject{ girl.pikarin_janken }
4
+ subject { girl.pikarin_janken }
5
5
 
6
6
  shared_examples :do_janken do
7
- it{ should match %r/ピカピカピカリン\nジャンケンポン!\n(.+)/ }
7
+ it { should match(/ピカピカピカリン\nジャンケンポン!\n(.+)/) }
8
8
  end
9
9
 
10
10
  context "When peace" do
11
- let(:girl){ Cure.peace }
11
+ let(:girl) { Cure.peace }
12
12
  it_behaves_like :do_janken
13
13
  end
14
14
 
15
15
  context "When cure_peace" do
16
- let(:girl){ Cure.cure_peace }
16
+ let(:girl) { Cure.cure_peace }
17
17
  it_behaves_like :do_janken
18
18
  end
19
19
  end
@@ -21,9 +21,9 @@ describe "Cure" do
21
21
 
22
22
  describe ".passion" do
23
23
  describe "!" do
24
- subject{ !Cure.passion }
24
+ subject { !Cure.passion }
25
25
 
26
- let(:girl){ Cure.passion }
26
+ let(:girl) { Cure.passion }
27
27
 
28
28
  after do
29
29
  girl.rollback
@@ -31,7 +31,7 @@ describe "Cure" do
31
31
  end
32
32
 
33
33
  context "called once" do
34
- it{ expect{ subject }.to change{ girl.name }.from("東せつな").to("イース") }
34
+ it { expect { subject }.to change { girl.name }.from("東せつな").to("イース") }
35
35
  end
36
36
 
37
37
  context "called twice" do
@@ -39,7 +39,7 @@ describe "Cure" do
39
39
  !Cure.passion
40
40
  end
41
41
 
42
- it{ expect{ subject }.to change{ girl.name }.from("イース").to("東せつな") }
42
+ it { expect { subject }.to change { girl.name }.from("イース").to("東せつな") }
43
43
  end
44
44
 
45
45
  context "after transform" do
@@ -47,16 +47,16 @@ describe "Cure" do
47
47
  girl.transform!
48
48
  end
49
49
 
50
- it{ expect{ subject }.to change{ girl.name }.from("キュアパッション").to("イース") }
50
+ it { expect { subject }.to change { girl.name }.from("キュアパッション").to("イース") }
51
51
  end
52
52
  end
53
53
  end
54
54
 
55
55
  describe ".beat" do
56
56
  describe "!" do
57
- subject{ !Cure.beat }
57
+ subject { !Cure.beat }
58
58
 
59
- let(:girl){ Cure.beat }
59
+ let(:girl) { Cure.beat }
60
60
 
61
61
  after do
62
62
  girl.rollback
@@ -64,7 +64,7 @@ describe "Cure" do
64
64
  end
65
65
 
66
66
  context "called once" do
67
- it{ expect{ subject }.to change{ girl.name }.from("黒川エレン").to("セイレーン") }
67
+ it { expect { subject }.to change { girl.name }.from("黒川エレン").to("セイレーン") }
68
68
  end
69
69
 
70
70
  context "called twice" do
@@ -72,7 +72,7 @@ describe "Cure" do
72
72
  !Cure.beat
73
73
  end
74
74
 
75
- it{ expect{ subject }.to change{ girl.name }.from("セイレーン").to("黒川エレン") }
75
+ it { expect { subject }.to change { girl.name }.from("セイレーン").to("黒川エレン") }
76
76
  end
77
77
 
78
78
  context "after transform" do
@@ -80,7 +80,7 @@ describe "Cure" do
80
80
  girl.transform!
81
81
  end
82
82
 
83
- it{ expect{ subject }.to change{ girl.name }.from("キュアビート").to("セイレーン") }
83
+ it { expect { subject }.to change { girl.name }.from("キュアビート").to("セイレーン") }
84
84
  end
85
85
  end
86
86
  end
data/spec/girl_spec.rb CHANGED
@@ -35,7 +35,7 @@ EOF
35
35
  "プリキュアピースサンダーハリケーン!",
36
36
  ]
37
37
  end
38
- let(:transform_calls){ %w(smile_charge) }
38
+ let(:transform_calls) { %w(smile_charge) }
39
39
 
40
40
  describe "#name" do
41
41
  context "when before transform" do
@@ -154,20 +154,20 @@ EOF
154
154
  context "When Cure Lemonade calls metamorphose" do
155
155
  let(:girl) { Cure.lemonade }
156
156
  let(:transform_call) { "metamorphose" }
157
- it { expect{ subject }.not_to raise_error }
157
+ it { expect { subject }.not_to raise_error }
158
158
  end
159
159
 
160
160
  context "When Milkey Rose calls sky_rose_translate!" do
161
161
  let(:girl) { Milky.rose }
162
162
  let(:transform_call) { "sky_rose_translate!" }
163
- it { expect{ subject }.not_to raise_error }
163
+ it { expect { subject }.not_to raise_error }
164
164
  end
165
165
 
166
166
  context "When Milky Rose calls metamorphose" do
167
167
  let(:girl) { Milky.rose }
168
168
  let(:transform_call) { "metamorphose" }
169
169
 
170
- it { expect{ subject }.to raise_error NameError }
170
+ it { expect { subject }.to raise_error NameError }
171
171
  end
172
172
  end
173
173
 
@@ -177,10 +177,10 @@ EOF
177
177
  end
178
178
 
179
179
  describe "humanize!" do
180
- let(:humanize!){ girl.humanize! }
180
+ let(:humanize!) { girl.humanize! }
181
181
 
182
182
  context "When not transformed" do
183
- subject!{ humanize! }
183
+ subject! { humanize! }
184
184
 
185
185
  it_behaves_like :a_humanize_method
186
186
  end
@@ -190,14 +190,14 @@ EOF
190
190
  girl.transform!
191
191
  end
192
192
 
193
- subject!{ humanize! }
193
+ subject! { humanize! }
194
194
 
195
195
  it_behaves_like :a_humanize_method
196
196
  end
197
197
  end
198
198
 
199
199
  describe "#colors" do
200
- subject{ Rubicure::Girl.colors }
200
+ subject { Rubicure::Girl.colors }
201
201
 
202
202
  let(:expected) do
203
203
  %i(
data/spec/movie_spec.rb CHANGED
@@ -36,8 +36,7 @@ describe Rubicure::Movie do
36
36
  context "when not exists" do
37
37
  let(:movie_name) { :ashita_no_nadja }
38
38
 
39
- it { expect{ subject }.to raise_error }
39
+ it { expect { subject }.to raise_error }
40
40
  end
41
41
  end
42
-
43
42
  end
@@ -1,7 +1,7 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Rubicure do
4
- it 'should have a version number' do
4
+ it "should have a version number" do
5
5
  expect(Rubicure::VERSION).not_to be_nil
6
6
  end
7
7
 
@@ -105,13 +105,13 @@ describe Rubicure do
105
105
  end
106
106
 
107
107
  with_them do
108
- it { expect( Cure.send(name) ).to be_an_instance_of Rubicure::Girl }
109
- it { expect( Cure.send(name).precure_name ).to be_start_with "キュア" }
108
+ it { expect(Cure.send(name)).to be_an_instance_of Rubicure::Girl }
109
+ it { expect(Cure.send(name).precure_name).to be_start_with "キュア" }
110
110
  end
111
111
 
112
112
  context "When precure who not starting 'cure'" do
113
- it { expect( Shiny.luminous.precure_name ).to eq "シャイニールミナス" }
114
- it { expect( Milky.rose.precure_name ).to eq "ミルキィローズ" }
113
+ it { expect(Shiny.luminous.precure_name).to eq "シャイニールミナス" }
114
+ it { expect(Milky.rose.precure_name).to eq "ミルキィローズ" }
115
115
  end
116
116
  end
117
117
  end
data/spec/series_spec.rb CHANGED
@@ -66,6 +66,7 @@ describe Rubicure::Series do
66
66
  ]
67
67
  end
68
68
 
69
+ # rubocop:disable Style/CaseEquality, Lint/UselessComparison, Style/NilComparison
69
70
  describe "#===" do
70
71
  let(:series) { Rubicure::Series.find(series_name) }
71
72
  let(:series_name) { :smile }
@@ -92,6 +93,7 @@ describe Rubicure::Series do
92
93
  it { expect(series === nil).to be false }
93
94
  end
94
95
  end
96
+ # rubocop:enable Style/CaseEquality, Lint/UselessComparison, Style/NilComparison
95
97
 
96
98
  describe "#names" do
97
99
  subject { Rubicure::Series.names }
@@ -124,10 +126,10 @@ describe Rubicure::Series do
124
126
  end
125
127
 
126
128
  describe "#each_with_girls" do
127
- subject{ series.each_with_girls }
129
+ subject { series.each_with_girls }
128
130
 
129
131
  let(:series) { Rubicure::Series.find(series_name) }
130
- let(:series_name){ :splash_star }
132
+ let(:series_name) { :splash_star }
131
133
 
132
134
  it { expect { |b| series.each_with_girls(&b) }.to yield_successive_args(Rubicure::Girl, Rubicure::Girl) }
133
135
  end
data/spec/spec_helper.rb CHANGED
@@ -16,92 +16,90 @@
16
16
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
17
 
18
18
  if ENV["COVERAGE"]
19
- require 'codeclimate-test-reporter'
19
+ require "codeclimate-test-reporter"
20
20
  CodeClimate::TestReporter.start
21
21
 
22
- require 'coveralls'
22
+ require "coveralls"
23
23
  Coveralls.wear!
24
24
  end
25
25
 
26
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
27
- require 'rubicure'
28
- require 'rspec'
29
- require 'rspec-parameterized'
30
- require 'rspec/its'
31
- require 'rspec/collection_matchers'
32
- require 'delorean'
33
- require 'tempfile'
26
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
27
+ require "rubicure"
28
+ require "rspec"
29
+ require "rspec-parameterized"
30
+ require "rspec/its"
31
+ require "rspec/collection_matchers"
32
+ require "delorean"
33
+ require "tempfile"
34
34
 
35
35
  # Requires supporting ruby files with custom matchers and macros, etc,
36
36
  # in spec/support/ and its subdirectories.
37
37
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
38
38
 
39
39
  RSpec.configure do |config|
40
- # The settings below are suggested to provide a good initial experience
41
- # with RSpec, but feel free to customize to your heart's content.
42
- =begin
43
- # These two settings work together to allow you to limit a spec run
44
- # to individual examples or groups you care about by tagging them with
45
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
46
- # get run.
47
- config.filter_run :focus
48
- config.run_all_when_everything_filtered = true
49
-
50
- # Many RSpec users commonly either run the entire suite or an individual
51
- # file, and it's useful to allow more verbose output when running an
52
- # individual spec file.
53
- if config.files_to_run.one?
54
- # RSpec filters the backtrace by default so as not to be so noisy.
55
- # This causes the full backtrace to be printed when running a single
56
- # spec file (e.g. to troubleshoot a particular spec failure).
57
- config.full_backtrace = true
58
-
59
- # Use the documentation formatter for detailed output,
60
- # unless a formatter has already been configured
61
- # (e.g. via a command-line flag).
62
- config.default_formatter = 'doc'
63
- end
64
-
65
- # Print the 10 slowest examples and example groups at the
66
- # end of the spec run, to help surface which specs are running
67
- # particularly slow.
68
- config.profile_examples = 10
69
-
70
- # Run specs in random order to surface order dependencies. If you find an
71
- # order dependency and want to debug it, you can fix the order by providing
72
- # the seed, which is printed after each run.
73
- # --seed 1234
74
- config.order = :random
75
-
76
- # Seed global randomization in this process using the `--seed` CLI option.
77
- # Setting this allows you to use `--seed` to deterministically reproduce
78
- # test failures related to randomization by passing the same `--seed` value
79
- # as the one that triggered the failure.
80
- Kernel.srand config.seed
81
-
82
- # rspec-expectations config goes here. You can use an alternate
83
- # assertion/expectation library such as wrong or the stdlib/minitest
84
- # assertions if you prefer.
85
- config.expect_with :rspec do |expectations|
86
- # Enable only the newer, non-monkey-patching expect syntax.
87
- # For more details, see:
88
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
89
- expectations.syntax = :expect
90
- end
91
-
92
- # rspec-mocks config goes here. You can use an alternate test double
93
- # library (such as bogus or mocha) by changing the `mock_with` option here.
94
- config.mock_with :rspec do |mocks|
95
- # Enable only the newer, non-monkey-patching expect syntax.
96
- # For more details, see:
97
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
98
- mocks.syntax = :expect
99
-
100
- # Prevents you from mocking or stubbing a method that does not exist on
101
- # a real object. This is generally recommended.
102
- mocks.verify_partial_doubles = true
103
- end
104
- =end
40
+ # The settings below are suggested to provide a good initial experience
41
+ # with RSpec, but feel free to customize to your heart's content.
42
+ # # These two settings work together to allow you to limit a spec run
43
+ # # to individual examples or groups you care about by tagging them with
44
+ # # `:focus` metadata. When nothing is tagged with `:focus`, all examples
45
+ # # get run.
46
+ # config.filter_run :focus
47
+ # config.run_all_when_everything_filtered = true
48
+ #
49
+ # # Many RSpec users commonly either run the entire suite or an individual
50
+ # # file, and it's useful to allow more verbose output when running an
51
+ # # individual spec file.
52
+ # if config.files_to_run.one?
53
+ # # RSpec filters the backtrace by default so as not to be so noisy.
54
+ # # This causes the full backtrace to be printed when running a single
55
+ # # spec file (e.g. to troubleshoot a particular spec failure).
56
+ # config.full_backtrace = true
57
+ #
58
+ # # Use the documentation formatter for detailed output,
59
+ # # unless a formatter has already been configured
60
+ # # (e.g. via a command-line flag).
61
+ # config.default_formatter = 'doc'
62
+ # end
63
+ #
64
+ # # Print the 10 slowest examples and example groups at the
65
+ # # end of the spec run, to help surface which specs are running
66
+ # # particularly slow.
67
+ # config.profile_examples = 10
68
+ #
69
+ # # Run specs in random order to surface order dependencies. If you find an
70
+ # # order dependency and want to debug it, you can fix the order by providing
71
+ # # the seed, which is printed after each run.
72
+ # # --seed 1234
73
+ # config.order = :random
74
+ #
75
+ # # Seed global randomization in this process using the `--seed` CLI option.
76
+ # # Setting this allows you to use `--seed` to deterministically reproduce
77
+ # # test failures related to randomization by passing the same `--seed` value
78
+ # # as the one that triggered the failure.
79
+ # Kernel.srand config.seed
80
+ #
81
+ # # rspec-expectations config goes here. You can use an alternate
82
+ # # assertion/expectation library such as wrong or the stdlib/minitest
83
+ # # assertions if you prefer.
84
+ # config.expect_with :rspec do |expectations|
85
+ # # Enable only the newer, non-monkey-patching expect syntax.
86
+ # # For more details, see:
87
+ # # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
88
+ # expectations.syntax = :expect
89
+ # end
90
+ #
91
+ # # rspec-mocks config goes here. You can use an alternate test double
92
+ # # library (such as bogus or mocha) by changing the `mock_with` option here.
93
+ # config.mock_with :rspec do |mocks|
94
+ # # Enable only the newer, non-monkey-patching expect syntax.
95
+ # # For more details, see:
96
+ # # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
97
+ # mocks.syntax = :expect
98
+ #
99
+ # # Prevents you from mocking or stubbing a method that does not exist on
100
+ # # a real object. This is generally recommended.
101
+ # mocks.verify_partial_doubles = true
102
+ # end
105
103
 
106
104
  config.order = :random
107
105
 
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.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 0.26.1
201
+ version: 0.30.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 0.26.1
208
+ version: 0.30.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: yard
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -232,6 +232,7 @@ files:
232
232
  - ".hound.yml"
233
233
  - ".rspec"
234
234
  - ".rubocop.yml"
235
+ - ".tachikoma.yml"
235
236
  - ".travis.yml"
236
237
  - ".yardopts"
237
238
  - CHANGELOG.md