tsukuru 0.3.1 → 0.4.0

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/tsukuru +16 -5
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
data/bin/tsukuru CHANGED
@@ -7,6 +7,7 @@ require 'ruby-unix-now'
7
7
  require 'optparse'
8
8
  require 'pathname'
9
9
  require 'fileutils'
10
+ require 'yaml'
10
11
 
11
12
  options = Struct.new(:capture, :local, :reindex, :app, :target, :current, :username, :password).new
12
13
 
@@ -125,15 +126,25 @@ db_file = options.current + 'db/pgdump.sql'
125
126
 
126
127
  run :dropdb, options.app if `psql --list`.include?(options.app)
127
128
  run :createdb, options.app
128
- run :sed, "-i '' -E 's/Owner: [a-z]+/Owner: #{options.app}/g'", db_file
129
- run :sed, "-i '' -E 's/OWNER TO [a-z]+/OWNER TO #{options.app}/g'", db_file
130
- run :psql, :q, :f => db_file, :d => options.app
129
+ run :sed, "-i '' -E '/^ALTER .* OWNER/d'", db_file
130
+ run :sed, "-i '' -E '/^ALTER .* OWNED/d'", db_file
131
+ run :psql, :q, {:f => db_file, :d => options.app}, '> /dev/null'
131
132
 
132
133
  database_config = options.current + 'config/database.yml'
133
134
  if File.exist?(database_config)
134
- in_app "sed -i '' -E 's/database: alpha_dev/database: #{options.app}/g'", database_config
135
+ puts 'Writing database configuration'
136
+ File.open(database_config, 'w') do |file|
137
+ config = {'fallback' => {
138
+ 'adapter' => 'postgresql',
139
+ 'host' => 'localhost',
140
+ 'min_messages' => 'warning',
141
+ 'encoding' =>'utf-8',
142
+ 'timeout' => 5000,
143
+ 'database' => options.app}}
144
+ file.puts(config.to_yaml)
145
+ end
135
146
  end
136
- in_app 'bundle install --without shell'
147
+ in_app 'bundle install --without shell --relock'
137
148
 
138
149
 
139
150
  if options.reindex
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
8
- - 1
9
- version: 0.3.1
7
+ - 4
8
+ - 0
9
+ version: 0.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tor Erik Linnerud