Skip to content

Commit

Permalink
apply-rubocop-initially (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikukyugamer authored Mar 3, 2019
1 parent bfc6154 commit 509177e
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@

# rspec failure tracking
.rspec_status

vendor/
14 changes: 7 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ Style/AsciiComments:
Enabled: false

Metrics/LineLength:
Max: 200 # 数字に特に根拠はない
Max: 250 # 数字に特に根拠はない

Style/NumericLiterals:
Enabled: false

Style/PercentLiteralDelimiters:
PreferredDelimiters:
default: ()
'%i': []
'%I': []
'%r': {}
'%w': ()
'%W': []
default: '()'
'%i': '[]'
'%I': '[]'
'%r': '{}'
'%w': '()'
'%W': '[]'

Style/Documentation:
Enabled: false # 一行目に class って書いてもいいでしょ
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"
source 'https://rubygems.org'

# Specify your gem's dependencies in prekin.gemspec
gemspec
61 changes: 61 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
PATH
remote: .
specs:
prekin (0.1.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.0)
coderay (1.1.2)
diff-lcs (1.3)
jaro_winkler (1.5.2)
method_source (0.9.2)
parallel (1.14.0)
parser (2.6.0.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
psych (3.1.0)
rainbow (3.0.0)
rake (10.5.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.65.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
psych (>= 3.1.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
ruby-progressbar (1.10.0)
unicode-display_width (1.4.1)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 2.0)
prekin!
pry
rake (~> 10.0)
rspec (~> 3.0)
rubocop

BUNDLED WITH
2.0.1
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

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

task :default => :spec
task default: :spec
6 changes: 3 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "prekin"
require 'bundler/setup'
require 'prekin'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand All @@ -10,5 +10,5 @@ require "prekin"
# require "pry"
# Pry.start

require "irb"
require 'irb'
IRB.start(__FILE__)
2 changes: 1 addition & 1 deletion lib/prekin.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "prekin/version"
require 'prekin/version'

module Prekin
class Error < StandardError; end
Expand Down
2 changes: 1 addition & 1 deletion lib/prekin/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Prekin
VERSION = "0.1.0"
VERSION = '0.1.0'.freeze
end
35 changes: 17 additions & 18 deletions prekin.gemspec
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@

lib = File.expand_path("../lib", __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "prekin/version"
require 'prekin/version'

Gem::Specification.new do |spec|
spec.name = "prekin"
spec.name = 'prekin'
spec.version = Prekin::VERSION
spec.authors = ["Osamu Takiya"]
spec.email = ["[email protected]"]
spec.authors = ['Osamu Takiya']
spec.email = ['[email protected]']

spec.summary = %q{Judge whether the target day of month is 'PREMIUM FRIDAY' or not.}
spec.description = %q{Return true or false when you specify the day of month (by Time Class, Date Class or DateTime Class). The criteria is whether the day is 'PREMIUM FRIDAY' or not. 'PREMIUM FRIDAY' is the last friday in month in Japan.}
spec.homepage = "https://github.com/corselia/prekin"
spec.license = "MIT"
spec.summary = "Judge whether the target day of month is 'PREMIUM FRIDAY' or not."
spec.description = "Return true or false when you specify the day of month (by Time Class, Date Class or DateTime Class). The criteria is whether the day is 'PREMIUM FRIDAY' or not. 'PREMIUM FRIDAY' is the last friday in month in Japan."
spec.homepage = 'https://github.com/corselia/prekin'
spec.license = 'MIT'

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
spec.bindir = "exe"
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'

spec.add_development_dependency "rubocop" # バージョン指定
spec.add_development_dependency "pry" # バージョン指定
spec.add_development_dependency 'pry' # バージョン指定
spec.add_development_dependency 'rubocop' # バージョン指定
end
4 changes: 2 additions & 2 deletions spec/prekin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
RSpec.describe Prekin do
it "has a version number" do
it 'has a version number' do
expect(Prekin::VERSION).not_to be nil
end

it "does something useful" do
it 'does something useful' do
expect(false).to eq(true)
end
end
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require "bundler/setup"
require "prekin"
require 'bundler/setup'
require 'prekin'

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config.example_status_persistence_file_path = '.rspec_status'

# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
Expand Down

0 comments on commit 509177e

Please sign in to comment.