forked from qnyp/heroku-buildpack-ruby-bower
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 heroku#126 from heroku/schneems/plugin-warnings
Clean up plugin logic and warning text
- Loading branch information
Showing
7 changed files
with
63 additions
and
52 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,5 +1,9 @@ | ||
## Master | ||
|
||
Features: | ||
|
||
* Don't add plugins if already gems | ||
|
||
Bugfixes: | ||
|
||
* Fix issue #127 Race condition with LPXC | ||
|
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,38 @@ | ||
require "language_pack/shell_helpers" | ||
|
||
module LanguagePack | ||
module Helpers | ||
# Takes an array of plugin names and vendor_url | ||
# fetches plugins from url, installs them | ||
class PluginsInstaller | ||
attr_accessor :plugins, :vendor_url | ||
include LanguagePack::ShellHelpers | ||
|
||
def initialize(plugins, vendor_url = LanguagePack::Base::VENDOR_URL) | ||
@plugins = plugins || [] | ||
@vendor_url = vendor_url | ||
end | ||
|
||
# vendors all the plugins into the slug | ||
def install | ||
return true unless plugins.any? | ||
plugins.each { |plugin| vendor(plugin) } | ||
end | ||
|
||
def plugin_dir(name = "") | ||
Pathname.new("vendor/plugins").join(name) | ||
end | ||
|
||
# vendors an individual plugin | ||
# @param [String] name of the plugin | ||
def vendor(name) | ||
directory = plugin_dir(name) | ||
return true if directory.exist? | ||
directory.mkpath | ||
Dir.chdir(directory) do |dir| | ||
run("curl #{vendor_url}/#{name}.tgz -s -o - | tar xzf -") | ||
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
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