capistrano_transmit 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ pkg
2
+ doc
3
+ Manifest
4
+ *.gem
5
+ Gemfile.lock
6
+ .ruby-version
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (C) Joost Baaij
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,8 +1,8 @@
1
1
  = Capistrano Transmit
2
2
 
3
- Rails tasks to work with production data and assets.
3
+ Tasks to work with production data and assets.
4
4
 
5
- This Ruby on Rails plugin allows you to fetch the production database and
5
+ This Capistrano plugin allows you to fetch the production database and
6
6
  assets and store them in your local development environment. For reasonably
7
7
  sized projects, you should do this regularly since you will notice typical
8
8
  production-related slowdowns such as missing indexes. The task to fetch
@@ -18,14 +18,12 @@ as well so we don't need to gzip the contents first. All this assumes both your
18
18
  production and development environment are Unix. Tested on Linux production and
19
19
  Mac OS X development.
20
20
 
21
- == Installation
21
+ == Installation for Rails 3+
22
22
 
23
- ruby script/plugin install git://github.com/tilsammans/capistrano_transmit.git
24
-
25
- or in your +Gemfile+:
23
+ In +Gemfile+:
24
+
25
+ gem 'capistrano_transmit', require: false, group: :development
26
26
 
27
- gem 'capistrano_transmit', '~> 1.0.0'
28
-
29
27
  Then add to your deploy.rb:
30
28
 
31
29
  require 'capistrano/transmit'
@@ -46,4 +44,4 @@ A couple variables can be overridden by setting them in config/deploy.rb:
46
44
  dumpfile # remote pathname to dump the database in, defaults to tmp/${production}.sql.gz
47
45
 
48
46
 
49
- Copyright (c) 2010-2011 Joost Baaij, released under the MIT license.
47
+ Copyright (c) 2010-2013 Joost Baaij, released under the MIT license.
data/Rakefile CHANGED
@@ -1,12 +1,4 @@
1
1
  require 'rubygems'
2
- require 'rake'
3
- require 'echoe'
2
+ require 'bundler/setup'
4
3
 
5
- Echoe.new('capistrano_transmit', '0.1.0') do |p|
6
- p.summary = "Copies mysql databases between remote production and local development servers."
7
- p.url = "http://github.com/tilsammans/capistrano_transmit"
8
- p.author = "Joost Baaij"
9
- p.email = "joost@spacebabies.nl"
10
- p.runtime_dependencies = ["capistrano"]
11
- p.development_dependencies = []
12
- end
4
+ Bundler::GemHelper.install_tasks
@@ -1,33 +1,19 @@
1
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{capistrano_transmit}
5
- s.version = "1.0.0"
4
+ s.name = "capistrano_transmit"
5
+ s.version = "1.2.0"
6
6
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Joost Baaij"]
9
- s.date = %q{2011-07-21}
10
- s.description = %q{Copies mysql databases between remote production and local development servers.}
11
- s.email = %q{joost@spacebabies.nl}
12
- s.extra_rdoc_files = ["README.rdoc", "lib/capistrano/transmit.rb"]
13
- s.files = ["MIT-LICENSE", "README.rdoc", "Rakefile", "lib/capistrano/transmit.rb", "capistrano_transmit.gemspec"]
14
- s.homepage = %q{http://github.com/tilsammans/capistrano_transmit}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano_transmit", "--main", "README.rdoc"]
7
+ s.authors = ["Joost Baaij"]
8
+ s.email = ["joost@spacebabies.nl"]
9
+ s.summary = "Copies mysql databases between remote production and local development servers"
10
+ s.description = "Copies mysql databases between remote production and local development servers"
11
+ s.homepage = "https://github.com/tilsammans/capistrano_transmit"
12
+
13
+ s.files = `git ls-files`.split($/)
16
14
  s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{capistrano_transmit}
18
- s.rubygems_version = %q{1.3.7}
19
- s.summary = %q{Copies mysql databases between remote production and local development servers.}
20
15
 
21
- if s.respond_to? :specification_version then
22
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
- s.specification_version = 3
16
+ s.add_runtime_dependency 'capistrano', '>= 2.0.0'
24
17
 
25
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<capistrano>, [">= 0"])
27
- else
28
- s.add_dependency(%q<capistrano>, [">= 0"])
29
- end
30
- else
31
- s.add_dependency(%q<capistrano>, [">= 0"])
32
- end
18
+ s.add_development_dependency 'bundler'
33
19
  end
