-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from halostatue/switch-to-standardrb-formatting
Switch to standardrb formatting
- Loading branch information
Showing
29 changed files
with
937 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
exclude_paths: | ||
- lib/diff/lcs.rb # sort_vs_sort_by on priority_compare | ||
- Rakefile # each_with_index vs while | ||
- spec/spec_helper.rb | ||
- research/**/* | ||
- pkg/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parallel: true | ||
ruby_version: 2.0 | ||
ignore: | ||
- 'diff-lcs.gemspec' | ||
- 'research/**/*' | ||
- 'pkg/**/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rubygems' | ||
require 'rspec' | ||
require 'rspec/core/rake_task' | ||
require 'hoe' | ||
require "rubygems" | ||
require "rspec" | ||
require "rspec/core/rake_task" | ||
require "hoe" | ||
|
||
# This is required until https://github.com/seattlerb/hoe/issues/112 is fixed | ||
class Hoe | ||
|
@@ -45,66 +45,71 @@ Hoe.plugin :doofus | |
Hoe.plugin :gemspec2 | ||
Hoe.plugin :git | ||
|
||
if RUBY_VERSION < '1.9' | ||
class Array #:nodoc: | ||
if RUBY_VERSION < "1.9" | ||
class Array # :nodoc: | ||
def to_h | ||
Hash[*flatten(1)] | ||
end | ||
end | ||
|
||
class Gem::Specification #:nodoc: | ||
def metadata=(*); end | ||
class Gem::Specification # :nodoc: | ||
def metadata=(*) | ||
end | ||
|
||
def default_value(*); end | ||
def default_value(*) | ||
end | ||
end | ||
|
||
class Object #:nodoc: | ||
class Object # :nodoc: | ||
def caller_locations(*) | ||
[] | ||
end | ||
end | ||
end | ||
|
||
_spec = Hoe.spec 'diff-lcs' do | ||
developer('Austin Ziegler', '[email protected]') | ||
_spec = Hoe.spec "diff-lcs" do | ||
developer("Austin Ziegler", "[email protected]") | ||
|
||
require_ruby_version '>= 1.8' | ||
require_ruby_version ">= 1.8" | ||
|
||
self.history_file = 'History.md' | ||
self.readme_file = 'README.rdoc' | ||
self.licenses = ['MIT', 'Artistic-2.0', 'GPL-2.0+'] | ||
self.history_file = "History.md" | ||
self.readme_file = "README.rdoc" | ||
self.licenses = ["MIT", "Artistic-2.0", "GPL-2.0+"] | ||
|
||
extra_dev_deps << ['hoe-doofus', '~> 1.0'] | ||
extra_dev_deps << ['hoe-gemspec2', '~> 1.1'] | ||
extra_dev_deps << ['hoe-git', '~> 1.6'] | ||
extra_dev_deps << ['hoe-rubygems', '~> 1.0'] | ||
extra_dev_deps << ['rspec', '>= 2.0', '< 4'] | ||
extra_dev_deps << ['rake', '>= 10.0', '< 14'] | ||
extra_dev_deps << ['rdoc', '>= 6.3.1', '< 7'] | ||
extra_dev_deps << ["hoe-doofus", "~> 1.0"] | ||
extra_dev_deps << ["hoe-gemspec2", "~> 1.1"] | ||
extra_dev_deps << ["hoe-git", "~> 1.6"] | ||
extra_dev_deps << ["hoe-rubygems", "~> 1.0"] | ||
extra_dev_deps << ["rspec", ">= 2.0", "< 4"] | ||
extra_dev_deps << ["rake", ">= 10.0", "< 14"] | ||
extra_dev_deps << ["rdoc", ">= 6.3.1", "< 7"] | ||
end | ||
|
||
desc "Run all specifications" | ||
RSpec::Core::RakeTask.new(:spec) do |t| | ||
rspec_dirs = %w(spec lib).join(":") | ||
rspec_dirs = %w[spec lib].join(":") | ||
t.rspec_opts = ["-I#{rspec_dirs}"] | ||
end | ||
|
||
Rake::Task["spec"].actions.uniq! { |a| a.source_location } | ||
|
||
# standard:disable Style/HashSyntax | ||
task :default => :spec unless Rake::Task["default"].prereqs.include?("spec") | ||
task :test => :spec unless Rake::Task["test"].prereqs.include?("spec") | ||
# standard:enable Style/HashSyntax | ||
|
||
if RUBY_VERSION >= '2.0' && RUBY_ENGINE == 'ruby' | ||
if RUBY_VERSION >= "2.0" && RUBY_ENGINE == "ruby" | ||
namespace :spec do | ||
desc "Runs test coverage. Only works Ruby 2.0+ and assumes 'simplecov' is installed." | ||
task :coverage do | ||
ENV['COVERAGE'] = 'yes' | ||
Rake::Task['spec'].execute | ||
ENV["COVERAGE"] = "yes" | ||
Rake::Task["spec"].execute | ||
end | ||
end | ||
end | ||
|
||
task :ruby18 do | ||
# standard:disable Layout/HeredocIndentation | ||
puts <<-MESSAGE | ||
You are starting a barebones Ruby 1.8 docker environment. You will need to | ||
do the following: | ||
|
@@ -117,5 +122,6 @@ do the following: | |
Don't forget to restore your Gemfile.lock after testing. | ||
MESSAGE | ||
# standard:enable Layout/HeredocIndentation | ||
sh "docker run -it --rm -v #{Dir.pwd}:/root/diff-lcs bellbind/docker-ruby18-rails2 bash -l" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'diff/lcs' | ||
require "diff/lcs" |
Oops, something went wrong.