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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ceb432e7432781d24348f1728e038306e8c4c58f
4
- data.tar.gz: 794b5e63462893dfa471d5a5cb9847a38b05fbc5
3
+ metadata.gz: 77e67eea84bdfdceb7b169940831ad887cb9a401
4
+ data.tar.gz: 0eb944f113094250c07bf06f8fc382c89f7df7fc
5
5
  SHA512:
6
- metadata.gz: 32b88d1032dd937df8e3bbff0bd0b505f8ba2eb6d79dd81816516b5177ce5f6b73ea3ca1b1d55153aab5f7af468467a91f4c053f0e521e77d284549ebbef00f9
7
- data.tar.gz: 75aacecfa7b1a65f0cc3498739e49260c070328b9a28bf3884268e11f86c894a7f40357b9d94ce426aa76fb926f94092536b43d894687d0450787330e3e93fbd
6
+ metadata.gz: ee48d75af23ffd949caa392dbc36ac63cef6d7519984d7a34a5ca049cf7e3142147b1901fa8981d17bea3d1614e0a21b6685d63560375521284b7ded4064a83c
7
+ data.tar.gz: e2eaf9025d0d218c87dac0ae3ec201f65f02130b924dc0eae7aea6a6b11ca93070573e9ae91fb1e58856fa1cc2ecbfac9de34ebe3acb0511c95a2d3d72e9e305
@@ -1,3 +1,8 @@
1
+ ### 0.2.0 / 2015-06-23
2
+
3
+ * Added `padrino:db:migrate:up` and `padrino:db:migrate:down` tasks.
4
+ * Ensure all tasks depend on `environment`.
5
+
1
6
  ### 0.1.1 / 2015-06-15
2
7
 
3
8
  * Fixed a typo in `padrino:db:migrate`.
data/README.md CHANGED
@@ -15,20 +15,38 @@
15
15
 
16
16
  ### Tasks
17
17
 
18
- Mina Task | Command
19
- -------------------------|-----------------
20
- `padrino:console` | `padrino console`
21
- `padrino:db:migrate` | `rake db:migrate`
22
- `padrino:db:create` | `rake db:create`
23
- `padrino:db:drop` | `rake db:drop`
24
- `padrino:db:reset` | `rake db:reset`
25
- `padrino:db:setup` | `rake db:setup`
26
- `padrino:db:seed` | `rake db:seed`
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
@@ -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 "Migrates the database."
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 "Drops the database."
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 "Resets the database."
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 "Setup the database."
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 "Seeds the database."
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"
@@ -1,6 +1,6 @@
1
1
  module Mina
2
2
  module Padrino
3
3
  # mina-padrino version
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
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.1.1
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-16 00:00:00.000000000 Z
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.2.3
88
+ rubygems_version: 2.4.7
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: mina tasks for padrino