rails_database_yml 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/lib/rails_database_yml/capistrano.rb +30 -0
- data/lib/rails_database_yml/version.rb +3 -0
- data/lib/rails_database_yml.rb +5 -0
- data/rails_database_yml.gemspec +24 -0
- metadata +72 -0
data/Gemfile
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
|
2
|
+
namespace :rails_database do
|
|
3
|
+
# Creates a database.yml in shared/config path
|
|
4
|
+
task :setup do
|
|
5
|
+
template = <<-EOF
|
|
6
|
+
production:
|
|
7
|
+
adapter: mysql
|
|
8
|
+
encoding: utf8
|
|
9
|
+
reconnect: false
|
|
10
|
+
pool: 5
|
|
11
|
+
host: #{Capistrano::CLI.ui.ask("host: ")}
|
|
12
|
+
database: #{Capistrano::CLI.ui.ask("database: ")}
|
|
13
|
+
username: #{Capistrano::CLI.ui.ask("user: ")}
|
|
14
|
+
password: #{Capistrano::CLI.ui.ask("password: ")}
|
|
15
|
+
EOF
|
|
16
|
+
Capistrano::CLI.ui.say("Please specify the settings for your MySQL Database")
|
|
17
|
+
config = ERB.new(template)
|
|
18
|
+
|
|
19
|
+
run "mkdir -p #{shared_path}/config"
|
|
20
|
+
put config.result(binding), "#{shared_path}/config/database.yml"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Create a symlink to shared database.yml
|
|
24
|
+
task :symlink do
|
|
25
|
+
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
after "deploy:setup", "rails_database:setup"
|
|
29
|
+
after "deploy:update_code", "rails_database:symlink"
|
|
30
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "rails_database_yml/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = "rails_database_yml"
|
|
7
|
+
s.version = RailsDatabaseYml::VERSION
|
|
8
|
+
s.authors = ["Andreas Richter"]
|
|
9
|
+
s.email = ["ar@anrichter.net"]
|
|
10
|
+
s.homepage = ""
|
|
11
|
+
s.summary = %q{Tasks and files to help the handle the database.yml in rails projects.}
|
|
12
|
+
s.description = %q{This gem provide capistrano Tasks for the database.yml file in deployments of rails applications.}
|
|
13
|
+
|
|
14
|
+
s.rubyforge_project = "rails_database_yml"
|
|
15
|
+
|
|
16
|
+
s.files = `git ls-files`.split("\n")
|
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
19
|
+
s.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
# specify any dependencies here; for example:
|
|
22
|
+
# s.add_development_dependency "rspec"
|
|
23
|
+
# s.add_runtime_dependency "rest-client"
|
|
24
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: rails_database_yml
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 29
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 0
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.0.1
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- Andreas Richter
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2011-12-17 00:00:00 Z
|
|
19
|
+
dependencies: []
|
|
20
|
+
|
|
21
|
+
description: This gem provide capistrano Tasks for the database.yml file in deployments of rails applications.
|
|
22
|
+
email:
|
|
23
|
+
- ar@anrichter.net
|
|
24
|
+
executables: []
|
|
25
|
+
|
|
26
|
+
extensions: []
|
|
27
|
+
|
|
28
|
+
extra_rdoc_files: []
|
|
29
|
+
|
|
30
|
+
files:
|
|
31
|
+
- .gitignore
|
|
32
|
+
- Gemfile
|
|
33
|
+
- Rakefile
|
|
34
|
+
- lib/rails_database_yml.rb
|
|
35
|
+
- lib/rails_database_yml/capistrano.rb
|
|
36
|
+
- lib/rails_database_yml/version.rb
|
|
37
|
+
- rails_database_yml.gemspec
|
|
38
|
+
homepage: ""
|
|
39
|
+
licenses: []
|
|
40
|
+
|
|
41
|
+
post_install_message:
|
|
42
|
+
rdoc_options: []
|
|
43
|
+
|
|
44
|
+
require_paths:
|
|
45
|
+
- lib
|
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
|
+
none: false
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
hash: 3
|
|
52
|
+
segments:
|
|
53
|
+
- 0
|
|
54
|
+
version: "0"
|
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
|
+
none: false
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
hash: 3
|
|
61
|
+
segments:
|
|
62
|
+
- 0
|
|
63
|
+
version: "0"
|
|
64
|
+
requirements: []
|
|
65
|
+
|
|
66
|
+
rubyforge_project: rails_database_yml
|
|
67
|
+
rubygems_version: 1.8.10
|
|
68
|
+
signing_key:
|
|
69
|
+
specification_version: 3
|
|
70
|
+
summary: Tasks and files to help the handle the database.yml in rails projects.
|
|
71
|
+
test_files: []
|
|
72
|
+
|