@@ -1,7 +1,3 @@
1
- unless Capistrano::Configuration.respond_to?(:instance)
2
- abort "capistrano/transmit requires Capistrano 2"
3
- end
4
-
5
1
  Capistrano::Configuration.instance.load do
6
2
 
7
3
  _cset :user, nil
@@ -30,10 +26,11 @@ Capistrano::Configuration.instance.load do
30
26
  namespace :put do
31
27
  desc 'Upload the local development database to the remote production database and overwrite it'
32
28
  task :mysql, :roles => :db do
33
- system "mysqldump --opt #{_local_db_auth} > tmp/#{_db_local['database']}.sql"
29
+ local_file = "tmp/#{_db_local['database']}.sql.gz"
30
+ system "mysqldump --opt --quick --extended-insert --skip-lock-tables #{_local_db_auth} | gzip > #{local_file}"
34
31
 
35
- system "rsync -vP tmp/#{_db_local['database']}.sql #{_user_with_host}:#{dumpfile}"
36
- run "mysql #{_remote_db_auth} < #{dumpfile}"
32
+ system "rsync -vP #{local_file} #{_user_with_host}:#{dumpfile}"
33
+ run "gunzip < #{dumpfile} | mysql #{_remote_db_auth}"
37
34
  end
38
35
  end
39
36
 
@@ -55,7 +52,7 @@ Capistrano::Configuration.instance.load do
55
52
 
56
53
  # Production database configuration hash.
57
54
  def _db_remote
58
- @_db_remote ||= YAML::load(_db_config)['production']
55
+ @_db_remote ||= YAML::load(_db_config)[stage.to_s]
59
56
  end
60
57
 
61
58
  # Development database configuration hash.
metadata CHANGED
@@ -1,76 +1,91 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capistrano_transmit
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
4
5
  prerelease:
5
- version: 1.0.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Joost Baaij
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-07-21 00:00:00 +02:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2013-08-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: capistrano
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
25
22
  type: :runtime
26
- version_requirements: *id001
27
- description: Copies mysql databases between remote production and local development servers.
28
- email: joost@spacebabies.nl
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Copies mysql databases between remote production and local development
47
+ servers
48
+ email:
49
+ - joost@spacebabies.nl
29
50
  executables: []
30
-
31
51
  extensions: []
32
-
33
- extra_rdoc_files:
34
- - README.rdoc
35
- - lib/capistrano/transmit.rb
36
- files:
37
- - MIT-LICENSE
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE
38
57
  - README.rdoc
39
58
  - Rakefile
40
- - lib/capistrano/transmit.rb
41
59
  - capistrano_transmit.gemspec
42
- has_rdoc: true
43
- homepage: http://github.com/tilsammans/capistrano_transmit
60
+ - lib/capistrano/transmit.rb
61
+ homepage: https://github.com/tilsammans/capistrano_transmit
44
62
  licenses: []
45
-
46
63
  post_install_message:
47
- rdoc_options:
48
- - --line-numbers
49
- - --inline-source
50
- - --title
51
- - Capistrano_transmit
52
- - --main
53
- - README.rdoc
54
- require_paths:
64
+ rdoc_options: []
65
+ require_paths:
55
66
  - lib
56
- required_ruby_version: !ruby/object:Gem::Requirement
67
+ required_ruby_version: !ruby/object:Gem::Requirement
57
68
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: "0"
62
- required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ segments:
74
+ - 0
75
+ hash: -4377938373645602988
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
77
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: "1.2"
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ segments:
83
+ - 0
84
+ hash: -4377938373645602988
68
85
  requirements: []
69
-
70
- rubyforge_project: capistrano_transmit
71
- rubygems_version: 1.6.2
86
+ rubyforge_project:
87
+ rubygems_version: 1.8.23
72
88
  signing_key:
73
89
  specification_version: 3
74
- summary: Copies mysql databases between remote production and local development servers.
90
+ summary: Copies mysql databases between remote production and local development servers
75
91
  test_files: []
76
-
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010 [name of plugin creator]
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.