Skip to content

Commit

Permalink
add rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
masarakki committed Sep 4, 2014
1 parent 0ec0894 commit e358c46
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 86 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Metrics/LineLength:
Enabled: false
Style/Documentation:
Enabled: false
Style/RegexpLiteral:
MaxSlashes: 0
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ language: ruby
rvm:
- 2.0.0
- 2.1.2
script:
- bundle exec rake spec
- bundle exec rubocop
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
source 'https://rubygems.org'

gemspec

2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ require 'rspec/core/rake_task'

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

task :default => :spec
task default: :spec
24 changes: 12 additions & 12 deletions ikazuchi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ require 'ikazuchi/version'
require 'ikazuchi/definition'

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

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

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'

Ikazuchi::Definition.dependencies.each do |dependency|
spec.add_dependency dependency.name, dependency.requirement.to_s
Expand Down
4 changes: 2 additions & 2 deletions lib/ikazuchi.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require "ikazuchi/version"
require "ikazuchi/definition"
require 'ikazuchi/version'
require 'ikazuchi/definition'
require 'ikazuchi/railtie' if defined? Rails
11 changes: 6 additions & 5 deletions lib/ikazuchi/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ group :development, :test do
gem 'guard-spring'
gem 'spring-commands-rspec'
gem 'rspec-rails'
gem 'libnotify', :require => false
gem 'growl', :require => false
gem 'libnotify', require: false
gem 'growl', require: false

gem 'factory_girl_rails'
gem 'simplecov', :require => false
gem 'simplecov-rcov', :require => false
gem 'ci_reporter_rspec', :require => false
gem 'simplecov', require: false
gem 'simplecov-rcov', require: false
gem 'ci_reporter_rspec', require: false
gem 'rubocop'

gem 'pry'
gem 'pry-rails'
Expand Down
4 changes: 2 additions & 2 deletions lib/ikazuchi/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def require!(*groups)

class << self
def require!(*groups)
self.new.require!(*groups)
new.require!(*groups)
end

def dependencies
self.new.dependencies
new.dependencies
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ikazuchi/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Ikazuchi
VERSION = "0.1.1"
VERSION = '0.1.1'
end
2 changes: 1 addition & 1 deletion spec/ikazuchi/definition_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'

describe Ikazuchi::Definition do
it { expect(Ikazuchi::Definition.dependencies).to all( be_a Bundler::Dependency ) }
it { expect(Ikazuchi::Definition.dependencies).to all(be_a Bundler::Dependency) }
end
120 changes: 59 additions & 61 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,63 @@
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
config.filter_run :focus
config.run_all_when_everything_filtered = true
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = 'doc'
end
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random
# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# Enable only the newer, non-monkey-patching expect syntax.
# For more details, see:
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
expectations.syntax = :expect
end
# rspec-mocks config goes here. You can use an alternate test double
# library (such as bogus or mocha) by changing the `mock_with` option here.
config.mock_with :rspec do |mocks|
# Enable only the newer, non-monkey-patching expect syntax.
# For more details, see:
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
mocks.syntax = :expect
# Prevents you from mocking or stubbing a method that does not exist on
# a real object. This is generally recommended.
mocks.verify_partial_doubles = true
end
=end
RSpec.configure do |_config|
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
# # These two settings work together to allow you to limit a spec run
# # to individual examples or groups you care about by tagging them with
# # `:focus` metadata. When nothing is tagged with `:focus`, all examples
# # get run.
# config.filter_run :focus
# config.run_all_when_everything_filtered = true
#
# # Many RSpec users commonly either run the entire suite or an individual
# # file, and it's useful to allow more verbose output when running an
# # individual spec file.
# if config.files_to_run.one?
# # Use the documentation formatter for detailed output,
# # unless a formatter has already been configured
# # (e.g. via a command-line flag).
# config.default_formatter = 'doc'
# end
#
# # Print the 10 slowest examples and example groups at the
# # end of the spec run, to help surface which specs are running
# # particularly slow.
# config.profile_examples = 10
#
# # Run specs in random order to surface order dependencies. If you find an
# # order dependency and want to debug it, you can fix the order by providing
# # the seed, which is printed after each run.
# # --seed 1234
# config.order = :random
#
# # Seed global randomization in this process using the `--seed` CLI option.
# # Setting this allows you to use `--seed` to deterministically reproduce
# # test failures related to randomization by passing the same `--seed` value
# # as the one that triggered the failure.
# Kernel.srand config.seed
#
# # rspec-expectations config goes here. You can use an alternate
# # assertion/expectation library such as wrong or the stdlib/minitest
# # assertions if you prefer.
# config.expect_with :rspec do |expectations|
# # Enable only the newer, non-monkey-patching expect syntax.
# # For more details, see:
# # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
# expectations.syntax = :expect
# end
#
# # rspec-mocks config goes here. You can use an alternate test double
# # library (such as bogus or mocha) by changing the `mock_with` option here.
# config.mock_with :rspec do |mocks|
# # Enable only the newer, non-monkey-patching expect syntax.
# # For more details, see:
# # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
# mocks.syntax = :expect
#
# # Prevents you from mocking or stubbing a method that does not exist on
# # a real object. This is generally recommended.
# mocks.verify_partial_doubles = true
# end
end

0 comments on commit e358c46

Please sign in to comment.