mina-padrino 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -0
- data/README.md +27 -9
- data/lib/mina/padrino/db.rb +42 -12
- data/lib/mina/padrino/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77e67eea84bdfdceb7b169940831ad887cb9a401
|
4
|
+
data.tar.gz: 0eb944f113094250c07bf06f8fc382c89f7df7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee48d75af23ffd949caa392dbc36ac63cef6d7519984d7a34a5ca049cf7e3142147b1901fa8981d17bea3d1614e0a21b6685d63560375521284b7ded4064a83c
|
7
|
+
data.tar.gz: e2eaf9025d0d218c87dac0ae3ec201f65f02130b924dc0eae7aea6a6b11ca93070573e9ae91fb1e58856fa1cc2ecbfac9de34ebe3acb0511c95a2d3d72e9e305
|
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -15,20 +15,38 @@
|
|
15
15
|
|
16
16
|
### Tasks
|
17
17
|
|
18
|
-
Mina Task
|
19
|
-
|
20
|
-
`padrino:console`
|
21
|
-
`padrino:db:migrate`
|
22
|
-
`padrino:db:
|
23
|
-
`padrino:db:
|
24
|
-
`padrino:db:
|
25
|
-
`padrino:db:
|
26
|
-
`padrino:db:
|
18
|
+
Mina Task | Command
|
19
|
+
--------------------------|-----------------
|
20
|
+
`padrino:console` | `padrino console`
|
21
|
+
`padrino:db:migrate` | `rake db:migrate`
|
22
|
+
`padrino:db:migrate:down` | `rake db:migrate:down`
|
23
|
+
`padrino:db:migrate:up` | `rake db:migrate:up`
|
24
|
+
`padrino:db:create` | `rake db:create`
|
25
|
+
`padrino:db:drop` | `rake db:drop`
|
26
|
+
`padrino:db:reset` | `rake db:reset`
|
27
|
+
`padrino:db:setup` | `rake db:setup`
|
28
|
+
`padrino:db:seed` | `rake db:seed`
|
27
29
|
|
28
30
|
## Examples
|
29
31
|
|
30
32
|
require 'mina/padrino'
|
31
33
|
|
34
|
+
desc "Deploys the current version to the server."
|
35
|
+
task :deploy => :environment do
|
36
|
+
deploy do
|
37
|
+
# Put things that will set up an empty directory into a fully set-up
|
38
|
+
# instance of your project.
|
39
|
+
invoke :'git:clone'
|
40
|
+
invoke :'deploy:link_shared_paths'
|
41
|
+
invoke :'bundle:install'
|
42
|
+
invoke :'deploy:cleanup'
|
43
|
+
invoke :'padrino:db:migrate'
|
44
|
+
|
45
|
+
...
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
|
32
50
|
## Requirements
|
33
51
|
|
34
52
|
* [mina] ~> 0.3
|
data/lib/mina/padrino/db.rb
CHANGED
@@ -3,8 +3,8 @@ require 'mina/padrino/core'
|
|
3
3
|
namespace :padrino do
|
4
4
|
namespace :db do
|
5
5
|
# ### padrino:db:migrate
|
6
|
-
desc "
|
7
|
-
task :migrate do
|
6
|
+
desc "Migrate the database to the latest version"
|
7
|
+
task :migrate => :environment do
|
8
8
|
in_current_dir do
|
9
9
|
queue %{
|
10
10
|
echo "-----> Migrating database"
|
@@ -13,9 +13,39 @@ namespace :padrino do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
namespace :migrate do
|
17
|
+
desc "Migrate down using migrations"
|
18
|
+
task :down, [:version] => :environment do |t,args|
|
19
|
+
task_arg = if args[:version]
|
20
|
+
"[#{args[:version]}]"
|
21
|
+
end
|
22
|
+
|
23
|
+
in_current_dir do
|
24
|
+
queue %{
|
25
|
+
echo "-----> Migrating database down"
|
26
|
+
#{echo_cmd %[#{rake} db:migrate:down#{task_arg}]}
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "Migrate up using migrations"
|
32
|
+
task :up, [:version] => :environment do |t,args|
|
33
|
+
task_arg = if args[:version]
|
34
|
+
"[#{args[:version]}]"
|
35
|
+
end
|
36
|
+
|
37
|
+
in_current_dir do
|
38
|
+
queue %{
|
39
|
+
echo "-----> Migrating database up"
|
40
|
+
#{echo_cmd %[#{rake} db:migrate:up#{task_arg}]}
|
41
|
+
}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
16
46
|
# ### padrino:db:create
|
17
|
-
desc "Creates the database
|
18
|
-
task :create do
|
47
|
+
desc "Creates the database"
|
48
|
+
task :create => :environment do
|
19
49
|
in_current_dir do
|
20
50
|
queue %{
|
21
51
|
echo "-----> Creating database"
|
@@ -25,8 +55,8 @@ namespace :padrino do
|
|
25
55
|
end
|
26
56
|
|
27
57
|
# ### padrino:db:drop
|
28
|
-
desc "
|
29
|
-
task :drop do
|
58
|
+
desc "Drop the database (postgres and mysql only)"
|
59
|
+
task :drop => :environment do
|
30
60
|
in_current_dir do
|
31
61
|
queue %{
|
32
62
|
echo "-----> Dropping database!"
|
@@ -36,8 +66,8 @@ namespace :padrino do
|
|
36
66
|
end
|
37
67
|
|
38
68
|
# ### padrino:db:reset
|
39
|
-
desc "
|
40
|
-
task :reset do
|
69
|
+
desc "Drop the database, migrate from scratch and initialize with the seed data"
|
70
|
+
task :reset => :environment do
|
41
71
|
in_current_dir do
|
42
72
|
queue %{
|
43
73
|
echo "-----> Resetting database!"
|
@@ -47,8 +77,8 @@ namespace :padrino do
|
|
47
77
|
end
|
48
78
|
|
49
79
|
# ### padrino:db:setup
|
50
|
-
desc "
|
51
|
-
task :setup do
|
80
|
+
desc "Create the database migrate and initialize with the seed data"
|
81
|
+
task :setup => :environment do
|
52
82
|
in_current_dir do
|
53
83
|
queue %{
|
54
84
|
echo "-----> Setting up database"
|
@@ -58,8 +88,8 @@ namespace :padrino do
|
|
58
88
|
end
|
59
89
|
|
60
90
|
# ### padrino:db:setup
|
61
|
-
desc "
|
62
|
-
task :seed do
|
91
|
+
desc "Load the seed data from db/seeds.rb"
|
92
|
+
task :seed => :environment do
|
63
93
|
in_current_dir do
|
64
94
|
queue %{
|
65
95
|
echo "-----> Seeding database"
|
data/lib/mina/padrino/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-padrino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mina
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.4.7
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: mina tasks for padrino
|