capistrano-rails-collection 0.0.1 → 0.0.2

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: faacac9b230f09061f35e00fe376e59d17a9698b
4
- data.tar.gz: 5b0c893cde1d277d1788e45948a14a725f616943
3
+ metadata.gz: 2362d53a86985398e3cb848ba15e095f5bf46e2e
4
+ data.tar.gz: f9c43c04a5a2136c54155fe78ce827003be6fd3f
5
5
  SHA512:
6
- metadata.gz: 36e7d4001e331fe03cd3d2c20448c7d1675804905387bbb1bb2b40a10ea956d09e2a50c0e7754592d67e07261d7721126df3f61360ddbc26bacaebf543142cb9
7
- data.tar.gz: e0b8355ca0d71e6da8e2424e0f4f068c58b8abe6e6de3250c6bce7a1de0381dc5d1901a8fd152a0d5e3dc6eab3055cd140cc10d62075a4404a4f031610bcad28
6
+ metadata.gz: fe42d55211f9eb9671fa22cfe15d5f66f4a6a32e88b35b4267b8c9cc00c078414cc19356544554208384850cd8d79d563415ee17efbc5424aba504e140f22fa6
7
+ data.tar.gz: ef95242b81a8579b802932d8f83fd91f6139e50b6a974c6b0def06f08cb3984f21df9e4fbed7192a30b6d2cbd05cc0a9c22612e4a786e86d94eeb179ef4ef296
data/README.md CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  Rails specific task collection for Capistrano v3 as extension of the official capistrano rails gem:
4
4
 
5
- * cap deploy:seed
5
+ * cap rails:rake:log:clear
6
+ * cap rails:rake:tmp:clear
7
+ * cap rails:rake:db:drop
8
+ * cap rails:rake:db:reset
9
+ * cap rails:rake:db:setup
10
+ * cap rails:rake:db:seed
11
+ * cap rails:rake:db:migrate
12
+ * cap rails:rake:db:rollback
6
13
 
7
14
  ## Installation
8
15
 
@@ -16,11 +23,12 @@ And then execute:
16
23
 
17
24
  ## Usage
18
25
 
19
- Require everything (bundler, rails/assets, rails/migrations and rails/collection)
26
+ This gem provides a collection of tasks for any Rails application. Make sure to use the `capistrano-rails` gem for deployment tasks.
27
+
28
+ Require the whole collection of Rails tasks.
20
29
 
21
30
  ```ruby
22
31
  # Capfile
23
- require 'capistrano/rails'
24
32
  require 'capistrano/rails/collection'
25
33
  ```
26
34
 
@@ -32,4 +40,4 @@ Please note that any require should be placed in Capfile, not config/deploy.rb.
32
40
  2. Create your feature branch (`git checkout -b my-new-feature`)
33
41
  3. Commit your changes (`git commit -am 'Add some feature'`)
34
42
  4. Push to the branch (`git push origin my-new-feature`)
35
- 5. Create new Pull Request
43
+ 5. Create new Pull Request
@@ -1,11 +1,10 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'capistrano/rails/collection/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
6
  spec.name = "capistrano-rails-collection"
8
- spec.version = Capistrano::Rails::Collection::VERSION
7
+ spec.version = "0.0.2"
9
8
  spec.authors = ["dei79"]
10
9
  spec.email = ["dirk.eisenberg@gmail.com"]
11
10
  spec.description = %q{Rails specific Capistrano tasks which are not part of the official rails gem}
@@ -1,6 +1,2 @@
1
- require 'capistrano/bundler'
2
- require 'capistrano/rails'
3
-
4
- require "capistrano/rails/collection/version"
5
1
  require "capistrano/rails/collection/db"
6
-
2
+ require "capistrano/rails/collection/general"
@@ -0,0 +1 @@
1
+ load File.expand_path("../../../tasks/general.rake", __FILE__)
@@ -1,14 +1,74 @@
1
- namespace :deploy do
1
+ namespace :rails do
2
+ namespace :rake do
3
+ namespace :db do
4
+ desc 'Drops the database to an empty state'
5
+ task :drop do
6
+ on primary :db do
7
+ within current_path do
8
+ with rails_env: fetch(:stage) do
9
+ execute :rake, 'db:drop'
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ desc 'Resets the database to an empty state'
16
+ task :reset do
17
+ on primary :db do
18
+ within current_path do
19
+ with rails_env: fetch(:stage) do
20
+ execute :rake, 'db:reset'
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ desc <<-DESC
27
+ Create the database, load the schema, and initialize with the seed data \
28
+ (use db:reset to also drop the db first)
29
+ DESC
30
+ task :setup do
31
+ on primary :db do
32
+ within current_path do
33
+ with rails_env: fetch(:stage) do
34
+ execute :rake, 'db:setup'
35
+ end
36
+ end
37
+ end
38
+ end
2
39
 
3
- desc 'Runs rake db:seed (call it manually)'
4
- task :seed do
5
- on primary fetch(:migration_role) do
6
- within release_path do
7
- with rails_env: fetch(:rails_env) do
8
- execute :rake, 'db:seed'
40
+ desc "Load the seed data from db/seeds.rb"
41
+ task :seed do
42
+ on primary :db do
43
+ within current_path do
44
+ with rails_env: fetch(:stage) do
45
+ execute :rake, 'db:seed'
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ desc "Migrate the database"
52
+ task :rollback do
53
+ on primary :db do
54
+ within current_path do
55
+ with rails_env: fetch(:stage) do
56
+ execute :rake, 'db:migrate'
57
+ end
58
+ end
59
+ end
60
+ end
61
+
62
+ desc "Rolls the schema back to the previous version"
63
+ task :rollback do
64
+ on primary :db do
65
+ within current_path do
66
+ with rails_env: fetch(:stage) do
67
+ execute :rake, 'db:rollback'
68
+ end
69
+ end
9
70
  end
10
71
  end
11
72
  end
12
73
  end
13
-
14
- end
74
+ end
@@ -0,0 +1,29 @@
1
+ namespace :rails do
2
+ namespace :rake do
3
+ namespace :log do
4
+ desc 'Truncates all *.log files in log/ to zero bytes'
5
+ task :clear do
6
+ on primary :db do
7
+ within current_path do
8
+ with rails_env: fetch(:stage) do
9
+ execute :rake, 'log:clear'
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ namespace :tmp do
17
+ desc 'Clear session, cache, and socket files from tmp/'
18
+ task :clear do
19
+ on primary :db do
20
+ within current_path do
21
+ with rails_env: fetch(:stage) do
22
+ execute :rake, 'tmp:clear'
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rails-collection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dei79
@@ -41,8 +41,9 @@ files:
41
41
  - lib/capistrano-rails-collection.rb
42
42
  - lib/capistrano/rails/collection.rb
43
43
  - lib/capistrano/rails/collection/db.rb
44
- - lib/capistrano/rails/collection/version.rb
44
+ - lib/capistrano/rails/collection/general.rb
45
45
  - lib/capistrano/tasks/db.rake
46
+ - lib/capistrano/tasks/general.rake
46
47
  homepage: ''
47
48
  licenses:
48
49
  - MIT
@@ -1,7 +0,0 @@
1
- module Capistrano
2
- module Rails
3
- module Collection
4
- VERSION = "0.0.1"
5
- end
6
- end
7
- end