This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename Ruby project to Rubygem, make Bundler mutator.
Among other things, this removes some more boilterplate in the Shantyfile by discovering things when we can.
- Loading branch information
1 parent
ac9436f
commit 2b9db68
Showing
5 changed files
with
35 additions
and
9 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,10 +1,2 @@ | ||
# FIXME: This shouldn't need to be required, can be auto-discovered. | ||
require 'shanty/projects/ruby' | ||
require 'shanty/plugins/bundler' | ||
require 'shanty/plugins/rspec' | ||
require 'shanty/plugins/rubocop' | ||
|
||
type RubyProject | ||
plugin ::Shanty::BundlerPlugin | ||
plugin ::Shanty::RspecPlugin | ||
plugin ::Shanty::RubocopPlugin |
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,17 @@ | ||
require 'shanty/discoverer' | ||
require 'shanty/projects/rubygem' | ||
|
||
module Shanty | ||
# Public: Discoverer for Shantyfiles | ||
# will create a a project for every Shantyfile it finds in | ||
# a directory | ||
class RubygemDiscoverer < Discoverer | ||
def discover | ||
Dir['**/*.gemspec'].map do |path| | ||
create_project_template(File.absolute_path(File.dirname(path))) do |project_template| | ||
project_template.type = RubygemProject | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'shanty/mutator' | ||
require 'shanty/plugins/bundler' | ||
|
||
module Shanty | ||
# Bundler mutator | ||
class BundlerMutator < Mutator | ||
def mutate(graph) | ||
graph.each do |project| | ||
BundlerPlugin.add_to_project(project) if File.exist?(File.join(project.path, 'Gemfile')) | ||
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