daddy 0.3.37 → 0.3.38
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.
- checksums.yaml +4 -4
- data/lib/daddy/rails/railtie.rb +1 -4
- data/lib/daddy/tasks.rb +5 -0
- data/lib/daddy/version.rb +1 -1
- data/lib/tasks/cucumber_install.rake +3 -18
- data/lib/tasks/db/database.yml.erb +52 -0
- data/lib/tasks/db_config.rake +4 -3
- data/lib/tasks/db_create.rake +5 -1
- metadata +5 -4
- data/lib/tasks/database.yml.erb +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1cc05522ed0206954cc9bd86141a602c3e489d3f
|
|
4
|
+
data.tar.gz: 2a91636f3a4e59230a5f986f419989c9af20ec67
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 979d065eafcc1192b9277afba83c490c39f9dfc4df48537f0b67143503a4a878334f3cf33438ab6ba7f7e658129b6c4319269fafd867a42edfc6935aec0828fa
|
|
7
|
+
data.tar.gz: 83592048e7d71cd6a402ed12c5cf2a56c8c3ec9d3cd2a2f7150ce578419f0b33ef0538de4361ef59d062b0993e65ce3580aaf02b37f7db9f1621ff3a7343799c
|
data/lib/daddy/rails/railtie.rb
CHANGED
data/lib/daddy/tasks.rb
ADDED
data/lib/daddy/version.rb
CHANGED
|
@@ -4,30 +4,15 @@ namespace :dad do
|
|
|
4
4
|
namespace :cucumber do
|
|
5
5
|
task :install do
|
|
6
6
|
FileUtils.mkdir_p("features")
|
|
7
|
-
|
|
8
7
|
FileUtils.mkdir_p("features/step_definitions")
|
|
9
8
|
FileUtils.touch("features/step_definitions/.keep")
|
|
10
|
-
FileUtils.mkdir_p("features/step_definitions/開発日記")
|
|
11
|
-
FileUtils.touch("features/step_definitions/開発日記/.keep")
|
|
12
|
-
FileUtils.mkdir_p("features/step_definitions/仕様書")
|
|
13
|
-
FileUtils.touch("features/step_definitions/仕様書/.keep")
|
|
14
9
|
|
|
15
10
|
FileUtils.mkdir_p("features/support")
|
|
16
11
|
system("touch features/support/.keep")
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
FileUtils.touch("features/開発日記/.keep")
|
|
20
|
-
FileUtils.mkdir_p("features/仕様書")
|
|
21
|
-
FileUtils.touch("features/仕様書/.keep")
|
|
22
|
-
|
|
23
|
-
if File.exist?("features/support/env.rb")
|
|
24
|
-
puts "すでに features/support/env.rb が存在します。上書きはしません。"
|
|
25
|
-
else
|
|
26
|
-
File.write "features/support/env.rb", <<-EOF
|
|
27
|
-
require 'cucumber/rails'
|
|
12
|
+
File.write "features/support/env.rb", <<-EOF
|
|
13
|
+
require 'rails'
|
|
28
14
|
require 'daddy/cucumber'
|
|
29
|
-
|
|
30
|
-
end
|
|
15
|
+
EOF
|
|
31
16
|
end
|
|
32
17
|
end
|
|
33
18
|
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# MySQL. Versions 5.0+ are recommended.
|
|
2
|
+
#
|
|
3
|
+
# Install the MYSQL driver
|
|
4
|
+
# gem install mysql2
|
|
5
|
+
#
|
|
6
|
+
# Ensure the MySQL gem is defined in your Gemfile
|
|
7
|
+
# gem 'mysql2'
|
|
8
|
+
#
|
|
9
|
+
# And be sure to use new-style password hashing:
|
|
10
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
|
11
|
+
#
|
|
12
|
+
default: &default
|
|
13
|
+
adapter: mysql2
|
|
14
|
+
encoding: utf8
|
|
15
|
+
pool: 5
|
|
16
|
+
username: <%= @app_name %>
|
|
17
|
+
password: <%= @app_name %>
|
|
18
|
+
socket: /var/lib/mysql/mysql.sock
|
|
19
|
+
|
|
20
|
+
development:
|
|
21
|
+
<<: *default
|
|
22
|
+
database: <%= @app_name %>_dev
|
|
23
|
+
|
|
24
|
+
# Warning: The database defined as "test" will be erased and
|
|
25
|
+
# re-generated from your development database when you run "rake".
|
|
26
|
+
# Do not set this db to the same as development or production.
|
|
27
|
+
test:
|
|
28
|
+
<<: *default
|
|
29
|
+
database: <%= @app_name %>_test
|
|
30
|
+
|
|
31
|
+
# As with config/secrets.yml, you never want to store sensitive information,
|
|
32
|
+
# like your database password, in your source code. If your source code is
|
|
33
|
+
# ever seen by anyone, they now have access to your database.
|
|
34
|
+
#
|
|
35
|
+
# Instead, provide the password as a unix environment variable when you boot
|
|
36
|
+
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
|
|
37
|
+
# for a full rundown on how to provide these environment variables in a
|
|
38
|
+
# production deployment.
|
|
39
|
+
#
|
|
40
|
+
# On Heroku and other platform providers, you may have a full connection URL
|
|
41
|
+
# available as an environment variable. For example:
|
|
42
|
+
#
|
|
43
|
+
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
|
|
44
|
+
#
|
|
45
|
+
# You can use this database configuration with:
|
|
46
|
+
#
|
|
47
|
+
# production:
|
|
48
|
+
# url: <%= ENV['DATABASE_URL'] %>
|
|
49
|
+
#
|
|
50
|
+
production:
|
|
51
|
+
<<: *default
|
|
52
|
+
database: <%= @app_name %>_pro
|
data/lib/tasks/db_config.rake
CHANGED
|
@@ -5,9 +5,10 @@ namespace :dad do
|
|
|
5
5
|
|
|
6
6
|
desc 'database.yml を生成します。'
|
|
7
7
|
task :config do
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
@app_name = File.basename(Rails.root)[0..15]
|
|
9
|
+
|
|
10
|
+
template File.join(File.dirname(__FILE__), 'db/database.yml.erb')
|
|
11
|
+
render template, :to => 'config/database.yml'
|
|
11
12
|
end
|
|
12
13
|
end
|
|
13
14
|
end
|
data/lib/tasks/db_create.rake
CHANGED
|
@@ -11,6 +11,8 @@ namespace :dad do
|
|
|
11
11
|
system("echo '# mysql ddl' > tmp/create_databases.sql")
|
|
12
12
|
|
|
13
13
|
config.each do |env, props|
|
|
14
|
+
next if env == 'default'
|
|
15
|
+
|
|
14
16
|
puts "database for environment #{env}"
|
|
15
17
|
system("echo 'drop database if exists #{props['database']};' >> tmp/create_databases.sql")
|
|
16
18
|
system("echo 'create database #{props['database']};' >> tmp/create_databases.sql")
|
|
@@ -23,7 +25,9 @@ namespace :dad do
|
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
system("echo >> tmp/create_databases.sql")
|
|
26
|
-
|
|
28
|
+
|
|
29
|
+
puts
|
|
30
|
+
puts File.read('tmp/create_databases.sql')
|
|
27
31
|
|
|
28
32
|
if ENV['NO_ROOT_PASSWORD']
|
|
29
33
|
fail unless system("mysql -u root < tmp/create_databases.sql")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: daddy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.38
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ichy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capybara
|
|
@@ -287,6 +287,7 @@ files:
|
|
|
287
287
|
- lib/daddy/rails/engine.rb
|
|
288
288
|
- lib/daddy/rails/quiet_assets.rb
|
|
289
289
|
- lib/daddy/rails/railtie.rb
|
|
290
|
+
- lib/daddy/tasks.rb
|
|
290
291
|
- lib/daddy/utils/config.rb
|
|
291
292
|
- lib/daddy/utils/sql_utils.rb
|
|
292
293
|
- lib/daddy/utils/string_utils.rb
|
|
@@ -296,7 +297,7 @@ files:
|
|
|
296
297
|
- lib/tasks/cucumber_install.rake
|
|
297
298
|
- lib/tasks/cucumber_steps.rake
|
|
298
299
|
- lib/tasks/dad.rake
|
|
299
|
-
- lib/tasks/database.yml.erb
|
|
300
|
+
- lib/tasks/db/database.yml.erb
|
|
300
301
|
- lib/tasks/db_config.rake
|
|
301
302
|
- lib/tasks/db_create.rake
|
|
302
303
|
- lib/tasks/db_dump.rake
|
|
@@ -374,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
374
375
|
version: '0'
|
|
375
376
|
requirements: []
|
|
376
377
|
rubyforge_project:
|
|
377
|
-
rubygems_version: 2.4.
|
|
378
|
+
rubygems_version: 2.4.8
|
|
378
379
|
signing_key:
|
|
379
380
|
specification_version: 4
|
|
380
381
|
summary: My rails dad
|
data/lib/tasks/database.yml.erb
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
app_name_short = ENV['APP_NAME'][0..15]
|
|
3
|
-
-%>
|
|
4
|
-
# MySQL. Versions 4.1 and 5.0 are recommended.
|
|
5
|
-
#
|
|
6
|
-
# Install the MYSQL driver
|
|
7
|
-
# gem install mysql2
|
|
8
|
-
#
|
|
9
|
-
# Ensure the MySQL gem is defined in your Gemfile
|
|
10
|
-
# gem 'mysql2'
|
|
11
|
-
#
|
|
12
|
-
# And be sure to use new-style password hashing:
|
|
13
|
-
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
|
14
|
-
development:
|
|
15
|
-
adapter: mysql2
|
|
16
|
-
encoding: utf8
|
|
17
|
-
database: <%= app_name_short %>_dev
|
|
18
|
-
pool: 5
|
|
19
|
-
username: <%= app_name_short %>
|
|
20
|
-
password: <%= app_name_short %>
|
|
21
|
-
socket: /var/lib/mysql/mysql.sock
|
|
22
|
-
|
|
23
|
-
# Warning: The database defined as "test" will be erased and
|
|
24
|
-
# re-generated from your development database when you run "rake".
|
|
25
|
-
# Do not set this db to the same as development or production.
|
|
26
|
-
test:
|
|
27
|
-
adapter: mysql2
|
|
28
|
-
encoding: utf8
|
|
29
|
-
database: <%= app_name_short %>_test
|
|
30
|
-
pool: 5
|
|
31
|
-
username: <%= app_name_short %>
|
|
32
|
-
password: <%= app_name_short %>
|
|
33
|
-
socket: /var/lib/mysql/mysql.sock
|
|
34
|
-
|
|
35
|
-
production:
|
|
36
|
-
adapter: mysql2
|
|
37
|
-
encoding: utf8
|
|
38
|
-
database: <%= app_name_short %>_pro
|
|
39
|
-
pool: 5
|
|
40
|
-
username: <%= app_name_short %>
|
|
41
|
-
password: <%= app_name_short %>
|
|
42
|
-
socket: /var/lib/mysql/mysql.sock
|