From 91360fbbd6bf6669b27e715081751c3c2af66066 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:24:48 +0500 Subject: [PATCH 1/3] Use RuboCop --- Rakefile | 7 +++++++ lita-tox.gemspec | 1 + 2 files changed, 8 insertions(+) diff --git a/Rakefile b/Rakefile index 2995527..e4e1c91 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,8 @@ require "bundler/gem_tasks" + +task default: [:lint] + +task lint: [:rubocop] + +require 'rubocop/rake_task' +RuboCop::RakeTask.new diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 80687d9..84e60bc 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -21,4 +21,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.10" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rubocop", "~> 0.31" end From 23d8f78001ce2c3877bea29eade85d61a1b89fdf Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:25:16 +0500 Subject: [PATCH 2/3] Run RuboCop auto-correction $ rake rubocop:auto_correct --- Rakefile | 2 +- bin/console | 6 +++--- lib/lita/tox.rb | 2 +- lib/lita/tox/version.rb | 2 +- lita-tox.gemspec | 24 ++++++++++++------------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Rakefile b/Rakefile index e4e1c91..df02adb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -require "bundler/gem_tasks" +require 'bundler/gem_tasks' task default: [:lint] diff --git a/bin/console b/bin/console index bac87a0..8a51fab 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -require "bundler/setup" -require "lita/tox" +require 'bundler/setup' +require 'lita/tox' # 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. @@ -10,5 +10,5 @@ require "lita/tox" # require "pry" # Pry.start -require "irb" +require 'irb' IRB.start diff --git a/lib/lita/tox.rb b/lib/lita/tox.rb index 606b685..a2ac55d 100644 --- a/lib/lita/tox.rb +++ b/lib/lita/tox.rb @@ -1,4 +1,4 @@ -require "lita/tox/version" +require 'lita/tox/version' module Lita module Tox diff --git a/lib/lita/tox/version.rb b/lib/lita/tox/version.rb index 4553074..3786e2c 100644 --- a/lib/lita/tox/version.rb +++ b/lib/lita/tox/version.rb @@ -1,5 +1,5 @@ module Lita module Tox - VERSION = "0.0.0" + VERSION = '0.0.0' end end diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 84e60bc..d941679 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -4,22 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'lita/tox/version' Gem::Specification.new do |spec| - spec.name = "lita-tox" + spec.name = 'lita-tox' spec.version = Lita::Tox::VERSION - spec.authors = ["Braiden Vasco"] - spec.email = ["braiden-vasco@mailtor.net"] + spec.authors = ['Braiden Vasco'] + spec.email = ['braiden-vasco@mailtor.net'] - spec.summary = %q{Tox adapter for the Lita chat bot} - spec.description = %q{Tox adapter for the Lita chat bot.} - spec.homepage = "https://github.com/braiden-vasco/lita-tox" - spec.license = "MIT" + spec.summary = 'Tox adapter for the Lita chat bot' + spec.description = 'Tox adapter for the Lita chat bot.' + spec.homepage = 'https://github.com/braiden-vasco/lita-tox' + spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - 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", "~> 1.10" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rubocop", "~> 0.31" + spec.add_development_dependency 'bundler', '~> 1.10' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rubocop', '~> 0.31' end From 1ee21273b02ef38716befd422cc50f37d8af109b Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:27:06 +0500 Subject: [PATCH 3/3] Correct RuboCop offenses manually --- lib/lita/tox/version.rb | 2 +- lita-tox.gemspec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/lita/tox/version.rb b/lib/lita/tox/version.rb index 3786e2c..291e337 100644 --- a/lib/lita/tox/version.rb +++ b/lib/lita/tox/version.rb @@ -1,5 +1,5 @@ module Lita - module Tox + module Tox # rubocop:disable Style/Documentation VERSION = '0.0.0' end end diff --git a/lita-tox.gemspec b/lita-tox.gemspec index d941679..1eb48e2 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -14,7 +14,10 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/braiden-vasco/lita-tox' spec.license = 'MIT' - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(test|spec|features)/}) + end + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib']