yaml_db 0.2.1 → 0.2.2
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/VERSION +1 -1
- data/lib/tasks/yaml_db_tasks.rake +1 -1
- data/lib/yaml_db.rb +5 -5
- data/yaml_db.gemspec +3 -14
- metadata +6 -21
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -32,7 +32,7 @@ namespace :db do
|
|
32
32
|
task :load => :environment do
|
33
33
|
format_class = ENV['class'] || "YamlDb::Helper"
|
34
34
|
helper = format_class.constantize
|
35
|
-
SerializationHelper::Base.new(helper).load
|
35
|
+
SerializationHelper::Base.new(helper).load(db_dump_data_file helper.extension)
|
36
36
|
end
|
37
37
|
|
38
38
|
desc "Load contents of db/data_dir into database"
|
data/lib/yaml_db.rb
CHANGED
@@ -8,7 +8,7 @@ require 'rails/railtie'
|
|
8
8
|
module YamlDb
|
9
9
|
module Helper
|
10
10
|
def self.loader
|
11
|
-
YamlDb::Load
|
11
|
+
YamlDb::Load
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.dumper
|
@@ -24,7 +24,7 @@ module YamlDb
|
|
24
24
|
module Utils
|
25
25
|
def self.chunk_records(records)
|
26
26
|
yaml = [ records ].to_yaml
|
27
|
-
yaml.sub!(
|
27
|
+
yaml.sub!(/---\s\n|---\n/, '')
|
28
28
|
yaml.sub!('- - -', ' - -')
|
29
29
|
yaml
|
30
30
|
end
|
@@ -32,7 +32,7 @@ module YamlDb
|
|
32
32
|
end
|
33
33
|
|
34
34
|
class Dump < SerializationHelper::Dump
|
35
|
-
|
35
|
+
|
36
36
|
def self.dump_table_columns(io, table)
|
37
37
|
io.write("\n")
|
38
38
|
io.write({ table => { 'columns' => table_column_names(table) } }.to_yaml)
|
@@ -56,7 +56,7 @@ module YamlDb
|
|
56
56
|
end
|
57
57
|
|
58
58
|
class Load < SerializationHelper::Load
|
59
|
-
def self.load_documents(io, truncate = true)
|
59
|
+
def self.load_documents(io, truncate = true)
|
60
60
|
YAML.load_documents(io) do |ydoc|
|
61
61
|
ydoc.keys.each do |table_name|
|
62
62
|
next if ydoc[table_name].nil?
|
@@ -68,7 +68,7 @@ module YamlDb
|
|
68
68
|
|
69
69
|
class Railtie < Rails::Railtie
|
70
70
|
rake_tasks do
|
71
|
-
load File.expand_path('../tasks/yaml_db_tasks.rake',
|
71
|
+
load File.expand_path('../tasks/yaml_db_tasks.rake',
|
72
72
|
__FILE__)
|
73
73
|
end
|
74
74
|
end
|
data/yaml_db.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{yaml_db}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Adam Wiggins", "Orion Henry"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-10-12}
|
13
13
|
s.description = %q{
|
14
14
|
YamlDb is a database-independent format for dumping and restoring data. It complements the the database-independent schema format found in db/schema.rb. The data is saved into db/data.yml.
|
15
15
|
This can be used as a replacement for mysqldump or pg_dump, but only for the databases typically used by Rails apps. Users, permissions, schemas, triggers, and other advanced database features are not supported - by design.
|
@@ -41,21 +41,10 @@ Any database that has an ActiveRecord adapter should work
|
|
41
41
|
]
|
42
42
|
s.homepage = %q{http://github.com/ludicast/yaml_db}
|
43
43
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.
|
44
|
+
s.rubygems_version = %q{1.3.9.2}
|
45
45
|
s.summary = %q{yaml_db allows export/import of database into/from yaml files}
|
46
|
-
s.test_files = [
|
47
|
-
"spec/base.rb",
|
48
|
-
"spec/serialization_helper_base_spec.rb",
|
49
|
-
"spec/serialization_helper_dump_spec.rb",
|
50
|
-
"spec/serialization_helper_load_spec.rb",
|
51
|
-
"spec/serialization_utils_spec.rb",
|
52
|
-
"spec/yaml_dump_spec.rb",
|
53
|
-
"spec/yaml_load_spec.rb",
|
54
|
-
"spec/yaml_utils_spec.rb"
|
55
|
-
]
|
56
46
|
|
57
47
|
if s.respond_to? :specification_version then
|
58
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
59
48
|
s.specification_version = 3
|
60
49
|
|
61
50
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 1
|
9
|
-
version: 0.2.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Adam Wiggins
|
@@ -15,7 +11,7 @@ autorequire:
|
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
13
|
|
18
|
-
date: 2011-
|
14
|
+
date: 2011-10-12 00:00:00 -04:00
|
19
15
|
default_executable:
|
20
16
|
dependencies: []
|
21
17
|
|
@@ -63,30 +59,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
59
|
requirements:
|
64
60
|
- - ">="
|
65
61
|
- !ruby/object:Gem::Version
|
66
|
-
segments:
|
67
|
-
- 0
|
68
62
|
version: "0"
|
69
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
64
|
none: false
|
71
65
|
requirements:
|
72
66
|
- - ">="
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
segments:
|
75
|
-
- 0
|
76
68
|
version: "0"
|
77
69
|
requirements: []
|
78
70
|
|
79
71
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.3.
|
72
|
+
rubygems_version: 1.3.9.2
|
81
73
|
signing_key:
|
82
74
|
specification_version: 3
|
83
75
|
summary: yaml_db allows export/import of database into/from yaml files
|
84
|
-
test_files:
|
85
|
-
|
86
|
-
- spec/serialization_helper_base_spec.rb
|
87
|
-
- spec/serialization_helper_dump_spec.rb
|
88
|
-
- spec/serialization_helper_load_spec.rb
|
89
|
-
- spec/serialization_utils_spec.rb
|
90
|
-
- spec/yaml_dump_spec.rb
|
91
|
-
- spec/yaml_load_spec.rb
|
92
|
-
- spec/yaml_utils_spec.rb
|
76
|
+
test_files: []
|
77
|
+
|