Skip to content
Browse files

Version bump to 0.0.0

  • Loading branch information...
1 parent f7e6d64 commit c77e6832585b8e7bf29c9642b7379aac4a118d58 @amfranz committed Nov 29, 2010
Showing with 224 additions and 0 deletions.
  1. +5 −0 .document
  2. +42 −0 .gitignore
  3. +4 −0 Gemfile
  4. +16 −0 Gemfile.lock
  5. +20 −0 LICENSE.txt
  6. +19 −0 README.rdoc
  7. +39 −0 Rakefile
  8. +1 −0 VERSION
  9. +78 −0 lib/database_yml/capistrano.rb
View
5 .document
@@ -0,0 +1,5 @@
+lib/**/*.rb
+bin/*
+-
+features/**/*.feature
+LICENSE.txt
View
42 .gitignore
@@ -0,0 +1,42 @@
+# rcov generated
+coverage
+
+# rdoc generated
+rdoc
+
+# yard generated
+doc
+.yardoc
+
+# bundler
+.bundle
+
+# jeweler generated
+pkg
+
+# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
+#
+# * Create a file at ~/.gitignore
+# * Include files you want ignored
+# * Run: git config --global core.excludesfile ~/.gitignore
+#
+# After doing this, these files will be ignored in all your git projects,
+# saving you from having to 'pollute' every project you touch with them
+#
+# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
+#
+# For MacOS:
+#
+#.DS_Store
+#
+# For TextMate
+#*.tmproj
+#tmtags
+#
+# For emacs:
+#*~
+#\#*
+#.\#*
+#
+# For vim:
+#*.swp
View
4 Gemfile
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+gem "bundler", "~> 1.0.0"
+gem "jeweler", "~> 1.5.1"
View
16 Gemfile.lock
@@ -0,0 +1,16 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ git (1.2.5)
+ jeweler (1.5.1)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ rake (0.8.7)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.0)
+ jeweler (~> 1.5.1)
View
20 LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Michael Franz Aigner
+
+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
19 README.rdoc
@@ -0,0 +1,19 @@
+= capistrano_database_yml
+
+Description goes here.
+
+== Contributing to capistrano_database_yml
+
+* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
+* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
+* Fork the project
+* Start a feature/bugfix branch
+* Commit and push until you are happy with your contribution
+* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
+* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
+
+== Copyright
+
+Copyright (c) 2010 Michael Franz Aigner. See LICENSE.txt for
+further details.
+
View
39 Rakefile
@@ -0,0 +1,39 @@
+require 'rubygems'
+require 'bundler'
+begin
+ Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
+require 'rake'
+
+require 'jeweler'
+Jeweler::Tasks.new do |gem|
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
+ gem.name = "capistrano_database_yml"
+ gem.homepage = "http://github.com/amfranz/capistrano_database_yml"
+ gem.license = "MIT"
+ gem.summary = %Q{TODO: one-line summary of your gem}
+ gem.description = %Q{TODO: longer description of your gem}
+ gem.email = "amfranz@gmail.com"
+ gem.authors = ["Michael Franz Aigner"]
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
+end
+Jeweler::RubygemsDotOrgTasks.new
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "capistrano_database_yml #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
1 VERSION
@@ -0,0 +1 @@
+0.0.0
View
78 lib/database_yml/capistrano.rb
@@ -0,0 +1,78 @@
+#
+# = Capistrano database.yml task
+#
+# Provides a couple of tasks for creating the database.yml
+# configuration file dynamically when deploy:setup is run.
+#
+# Category:: Capistrano
+# Package:: Database
+# Author:: Simone Carletti
+# Copyright:: 2007-2009 The Authors
+# License:: MIT License
+# Link:: http://www.simonecarletti.com/
+# Source:: http://gist.github.com/2769
+#
+#
+
+unless Capistrano::Configuration.respond_to?(:instance)
+ abort "This extension requires Capistrano 2"
+end
+
+Capistrano::Configuration.instance.load do
+
+ namespace :db do
+
+ desc <<-DESC
+ Creates the database.yml configuration file in shared path.
+
+ By default, this task uses a template unless a template \
+ called database.yml.erb is found either is :template_dir \
+ or /config/deploy folders. The default template matches \
+ the template for config/database.yml file shipped with Rails.
+
+ When this recipe is loaded, db:setup is automatically configured \
+ to be invoked after deploy:setup. You can skip this task setting \
+ the variable :skip_db_setup to true. This is especially useful \
+ if you are using this recipe in combination with \
+ capistrano-ext/multistaging to avoid multiple db:setup calls \
+ when running deploy:setup for all stages one by one.
+ DESC
+ task :setup, :except => { :no_release => true } do
+
+ default_template = <<-EOF
+ base: &base
+ adapter: sqlite3
+ timeout: 5000
+ development:
+ database: #{shared_path}/db/development.sqlite3
+ <<: *base
+ test:
+ database: #{shared_path}/db/test.sqlite3
+ <<: *base
+ production:
+ database: #{shared_path}/db/production.sqlite3
+ <<: *base
+ EOF
+
+ location = fetch(:template_dir, "config/deploy") + '/database.yml.erb'
+ template = File.file?(location) ? File.read(location) : default_template
+
+ config = ERB.new(template)
+
+ run "mkdir -p #{shared_path}/db"
+ run "mkdir -p #{shared_path}/config"
+ put config.result(binding), "#{shared_path}/config/database.yml"
+ end
+
+ desc <<-DESC
+ [internal] Updates the symlink for database.yml file to the just deployed release.
+ DESC
+ task :symlink, :except => { :no_release => true } do
+ run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
+ end
+
+ end
+
+ after "deploy:setup", "db:setup" unless fetch(:skip_db_setup, false)
+ after "deploy:finalize_update", "db:symlink"
+end

0 comments on commit c77e683

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