-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gonzalo-bulnes/refactor-make-code-more-idiomatic'
As a Ruby developer In order to make the gem maintenance easier I want its code to be as simple as possible And as idiomatic as possible Fixes #9
- Loading branch information
Showing
10 changed files
with
91 additions
and
87 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
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 |
---|---|---|
|
@@ -6,20 +6,19 @@ require 'dredd_hooks/version' | |
Gem::Specification.new do |spec| | ||
spec.name = "dredd_hooks" | ||
spec.version = DreddHooks::VERSION | ||
spec.authors = ["Adam Kliment"] | ||
spec.email = ["[email protected]"] | ||
spec.authors = ["Adam Kliment", "Gonzalo Bulnes Guilpain"] | ||
spec.email = ["[email protected]", "[email protected]"] | ||
spec.summary = %q{Ruby Hooks Handler for Dredd API Testing Framework} | ||
spec.description = %q{Write Dredd hooks in Ruby to glue together API Blueprint with your Ruby project} | ||
spec.description = %q{Write Dredd hooks in Ruby to glue together API Blueprint with your Ruby project.} | ||
spec.homepage = "https://github.com/apiaryio/dredd-hooks-ruby" | ||
spec.license = "MIT" | ||
|
||
spec.files = `git ls-files -z`.split("\x0") | ||
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.executables = "dredd-hooks-ruby" | ||
spec.files = Dir["{bin,lib}/**/*", "CHANGELOG.md", "Gemfile", "LICENSE.txt", "Rakefile", "README.md" ] | ||
spec.test_files = Dir["features/**/*"] | ||
|
||
spec.add_development_dependency "aruba", "~> 0.6.2" | ||
spec.add_development_dependency "bundler", "~> 1.6" | ||
spec.add_development_dependency "rake", "~> 10.0" | ||
spec.add_development_dependency "aruba", "~> 0.6.2" | ||
spec.add_development_dependency "sinatra", "~> 1.4.5" | ||
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
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,6 +1,5 @@ | ||
require "dredd_hooks/version" | ||
require 'dredd_hooks/file_loader' | ||
require 'dredd_hooks/server' | ||
|
||
module DreddHooks; end | ||
|
||
require File.join(File.dirname(__FILE__), './dredd_hooks/methods.rb') | ||
require File.join(File.dirname(__FILE__), './dredd_hooks/runner.rb') | ||
require File.join(File.dirname(__FILE__), './dredd_hooks/file_loader.rb') | ||
require File.join(File.dirname(__FILE__), './dredd_hooks/server.rb') |
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,18 +1,20 @@ | ||
module DreddHooks | ||
module FileLoader | ||
def self.unique_paths globs | ||
paths = [] | ||
globs.each do |glob| | ||
paths += Dir.glob glob | ||
end | ||
paths.uniq | ||
end | ||
|
||
def self.load globs | ||
self.unique_paths(globs).each do |path| | ||
def self.load(patterns) | ||
self.unique_paths(patterns).each do |path| | ||
puts path | ||
require path | ||
end | ||
end | ||
|
||
private | ||
|
||
def self.unique_paths(patterns) | ||
patterns.inject([]) { |paths, pattern| | ||
paths += Dir.glob(pattern) | ||
}.uniq | ||
end | ||
end | ||
end | ||
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
Oops, something went wrong.