h2ocube_rails_tasks 0.0.4 → 0.0.5

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: 33764be7323b31e19673fc0512df07787def2cd8
4
- data.tar.gz: a84499e1d958c3694a65a5d46f1c5016c3b282d5
3
+ metadata.gz: 7319782d7489958ef08fad21c42e5bf836a6ce07
4
+ data.tar.gz: 6f2e789de7348c830bcb64f343b02a6f3b659471
5
5
  SHA512:
6
- metadata.gz: 9ae068e727318bb692d4919583f4667d4aa8d3fa8f28d66908a5b4e23aa7a1337dda23e2f714f959a65ef1496874cb049da977e9030f712ce1f42f296e2d6133
7
- data.tar.gz: 9a14d101aa5ee375ebf5d47f46118e7f0aac7e1273121c6900a0774a869d309b8f651e5f941791f428f9e62d2fb9f3a1a8bc0e981fc1c25eb75f9ab94ecde0a8
6
+ metadata.gz: 5d613a1ff2fc6e87cce4426e42780fc9a8bb9add819c224034635f0109bcdb49aeca0c02a309a8dd2576edce1f16fa00b7be5a52a7e4b90203f74ebbb6229104
7
+ data.tar.gz: bdfccf39167bb8d768a5ef7e651141f51d215cf8425ae85200a195fbe94c313dca06e5bbee0bdc73413f390fce258749b82f1e195c0317f369530d573fc28c64
@@ -0,0 +1,68 @@
1
+ # SUMMARY
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/h2ocube_rails_tasks.png)](http://badge.fury.io/rb/h2ocube_rails_tasks)
4
+
5
+ This is a plugin to add some useful tasks to rails.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'h2ocube_rails_tasks', group: :development
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install h2ocube_rails_tasks
20
+
21
+ ## Usage
22
+
23
+ # has .git folder
24
+ rake git:clear # Clear files in .gitignore
25
+ rake git:commit[comment] # Git commit with your comment
26
+ rake git:pull # Git pull
27
+ rake git:push[comment] # Git push with your comment
28
+
29
+ # has unicorn.rb
30
+ rake unicorn:restart # Hot restart unicorn server
31
+ rake unicorn:start # Start unicorn server
32
+ rake unicorn:stop # Stop unicorn server
33
+
34
+ # has config/rainbows.rb
35
+ rake rainbows:restart # Hot restart rainbows server
36
+ rake rainbows:start # Start rainbows server
37
+ rake rainbows:stop # Stop rainbows server
38
+
39
+ # has config/puma.rb
40
+ rake puma:restart # Hot restart puma server
41
+ rake puma:start # Start puma server
42
+ rake puma:stop # Stop puma server
43
+
44
+ # has config/database.yml
45
+ rake mysql:dump # mysqldump
46
+ rake mysql:restore # restore mysql with dump data
47
+ rake mysql:dump_all # mysqldump
48
+ rake mysql:restore_all # restore mysql with dump data
49
+
50
+ # has config/mongoid.yml
51
+ rake mongodb:dump # mongodump
52
+ rake mongodb:restore # mongorestore
53
+ rake mongodb:repair # Repair Mongodb
54
+
55
+ # has initializers/resque.rb
56
+ rake resque:clear # Clear Resque data
57
+ rake resque:debug # Start Resque for debug
58
+ rake resque:start # Start Resque daemon worker
59
+ rake resque:stop # Stop Resque worker
60
+ rake resque:web # Start Resque web interface
61
+
62
+ ## Contributing
63
+
64
+ 1. Fork it
65
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
66
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
67
+ 4. Push to the branch (`git push origin my-new-feature`)
68
+ 5. Create new Pull Request
@@ -3,18 +3,18 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'h2ocube_rails_tasks'
6
- s.version = '0.0.4'
6
+ s.version = '0.0.5'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Ben']
9
9
  s.email = ['ben@h2ocube.com']
10
10
  s.homepage = 'https://github.com/h2ocube/h2ocube_rails_tasks'
11
- s.summary = %q{}
12
- s.description = %q{}
11
+ s.summary = %q{This is a plugin to add some useful tasks to rails.}
12
+ s.description = %q{This is a plugin to add some useful tasks to rails.}
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
17
  s.require_paths = ["lib"]
18
-
18
+
19
19
  s.add_dependency 'rainbow'
20
20
  end
@@ -0,0 +1,32 @@
1
+ if File.exist? Rails.root.join('config/database.yml')
2
+ namespace :mysql do
3
+ config = YAML.load(File.read(Rails.root.join('config/database.yml')))[Rails.env.to_s]
4
+ db = config['database']
5
+ host = config['host']
6
+ FileUtils.mkdir_p Rails.root.join('mysql')
7
+
8
+ backup = "mysqldump -h #{host} #{db} > #{Rails.root}/mysql/dump.sql"
9
+ desc backup
10
+ task :dump do
11
+ zfben_rails_rake_system backup
12
+ end
13
+
14
+ restore = "mysql -h #{host} #{db} < #{Rails.root}/mysql/dump.sql"
15
+ desc restore
16
+ task :restore => 'db:create' do
17
+ zfben_rails_rake_system restore
18
+ end
19
+
20
+ backup_all = "mysqldump -h #{host} --all-databases > #{Rails.root}/mysql/dump_all.sql"
21
+ desc backup_all
22
+ task :dump_all do
23
+ zfben_rails_rake_system backup_all
24
+ end
25
+
26
+ restore_all = "mysql -h #{host} < #{Rails.root}/mysql/dump_all.sql"
27
+ desc restore_all
28
+ task :restore_all => 'db:create' do
29
+ zfben_rails_rake_system restore_all
30
+ end
31
+ end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: h2ocube_rails_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-12 00:00:00.000000000 Z
11
+ date: 2013-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: ''
27
+ description: This is a plugin to add some useful tasks to rails.
28
28
  email:
29
29
  - ben@h2ocube.com
30
30
  executables: []
@@ -33,13 +33,14 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - .gitignore
35
35
  - Gemfile
36
- - README.rdoc
36
+ - README.md
37
37
  - Rakefile
38
38
  - h2ocube_rails_tasks.gemspec
39
39
  - lib/h2ocube_rails_tasks.rb
40
40
  - lib/h2ocube_rails_tasks/helper.rb
41
41
  - lib/h2ocube_rails_tasks/tasks/git.rb
42
42
  - lib/h2ocube_rails_tasks/tasks/mongodb.rb
43
+ - lib/h2ocube_rails_tasks/tasks/mysql.rb
43
44
  - lib/h2ocube_rails_tasks/tasks/puma.rb
44
45
  - lib/h2ocube_rails_tasks/tasks/rainbows.rb
45
46
  - lib/h2ocube_rails_tasks/tasks/resque.rb
@@ -66,6 +67,6 @@ rubyforge_project:
66
67
  rubygems_version: 2.0.3
67
68
  signing_key:
68
69
  specification_version: 4
69
- summary: ''
70
+ summary: This is a plugin to add some useful tasks to rails.
70
71
  test_files: []
71
72
  has_rdoc:
@@ -1,50 +0,0 @@
1
- == SUMMARY
2
-
3
- This is plugin to add some useful tasks to rails.
4
-
5
- # has .git folder
6
- rake git:clear # Clear files in .gitignore
7
- rake git:commit[comment] # Git commit with your comment
8
- rake git:pull # Git pull
9
- rake git:push[comment] # Git push with your comment
10
-
11
- # has unicorn.rb
12
- rake unicorn:restart # Hot restart unicorn server
13
- rake unicorn:start # Start unicorn server
14
- rake unicorn:stop # Stop unicorn server
15
-
16
- # has config/rainbows.rb
17
- rake rainbows:restart # Hot restart rainbows server
18
- rake rainbows:start # Start rainbows server
19
- rake rainbows:stop # Stop rainbows server
20
-
21
- # has config/puma.rb
22
- rake puma:restart # Hot restart puma server
23
- rake puma:start # Start puma server
24
- rake puma:stop # Stop puma server
25
-
26
- # has config/mongoid.yml
27
- rake mongodb:dump # mongodump
28
- rake mongodb:restore # mongorestore
29
- rake mongodb:repair # Repair Mongodb
30
-
31
- # has initializers/resque.rb
32
- rake resque:clear # Clear Resque data
33
- rake resque:debug # Start Resque for debug
34
- rake resque:start # Start Resque daemon worker
35
- rake resque:stop # Stop Resque worker
36
- rake resque:web # Start Resque web interface
37
-
38
- == Getting Started
39
-
40
- 1. adding gem to Gemfile
41
-
42
- gem 'h2ocube_rails_tasks'
43
-
44
- 2. update bundle
45
-
46
- bundle install
47
-
48
- 3. try `rake -T`, and enjoy it :)
49
-
50
- take -T