Permalink
Browse files

remove plugin injection stuff

  • Loading branch information...
1 parent 77d76b2 commit f530f2a5d0e75ba30d991ce363b88e929a9176dc @mmcgrana mmcgrana committed Dec 13, 2012
Showing with 3 additions and 81 deletions.
  1. +2 −18 README.md
  2. +0 −22 Rakefile
  3. +0 −35 lib/language_pack/rails2.rb
  4. +1 −6 lib/language_pack/rails3.rb
View
@@ -56,21 +56,12 @@ Example Usage:
-----> Installing dependencies using Bundler version 1.1.rc
...
-----> Writing config/database.yml to read from DATABASE_URL
- -----> Rails plugin injection
- Injecting rails_log_stdout
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
The buildpack will detect your app as a Rails 2 app if it has a `environment.rb` file in the `config` directory.
-#### Rails Log STDOUT
- A [rails_log_stdout](http://github.com/ddollar/rails_log_stdout) is installed by default so Rails' logger will log to STDOUT and picked up by Heroku's [logplex](http://github.com/heroku/logplex).
-
-#### Auto Injecting Plugins
-
-Any vendored plugin can be stopped from being installed by creating the directory it's installed to in the slug. For instance, to prevent rails_log_stdout plugin from being injected, add `vendor/plugins/rails_log_stdout/.gitkeep` to your git repo.
-
### Rails 3
Example Usage:
@@ -92,9 +83,6 @@ Example Usage:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
- -----> Rails plugin injection
- Injecting rails_log_stdout
- Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> web
Default types for Ruby/Rails -> console, rake, worker
@@ -110,7 +98,7 @@ Hacking
To use this buildpack, fork it on Github. Push up changes to your fork, then create a test app with `--buildpack <your-github-url>` and push to it.
-To change the vendored binaries for Bundler, [Node.js](http://github.com/joyent/node), and rails plugins, use the rake tasks provided by the `Rakefile`. You'll need an S3-enabled AWS account and a bucket to store your binaries in as well as the [vulcan](http://github.com/ddollar/vulcan) gem to build the binaries on heroku.
+To change the vendored binaries for Bundler and [Node.js](http://github.com/joyent/node), use the rake tasks provided by the `Rakefile`. You'll need an S3-enabled AWS account and a bucket to store your binaries in as well as the [vulcan](http://github.com/ddollar/vulcan) gem to build the binaries on heroku.
For example, you can change the vendored version of Bundler to 1.1.rc.
@@ -132,7 +120,7 @@ Commit and push the changes to your buildpack to your Github fork, then push you
-----> Installing dependencies using Bundler version 1.1.rc
-NOTE: You'll need to vendor the plugins, node, Bundler, and libyaml by running the rake tasks for the buildpack to work properly.
+NOTE: You'll need to vendor the node, Bundler, and libyaml by running the rake tasks for the buildpack to work properly.
Flow
----
@@ -155,12 +143,8 @@ Rails 2 (config/environment.rb is detected)
* everything from Rack
* sets RAILS_ENV=production
-* install rails 2 plugins
- * [rails_log_stdout](http://github.com/ddollar/rails_log_stdout)
Rails 3 (config/application.rb is detected)
* everything from Rails 2
-* install rails 3 plugins
- * [rails3_server_static_assets](https://github.com/pedro/rails3_serve_static_assets)
View
@@ -12,21 +12,6 @@ def s3_upload(tmpdir, name)
sh("#{s3_tools_dir}/s3 put #{S3_BUCKET_NAME} #{name}.tgz #{tmpdir}/#{name}.tgz")
end
-def vendor_plugin(git_url, branch = nil)
- name = File.basename(git_url, File.extname(git_url))
- Dir.mktmpdir("#{name}-") do |tmpdir|
- FileUtils.rm_rf("#{tmpdir}/*")
-
- Dir.chdir(tmpdir) do
- sh "git clone #{git_url} ."
- sh "git checkout origin/#{branch}" if branch
- FileUtils.rm_rf("#{name}/.git")
- sh("tar czvf #{tmpdir}/#{name}.tgz *")
- s3_upload(tmpdir, name)
- end
- end
-end
-
def in_gem_env(gem_home, &block)
old_gem_home = ENV['GEM_HOME']
old_gem_path = ENV['GEM_PATH']
@@ -84,13 +69,6 @@ def build_rbx_command(name, output, prefix, usr_dir, tmpdir, ruby_version)
s3_upload(tmpdir, output)
end
-desc "update plugins"
-task "plugins:update" do
- vendor_plugin "http://github.com/heroku/rails_log_stdout.git", "legacy"
- vendor_plugin "http://github.com/pedro/rails3_serve_static_assets.git"
- vendor_plugin "http://github.com/hone/rails31_enable_runtime_asset_compilation.git"
-end
-
desc "install vendored gem"
task "gem:install", :gem, :version do |t, args|
gem = args[:gem]
@@ -34,43 +34,8 @@ def default_process_types
})
end
- def compile
- super
- install_plugins
- end
-
private
- # list of plugins to be installed
- # @return [Array] resulting list in a String Array
- def plugins
- %w( rails_log_stdout )
- end
-
- # the root path of where the plugins are to be installed from
- # @return [String] the resulting path
- def plugin_root
- File.expand_path("../../../vendor/plugins", __FILE__)
- end
-
- # vendors all the plugins into the slug
- def install_plugins
- topic "Rails plugin injection"
- plugins.each { |plugin| install_plugin(plugin) }
- end
-
- # vendors an individual plugin
- # @param [String] name of the plugin
- def install_plugin(name)
- plugin_dir = "vendor/plugins/#{name}"
- return if File.exist?(plugin_dir)
- puts "Injecting #{name}"
- FileUtils.mkdir_p plugin_dir
- Dir.chdir(plugin_dir) do |dir|
- run("curl #{VENDOR_URL}/#{name}.tgz -s -o - | tar xzf -")
- end
- end
-
# most rails apps need a database
# @return [Array] shared database addon
def add_shared_database_addon
@@ -29,10 +29,6 @@ def default_process_types
private
- def plugins
- super.concat(%w( rails3_serve_static_assets )).uniq
- end
-
# runs the tasks for the Rails 3.1 asset pipeline
def run_assets_precompile_rake_task
log("assets_precompile") do
@@ -55,8 +51,7 @@ def run_assets_precompile_rake_task
puts "Asset precompilation completed (#{"%.2f" % time}s)"
else
log "assets_precompile", :status => "failure"
- puts "Precompiling assets failed, enabling runtime asset compilation"
- install_plugin("rails31_enable_runtime_asset_compilation")
+ puts "Precompiling assets failed"
puts "Please see this article for troubleshooting help:"
puts "http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting"
end

0 comments on commit f530f2a

Please sign in to comment.