Skip to content

Commit e358c46

Browse files
author
masarakki
committed
add rubocop
1 parent 0ec0894 commit e358c46

11 files changed

+93
-86
lines changed

.rubocop.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Metrics/LineLength:
2+
Enabled: false
3+
Style/Documentation:
4+
Enabled: false
5+
Style/RegexpLiteral:
6+
MaxSlashes: 0

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ language: ruby
22
rvm:
33
- 2.0.0
44
- 2.1.2
5+
script:
6+
- bundle exec rake spec
7+
- bundle exec rubocop

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
source 'https://rubygems.org'
22

33
gemspec
4-

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ require 'rspec/core/rake_task'
33

44
RSpec::Core::RakeTask.new(:spec)
55

6-
task :default => :spec
6+
task default: :spec

ikazuchi.gemspec

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ require 'ikazuchi/version'
55
require 'ikazuchi/definition'
66

77
Gem::Specification.new do |spec|
8-
spec.name = "ikazuchi"
8+
spec.name = 'ikazuchi'
99
spec.version = Ikazuchi::VERSION
10-
spec.authors = ["masarakki"]
11-
spec.email = ["[email protected]"]
12-
spec.description = %q{meta-package of useful gems for rails development}
13-
spec.summary = %q{meta-package of useful gems for rails development}
14-
spec.homepage = "https://github.com/masarakki/ikazuchi"
15-
spec.license = "MIT"
10+
spec.authors = ['masarakki']
11+
spec.email = ['[email protected]']
12+
spec.description = 'meta-package of useful gems for rails development'
13+
spec.summary = 'meta-package of useful gems for rails development'
14+
spec.homepage = 'https://github.com/masarakki/ikazuchi'
15+
spec.license = 'MIT'
1616

17-
spec.files = `git ls-files`.split($/)
17+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
1818
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
1919
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20-
spec.require_paths = ["lib"]
20+
spec.require_paths = ['lib']
2121

22-
spec.add_development_dependency "bundler", "~> 1.3"
23-
spec.add_development_dependency "rake"
24-
spec.add_development_dependency "rspec"
22+
spec.add_development_dependency 'bundler', '~> 1.3'
23+
spec.add_development_dependency 'rake'
24+
spec.add_development_dependency 'rspec'
2525

2626
Ikazuchi::Definition.dependencies.each do |dependency|
2727
spec.add_dependency dependency.name, dependency.requirement.to_s

lib/ikazuchi.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
require "ikazuchi/version"
2-
require "ikazuchi/definition"
1+
require 'ikazuchi/version'
2+
require 'ikazuchi/definition'
33
require 'ikazuchi/railtie' if defined? Rails

lib/ikazuchi/Gemfile

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ group :development, :test do
99
gem 'guard-spring'
1010
gem 'spring-commands-rspec'
1111
gem 'rspec-rails'
12-
gem 'libnotify', :require => false
13-
gem 'growl', :require => false
12+
gem 'libnotify', require: false
13+
gem 'growl', require: false
1414

1515
gem 'factory_girl_rails'
16-
gem 'simplecov', :require => false
17-
gem 'simplecov-rcov', :require => false
18-
gem 'ci_reporter_rspec', :require => false
16+
gem 'simplecov', require: false
17+
gem 'simplecov-rcov', require: false
18+
gem 'ci_reporter_rspec', require: false
19+
gem 'rubocop'
1920

2021
gem 'pry'
2122
gem 'pry-rails'

lib/ikazuchi/definition.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ def require!(*groups)
2727

2828
class << self
2929
def require!(*groups)
30-
self.new.require!(*groups)
30+
new.require!(*groups)
3131
end
3232

3333
def dependencies
34-
self.new.dependencies
34+
new.dependencies
3535
end
3636
end
3737
end

lib/ikazuchi/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Ikazuchi
2-
VERSION = "0.1.1"
2+
VERSION = '0.1.1'
33
end

spec/ikazuchi/definition_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'spec_helper'
22

33
describe Ikazuchi::Definition do
4-
it { expect(Ikazuchi::Definition.dependencies).to all( be_a Bundler::Dependency ) }
4+
it { expect(Ikazuchi::Definition.dependencies).to all(be_a Bundler::Dependency) }
55
end

spec/spec_helper.rb

