Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 2b7a3a57918fd81ae429048dbbfca48760bea1c8 @kirs kirs committed Jul 30, 2013
Showing with 78 additions and 0 deletions.
  1. +4 −0 Gemfile
  2. +32 −0 README.md
  3. +1 −0 Rakefile
  4. +20 −0 capistrano-rails.gemspec
  5. 0 lib/capistrano-rbenv.rb
  6. +3 −0 lib/capistrano/rbenv.rb
  7. +18 −0 lib/capistrano/tasks/rbenv.rake
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in capistrano-rails.gemspec
+gemspec
@@ -0,0 +1,32 @@
+# Capistrano::rbenv
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'capistrano', version: '~> 3.0.0'
+ gem 'capistrano-rbenv', github: "capistrano/rbenv"
+
+And then execute:
+
+ $ bundle --binstubs
+ $ cap install
+
+## Usage
+
+ # Capfile
+
+ require 'capistrano/rbenv'
+
+ set :rbenv_type, :user # or system, depends on your rbenv setup
+ set :rbenv_ruby_version, '2.0.0-p247'
+
+If your rbenv is located in some custom path, you can use `rbenv_custom_path` to set it.
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Add some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
@@ -0,0 +1,20 @@
+# -*- encoding: utf-8 -*-
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+
+Gem::Specification.new do |gem|
+ gem.name = "capistrano-rbenv"
+ gem.version = '0.0.1'
+ gem.authors = ["Kir Shatrov"]
+ gem.email = ["shatrov@me.com"]
+ gem.description = %q{rbenv integration for Capistrano}
+ gem.summary = %q{rbenv integration for Capistrano}
+ gem.homepage = "https://github.com/capistrano/rbenv"
+
+ gem.files = `git ls-files`.split($/)
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.require_paths = ["lib"]
+
+ gem.add_dependency 'capistrano'
+
+end
No changes.
@@ -0,0 +1,3 @@
+require 'sshkit'
+
+load File.expand_path("../tasks/rbenv.rake", __FILE__)
@@ -0,0 +1,18 @@
+namespace :deploy do
+ before :starting, :hook_rbenv_bins do
+ rbenv_path = fetch(:rbenv_custom_path)
+ rbenv_path ||= if fetch(:rbenv_type) == "system"
+ "/usr/local/rbenv"
+ else
+ "~/.rbenv"
+ end
+
+ SSHKit.config.command_map = Hash.new do |hash, key|
+ if %w{ruby rake gem bundle}.include?(key.to_s)
+ hash[key] = "#{rbenv_path}/versions/#{fetch(:rbenv_ruby_version)}/bin/#{key}"
+ else
+ hash[key] = key
+ end
+ end
+ end
+end

0 comments on commit 2b7a3a5

Please sign in to comment.