Skip to content
Browse files

Reorganizing gem to be heroku-rails

  • Loading branch information...
1 parent 9f8ae6b commit 6211c6287af98c0a424c89f7dcb27a521e645211 @jacquescrocker jacquescrocker committed
Showing with 303 additions and 239 deletions.
  1. +1 −0 .rvmrc
  2. +7 −0 CHANGELOG
  3. +8 −0 Gemfile
  4. +40 −17 LICENSE
  5. +117 −0 README.md
  6. +0 −102 README.rdoc
  7. +39 −18 Rakefile
  8. +0 −1 VERSION
  9. +36 −0 heroku_rails.gemspec
  10. +0 −47 heroku_san.gemspec
  11. +9 −0 lib/heroku-rails.rb
  12. +42 −0 lib/heroku/rails/config.rb
  13. +3 −1 lib/{heroku_san → heroku/rails}/tasks.rb
  14. +0 −2 lib/heroku_san.rb
  15. +0 −40 lib/heroku_san/config.rb
  16. +0 −10 lib/heroku_san/railtie.rb
  17. +1 −1 lib/tasks/heroku.rake
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.8.7@heroku_rails_dev
View
7 CHANGELOG
@@ -1,3 +1,10 @@
+Heroku Rails
+v0.0.1
+============================================
+Initial fork and reorganization
+
+
+Heroku Sans
v0.2.0
============================================
View
8 Gemfile
@@ -0,0 +1,8 @@
+source :rubygems
+gemspec
+
+gem "ruby-debug", :platforms => :mri_18
+gem "ruby-debug19", :platforms => :mri_19
+
+gem "autotest", ">= 0"
+gem "growl-glue", ">= 0"
View
57 LICENSE
@@ -1,20 +1,43 @@
-Copyright (c) 2008 Elijah Miller
+Heroku Rails License:
+ Copyright (c) 2010 Jacques Crocker
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Heroku Sans License:
+ Copyright (c) 2008 Elijah Miller
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
117 README.md
@@ -0,0 +1,117 @@
+Heroku Rails
+=============
+
+Easier configuration and deployment of Rails apps on Heroku
+
+Configure your Heroku environment via a YML file (config/heroku.yml) that defines all your environments, addons, and environment variables.
+
+Heroku Rails also handles asset packaging (via jammit), deployment of assets to s3 (via jammit-s3).
+
+## Install
+
+### Rails 3
+
+Add this to your Gemfile:
+
+ group :development do
+ gem 'heroku-rails'
+ end
+
+### Rails 2
+
+To install add the following to config/environment.rb:
+
+ config.gem 'heroku-rails'
+
+Rake tasks are not automatically loaded from gems, so you’ll need to add the following to your Rakefile:
+
+ begin
+ require 'heroku/rails/tasks'
+ rescue LoadError
+ STDERR.puts "Run `rake gems:install` to install heroku-rails"
+ end
+
+## Configure
+
+In config/heroku.yml you will need add the Heroku apps that you would like to attach to this project. You can generate this file and edit it by running:
+
+ rake heroku:create_config
+
+If this is a fresh project, heroku_san can create all the applications for
+you, and set the RACK_ENV.
+
+ rake all heroku:create heroku:rack_env
+
+## Usage
+
+After configuring your Heroku apps you can use rake tasks to control the
+apps.
+
+ rake production deploy
+
+A rake task with the shorthand name of each app is now available and adds that
+server to the list that subsequent commands will execute on. Because this list
+is additive, you can easily select which servers to run a command on.
+
+ rake demo staging restart
+
+A special rake task 'all' is created that causes any further commands to
+execute on all heroku apps.
+
+Manipulate collaborators on all this project's apps (prompts for email
+address):
+
+ rake all heroku:share
+ rake all heroku:unshare
+
+Need to add remotes for each app?
+
+ rake all heroku:remotes
+
+A full list of tasks provided:
+
+ rake all # Select all Heroku apps for later command
+ rake console # Opens a remote console
+ rake deploy # Deploys, migrates and restarts latest code.
+ rake after_deploy # Callback run after the overall deploy
+ rake after_each_deploy # Callback run after each environment's deploy
+ rake before_deploy # Callback run before the overall deploy
+ rake before_each_deploy # Callback run before each environment's deploy
+ rake capture # Captures a bundle on Heroku
+ rake heroku:apps # Lists configured apps
+ rake heroku:create # Creates the Heroku app
+ rake heroku:create_config # Creates an example configuration file
+ rake heroku:gems # Generate the Heroku gems manifest from gem dependencies
+ rake heroku:remotes # Add git remotes for all apps in this project
+ rake heroku:rack_env # Add proper RACK_ENV to each application
+ rake heroku:share # Adds a collaborator
+ rake heroku:unshare # Removes a collaborator
+ rake migrate # Migrates and restarts remote servers
+ rake restart # Restarts remote servers
+
+Frequently used tasks are not namespaced, everything else lives under heroku.
+
+## About Heroku Rails
+
+### Links
+
+Homepage:: http://github.com/railsjedi/heroku-rails
+Issue Tracker:: http://github.com/railsjedi/heroku-rails/issues
+
+### License
+
+License:: Copyright (c) 2010 [Jacques Crocker](mailto:railsjedi@gmail.com), released under the MIT license.
+
+## Forked from Heroku Sans
+
+Heroku Rails is a fork and rewrite/reorganiziation of Heroku Sans, and a nice simple set of Rake tasks for managing Heroku environments. Check out that project here: http://github.com/fastestforward/heroku_san
+
+### Heroku Sans Contributors
+
+* Elijah Miller (elijah.miller@gmail.com)
+* Glenn Roberts (glenn.roberts@siyelo.com)
+* Damien Mathieu (42@dmathieu.com)
+
+### Heroku Sans License
+
+License:: Copyright (c) 2009 Elijah Miller <mailto:elijah.miller@gmail.com>, released under the MIT license.
View
102 README.rdoc
@@ -1,102 +0,0 @@
-= Heroku San
-
-Helpful rake tasks for Heroku.
-
-== Install
-
-=== Rails 3
-
-Add this to your Gemfile:
-
- group :development do
- gem 'heroku_san'
- end
-
-=== Rails 2
-
-To install add the following to config/environment.rb:
-
- config.gem 'heroku_san'
-
-Rake tasks are not automatically loaded from gems, so you’ll need to add the following to your Rakefile:
-
- begin
- require 'heroku_san/tasks'
- rescue LoadError
- STDERR.puts "Run `rake gems:install` to install heroku_san"
- end
-
-== Configure
-
-In config/heroku.yml you will need add the Heroku apps that you would like to attach to this project. You can generate this file and edit it by running:
-
- rake heroku:create_config
-
-If this is a fresh project, heroku_san can create all the applications for
-you, and set the RACK_ENV.
-
- rake all heroku:create heroku:rack_env
-
-== Usage
-
-After configuring your Heroku apps you can use rake tasks to control the
-apps.
-
- rake production deploy
-
-A rake task with the shorthand name of each app is now available and adds that
-server to the list that subsequent commands will execute on. Because this list
-is additive, you can easily select which servers to run a command on.
-
- rake demo staging restart
-
-A special rake task 'all' is created that causes any further commands to
-execute on all heroku apps.
-
-Manipulate collaborators on all this project's apps (prompts for email
-address):
-
- rake all heroku:share
- rake all heroku:unshare
-
-Need to add remotes for each app?
-
- rake all heroku:remotes
-
-A full list of tasks provided:
-
- rake all # Select all Heroku apps for later command
- rake console # Opens a remote console
- rake deploy # Deploys, migrates and restarts latest code.
- rake after_deploy # Callback run after the overall deploy
- rake after_each_deploy # Callback run after each environment's deploy
- rake before_deploy # Callback run before the overall deploy
- rake before_each_deploy # Callback run before each environment's deploy
- rake capture # Captures a bundle on Heroku
- rake heroku:apps # Lists configured apps
- rake heroku:create # Creates the Heroku app
- rake heroku:create_config # Creates an example configuration file
- rake heroku:gems # Generate the Heroku gems manifest from gem dependencies
- rake heroku:remotes # Add git remotes for all apps in this project
- rake heroku:rack_env # Add proper RACK_ENV to each application
- rake heroku:share # Adds a collaborator
- rake heroku:unshare # Removes a collaborator
- rake migrate # Migrates and restarts remote servers
- rake restart # Restarts remote servers
-
-Frequently used tasks are not namespaced, everything else lives under heroku.
-
-== Links
-
-Homepage:: http://github.com/fastestforward/heroku_san
-Issue Tracker:: http://github.com/fastestforward/heroku_san/issues
-
-== Contributors
-
-* Elijah Miller (elijah.miller@gmail.com)
-* Glenn Roberts (glenn.roberts@siyelo.com)
-* Damien Mathieu (42@dmathieu.com)
-
-== License
-
-License:: Copyright (c) 2009 Elijah Miller <mailto:elijah.miller@gmail.com>, released under the MIT license.
View
57 Rakefile
@@ -1,22 +1,43 @@
+require "bundler"
+Bundler.setup
+
require 'rake'
+require 'rake/gempackagetask'
+
+gemspec = eval(File.read('heroku-rails.gemspec'))
+Rake::GemPackageTask.new(gemspec) do |pkg|
+ pkg.gem_spec = gemspec
+end
+
+desc "build the gem and release it to rubygems.org"
+task :release => :gem do
+ puts "Tagging #{gemspec.version}..."
+ system "git tag -a #{gemspec.version} -m 'Tagging #{gemspec.version}'"
+ puts "Pushing to Github..."
+ system "git push --tags"
+ puts "Pushing to rubygems.org..."
+ system "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem"
+end
+
+require "rspec"
+require "rspec/core/rake_task"
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "heroku_san"
- gem.summary = %Q{A bunch of useful Rake tasks for managing your Heroku apps}
- gem.description = %Q{Manage multiple Heroku instances/apps for a single Rails app using Rake}
- gem.email = "elijah.miller@gmail.com"
- gem.homepage = "http://github.com/glennr/heroku_san"
- gem.authors = ["Elijah Miller", "Glenn Roberts"]
- gem.files = Dir["{lib}/**/*", "VERSION", "LICENSE", "CHANGELOG", "TODO", "README.rdoc", "Rakefile"]
- gem.extra_rdoc_files = []
- gem.add_dependency("heroku")
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+Rspec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = "spec/**/*_spec.rb"
end
-desc 'Default: build gem.'
-task :default => :build
+Rspec::Core::RakeTask.new('spec:progress') do |spec|
+ spec.rspec_opts = %w(--format progress)
+ spec.pattern = "spec/**/*_spec.rb"
+end
+
+require "rake/rdoctask"
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = "rdoc"
+ rdoc.title = "Heroku Rails #{gemspec.version}"
+ rdoc.rdoc_files.include("README*")
+ rdoc.rdoc_files.include("lib/**/*.rb")
+end
+
+
+task :default => :spec
View
1 VERSION
@@ -1 +0,0 @@
-1.0.2
View
36 heroku_rails.gemspec
@@ -0,0 +1,36 @@
+Gem::Specification.new do |s|
+ s.name = "heroku-rails"
+ s.version = "0.0.1"
+
+ s.authors = ["Elijah Miller", "Glenn Roberts", "Jacques Crocker"]
+ s.summary = "A bunch of useful Rake tasks for managing your Heroku apps"
+ s.description = "Manage multiple Heroku instances/apps for a single Rails app using Rake"
+
+ s.email = "railsjedi@gmail.com"
+ s.homepage = "http://github.com/railsjedi/heroku-rails"
+
+ s.require_paths = ["lib"]
+ s.files = Dir['lib/**/*',
+ 'spec/**/*',
+ 'heroku-rails.gemspec',
+ 'Gemfile',
+ 'Gemfile.lock',
+ 'CHANGELOG',
+ 'LICENSE',
+ 'Rakefile',
+ 'README.md',
+ 'TODO']
+
+ s.test_files = Dir['spec/**/*']
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.md",
+ "TODO",
+ "CHANGELOG"
+ ]
+
+ s.add_runtime_dependency("heroku")
+ s.add_development_dependency "rspec", "~> 2.0"
+end
+
View
47 heroku_san.gemspec
@@ -1,47 +0,0 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{heroku_san}
- s.version = "1.0.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Elijah Miller", "Glenn Roberts"]
- s.date = %q{2010-10-22}
- s.description = %q{Manage multiple Heroku instances/apps for a single Rails app using Rake}
- s.email = %q{elijah.miller@gmail.com}
- s.files = [
- "CHANGELOG",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "TODO",
- "VERSION",
- "lib/heroku_san.rb",
- "lib/heroku_san/railtie.rb",
- "lib/heroku_san/tasks.rb",
- "lib/tasks/heroku.rake",
- "lib/templates/heroku.example.yml"
- ]
- s.homepage = %q{http://github.com/glennr/heroku_san}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{A bunch of useful Rake tasks for managing your Heroku apps}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<heroku>, [">= 0"])
- else
- s.add_dependency(%q<heroku>, [">= 0"])
- end
- else
- s.add_dependency(%q<heroku>, [">= 0"])
- end
-end
-
View
9 lib/heroku-rails.rb
@@ -0,0 +1,9 @@
+module Heroku
+ module Rails
+ class Railtie < ::Rails::Railtie
+ rake_tasks do
+ load 'heroku/rails/tasks.rb'
+ end
+ end
+ end
+end
View
42 lib/heroku/rails/config.rb
@@ -0,0 +1,42 @@
+module Heroku
+ module Rails
+ class Config
+
+ attr_accessor :settings
+
+ def initialize(config_filepath)
+ if File.exists?(config_filepath)
+ self.settings = YAML.load_file(HEROKU_CONFIG_FILE)
+ else
+ self.settings = {}
+ end
+ end
+
+ # pull out the stack setting for a particular app environment
+ def stack(app = 'all')
+ # TODO
+ end
+
+ # pull out the config setting hash for a particular app environment
+ def config(app = 'all')
+ # TODO
+ end
+
+ # return a list of collaborators for a particular app environment
+ def collaborators(app = 'all')
+ # TODO
+ end
+
+ # return a list of domains for a particular app environment
+ def domains(app = 'all')
+ # TODO
+ end
+
+ # return a list of addons for a particular app environment
+ def addons(app = 'addons')
+ # TODO
+ end
+
+ end
+ end
+end
View
4 lib/heroku_san/tasks.rb → lib/heroku/rails/tasks.rb
@@ -1,5 +1,7 @@
HEROKU_CONFIG_FILE = Rails.root.join('config', 'heroku.yml')
-HEROKU_CONFIG = HerokuSan::Config.new(HEROKU_CONFIG_FILE)
+
+require 'heroku/rails/config'
+HEROKU_CONFIG = Heroku::Rails::Config.new(HEROKU_CONFIG_FILE)
(HEROKU_CONFIG.settings['apps'] || []).each do |name, app|
desc "Select #{name} Heroku app for later commands"
View
2 lib/heroku_san.rb
@@ -1,2 +0,0 @@
-require 'heroku_san/config'
-require 'heroku_san/railtie' if defined?(Rails) && Rails::VERSION::MAJOR == 3
View
40 lib/heroku_san/config.rb
@@ -1,40 +0,0 @@
-module HerokuSan
- class Config
-
- attr_accessor :settings
-
- def initialize(config_filepath)
- if File.exists?(config_filepath)
- self.settings = YAML.load_file(HEROKU_CONFIG_FILE)
- else
- self.settings = {}
- end
- end
-
- # pull out the stack setting for a particular app environment
- def stack(app = 'all')
- # TODO
- end
-
- # pull out the config setting hash for a particular app environment
- def config(app = 'all')
- # TODO
- end
-
- # return a list of collaborators for a particular app environment
- def collaborators(app = 'all')
- # TODO
- end
-
- # return a list of domains for a particular app environment
- def domains(app = 'all')
- # TODO
- end
-
- # return a list of addons for a particular app environment
- def addons(app = 'addons')
- # TODO
- end
-
- end
-end
View
10 lib/heroku_san/railtie.rb
@@ -1,10 +0,0 @@
-require 'heroku_san'
-require 'rails'
-
-module HerokuSan
- class Railtie < Rails::Railtie
- rake_tasks do
- load 'heroku_san/tasks.rb'
- end
- end
-end
View
2 lib/tasks/heroku.rake
@@ -1 +1 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'heroku_san', 'tasks'))
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'heroku', 'rails', 'tasks'))

0 comments on commit 6211c62

Please sign in to comment.
Something went wrong with that request. Please try again.