+59-61
Original file line numberDiff line numberDiff line change
@@ -14,65 +14,63 @@
1414
# users commonly want.
1515
#
1616
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17-
RSpec.configure do |config|
18-
# The settings below are suggested to provide a good initial experience
19-
# with RSpec, but feel free to customize to your heart's content.
20-
=begin
21-
# These two settings work together to allow you to limit a spec run
22-
# to individual examples or groups you care about by tagging them with
23-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
24-
# get run.
25-
config.filter_run :focus
26-
config.run_all_when_everything_filtered = true
27-
28-
# Many RSpec users commonly either run the entire suite or an individual
29-
# file, and it's useful to allow more verbose output when running an
30-
# individual spec file.
31-
if config.files_to_run.one?
32-
# Use the documentation formatter for detailed output,
33-
# unless a formatter has already been configured
34-
# (e.g. via a command-line flag).
35-
config.default_formatter = 'doc'
36-
end
37-
38-
# Print the 10 slowest examples and example groups at the
39-
# end of the spec run, to help surface which specs are running
40-
# particularly slow.
41-
config.profile_examples = 10
42-
43-
# Run specs in random order to surface order dependencies. If you find an
44-
# order dependency and want to debug it, you can fix the order by providing
45-
# the seed, which is printed after each run.
46-
# --seed 1234
47-
config.order = :random
48-
49-
# Seed global randomization in this process using the `--seed` CLI option.
50-
# Setting this allows you to use `--seed` to deterministically reproduce
51-
# test failures related to randomization by passing the same `--seed` value
52-
# as the one that triggered the failure.
53-
Kernel.srand config.seed
54-
55-
# rspec-expectations config goes here. You can use an alternate
56-
# assertion/expectation library such as wrong or the stdlib/minitest
57-
# assertions if you prefer.
58-
config.expect_with :rspec do |expectations|
59-
# Enable only the newer, non-monkey-patching expect syntax.
60-
# For more details, see:
61-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
62-
expectations.syntax = :expect
63-
end
64-
65-
# rspec-mocks config goes here. You can use an alternate test double
66-
# library (such as bogus or mocha) by changing the `mock_with` option here.
67-
config.mock_with :rspec do |mocks|
68-
# Enable only the newer, non-monkey-patching expect syntax.
69-
# For more details, see:
70-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71-
mocks.syntax = :expect
72-
73-
# Prevents you from mocking or stubbing a method that does not exist on
74-
# a real object. This is generally recommended.
75-
mocks.verify_partial_doubles = true
76-
end
77-
=end
17+
RSpec.configure do |_config|
18+
# The settings below are suggested to provide a good initial experience
19+
# with RSpec, but feel free to customize to your heart's content.
20+
# # These two settings work together to allow you to limit a spec run
21+
# # to individual examples or groups you care about by tagging them with
22+
# # `:focus` metadata. When nothing is tagged with `:focus`, all examples
23+
# # get run.
24+
# config.filter_run :focus
25+
# config.run_all_when_everything_filtered = true
26+
#
27+
# # Many RSpec users commonly either run the entire suite or an individual
28+
# # file, and it's useful to allow more verbose output when running an
29+
# # individual spec file.
30+
# if config.files_to_run.one?
31+
# # Use the documentation formatter for detailed output,
32+
# # unless a formatter has already been configured
33+
# # (e.g. via a command-line flag).
34+
# config.default_formatter = 'doc'
35+
# end
36+
#
37+
# # Print the 10 slowest examples and example groups at the
38+
# # end of the spec run, to help surface which specs are running
39+
# # particularly slow.
40+
# config.profile_examples = 10
41+
#
42+
# # Run specs in random order to surface order dependencies. If you find an
43+
# # order dependency and want to debug it, you can fix the order by providing
44+
# # the seed, which is printed after each run.
45+
# # --seed 1234
46+
# config.order = :random
47+
#
48+
# # Seed global randomization in this process using the `--seed` CLI option.
49+
# # Setting this allows you to use `--seed` to deterministically reproduce
50+
# # test failures related to randomization by passing the same `--seed` value
51+
# # as the one that triggered the failure.
52+
# Kernel.srand config.seed
53+
#
54+
# # rspec-expectations config goes here. You can use an alternate
55+
# # assertion/expectation library such as wrong or the stdlib/minitest
56+
# # assertions if you prefer.
57+
# config.expect_with :rspec do |expectations|
58+
# # Enable only the newer, non-monkey-patching expect syntax.
59+
# # For more details, see:
60+
# # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
61+
# expectations.syntax = :expect
62+
# end
63+
#
64+
# # rspec-mocks config goes here. You can use an alternate test double
65+
# # library (such as bogus or mocha) by changing the `mock_with` option here.
66+
# config.mock_with :rspec do |mocks|
67+
# # Enable only the newer, non-monkey-patching expect syntax.
68+
# # For more details, see:
69+
# # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
70+
# mocks.syntax = :expect
71+
#
72+
# # Prevents you from mocking or stubbing a method that does not exist on
73+
# # a real object. This is generally recommended.
74+
# mocks.verify_partial_doubles = true
75+
# end
7876
end

0 commit comments

Comments
 (0)