rails-backup-migrate 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +6 -0
- data/lib/rails-backup-migrate.rb +3 -2
- data/lib/rails-backup-migrate/version.rb +1 -1
- data/lib/tasks/rails-backup-migrate.rake +1 -0
- metadata +40 -52
data/README.textile
CHANGED
@@ -31,8 +31,14 @@ h2. Compatibility
|
|
31
31
|
|
32
32
|
Tested initially on 'redmine' using rails 2.3.11 and some simpler tests with rails 3. Has been tested with MySQL and Sqlite3 databases. Further testing with postgres to be done.
|
33
33
|
|
34
|
+
Also tested with a dummy rails 3.0 app using sqlite3 driver in ruby 1.8.7, 1.9.2 and jruby 1.6.2.
|
35
|
+
|
34
36
|
This requires a system with access to the `tar` command in your path. (Easy for Mac & *nixes, may require a posix environment such as cygwin under Windows.)
|
35
37
|
|
38
|
+
h3. Known Issues:
|
39
|
+
|
40
|
+
- under ruby 1.9.2, the YAML export (in the `rake site:backup` task fails extended characters in ASCII to UTF8 conversion) (Github Issue #4) Changes made in 0.0.9 that look like this is fixed - any help regressing is welcome!
|
41
|
+
|
36
42
|
h2. Contributors
|
37
43
|
|
38
44
|
Matt Connolly - main author of gem
|
data/lib/rails-backup-migrate.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
#
|
2
3
|
# @file lib/rails-backup-migrate.rb
|
3
4
|
#
|
@@ -10,7 +11,7 @@
|
|
10
11
|
# When required by a Rakefile, this file also loads the rake tasks in lib/tasks/rails-backup-migrate.rake
|
11
12
|
#
|
12
13
|
|
13
|
-
require "rails-backup-migrate/version"
|
14
|
+
require "#{File.dirname(__FILE__)}/rails-backup-migrate/version"
|
14
15
|
require 'tmpdir'
|
15
16
|
require 'fileutils'
|
16
17
|
|
@@ -101,7 +102,7 @@ module RailsBackupMigrate
|
|
101
102
|
|
102
103
|
interesting_tables.each do |tbl|
|
103
104
|
puts "Writing #{tbl}..." if VERBOSE
|
104
|
-
File.open("#{tbl}.yml", 'w+') { |f| YAML.dump
|
105
|
+
File.open("#{tbl}.yml", 'w+') { |f| f << YAML.dump(ActiveRecord::Base.connection.select_all("SELECT * FROM #{tbl}")) }
|
105
106
|
@files_to_delete_on_cleanup << File::expand_path("#{tbl}.yml")
|
106
107
|
end
|
107
108
|
|
metadata
CHANGED
@@ -1,48 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-backup-migrate
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 8
|
10
|
-
version: 0.0.8
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Matt Connolly
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2011-07-25 00:00:00 +10:00
|
12
|
+
date: 2011-08-18 00:00:00.000000000 +10:00
|
19
13
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
22
16
|
name: activerecord
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &2153793800 !ruby/object:Gem::Requirement
|
25
18
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 3
|
33
|
-
version: "2.3"
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.3'
|
34
23
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *2153793800
|
26
|
+
description: ! "Creates a directory db/backup in the rails app and creates / loads
|
27
|
+
YML files from there. \n After a backup, the db/backups directory is archived
|
28
|
+
into a .tgz file and then deleted.\n When restoring, the db/backup directory
|
29
|
+
is extracted from the .tgz file.\n All of the files in the 'files' directory
|
30
|
+
are also backed up / restored.\n \n The default archive file is \"site-backup.tgz\"
|
31
|
+
but any other one can be passed as an argument to both db:backup:write\n and
|
32
|
+
db:backup:read, for example:\n \n app1$ rake db:backup:write\n app1$ cd
|
33
|
+
../app2\n app2$ rake db:backup:read[../app1/site-backup.tgz]\n \n The environment
|
34
|
+
variable 'verbose' or 'VERBOSE' if defined will result in some verbose output.\n
|
35
|
+
\ \n To add the rake tasks to your Rails app, simply install the gem, and then
|
36
|
+
add the following line to your 'Rakefile':\n \n require 'rails-backup-migrate'\n
|
37
|
+
\ \n "
|
38
|
+
email:
|
38
39
|
- matt@soundevolution.com.au
|
39
40
|
executables: []
|
40
|
-
|
41
41
|
extensions: []
|
42
|
-
|
43
42
|
extra_rdoc_files: []
|
44
|
-
|
45
|
-
files:
|
43
|
+
files:
|
46
44
|
- .gitignore
|
47
45
|
- CHANGELOG
|
48
46
|
- Gemfile
|
@@ -54,38 +52,28 @@ files:
|
|
54
52
|
- lib/tasks/rails-backup-migrate.rake
|
55
53
|
- rails-backup-migrate.gemspec
|
56
54
|
has_rdoc: true
|
57
|
-
homepage:
|
55
|
+
homepage: ''
|
58
56
|
licenses: []
|
59
|
-
|
60
57
|
post_install_message:
|
61
58
|
rdoc_options: []
|
62
|
-
|
63
|
-
require_paths:
|
59
|
+
require_paths:
|
64
60
|
- lib
|
65
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
62
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
|
72
|
-
- 0
|
73
|
-
version: "0"
|
74
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
68
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
segments:
|
81
|
-
- 0
|
82
|
-
version: "0"
|
69
|
+
requirements:
|
70
|
+
- - ! '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
83
73
|
requirements: []
|
84
|
-
|
85
74
|
rubyforge_project: rails-backup-migrate
|
86
75
|
rubygems_version: 1.6.2
|
87
76
|
signing_key:
|
88
77
|
specification_version: 3
|
89
78
|
summary: Backup and restore a rails application including database data and files
|
90
79
|
test_files: []
|
91
|
-
|