databasion 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -5
- data/Rakefile +1 -1
- data/databasion.gemspec +3 -3
- data/lib/databasion/{gititlize.rb → gitilize.rb} +0 -0
- data/lib/databasion/googlize.rb +8 -5
- data/lib/databasion/migitize.rb +2 -2
- data/lib/databasion/templates/model.erb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -2,11 +2,9 @@
|
|
2
2
|
|
3
3
|
## Google Spreadsheet/Excel -> YAML -> Ruby Migration -> Database Management Tool
|
4
4
|
|
5
|
-
|
5
|
+
A database management tool. The theory is that a designer/planner can edit application data, a programmer can setup the database and it's fields, all in one happy little place. As tables are added, and data is changed, if the script is run once again it will update the target database.
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
* If we were I would be just as confused as I am any other day, our office's main language is Japanese. Although I've been studying it for 9 years...
|
7
|
+
TODO: While this system uses Rails Migrations, it isn't taking full advantage of them (i.e. tracking changes, allowing for rollbacks, etc.). This was also created under a high pressure timeline, so it was unfortunate that I could not create a fully working test suite.
|
10
8
|
|
11
9
|
## Requirements
|
12
10
|
|
@@ -136,7 +134,7 @@ __0.1.0__
|
|
136
134
|
|
137
135
|
## Testing
|
138
136
|
|
139
|
-
Currently Databasion uses the cucumber test suite.
|
137
|
+
Currently Databasion uses the cucumber test suite. The tests aren't complete, unfortunately.
|
140
138
|
|
141
139
|
## Author
|
142
140
|
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ Jeweler::Tasks.new do |gem|
|
|
8
8
|
gem.email = "mojobojo@gmail.com"
|
9
9
|
gem.homepage = "http://github.com/boj/databasion"
|
10
10
|
gem.authors = ["Brian Jones", "Istpika"]
|
11
|
-
gem.version = "0.0.
|
11
|
+
gem.version = "0.0.9"
|
12
12
|
|
13
13
|
gem.add_dependency('activerecord', '>= 2.3.5')
|
14
14
|
gem.add_dependency('activesupport', '>= 2.3.5')
|
data/databasion.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{databasion}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Jones", "Istpika"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-12}
|
13
13
|
s.default_executable = %q{databasion}
|
14
14
|
s.email = %q{mojobojo@gmail.com}
|
15
15
|
s.executables = ["databasion"]
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
"lib/databasion/csvilize.rb",
|
40
40
|
"lib/databasion/datacize.rb",
|
41
41
|
"lib/databasion/excelize.rb",
|
42
|
-
"lib/databasion/
|
42
|
+
"lib/databasion/gitilize.rb",
|
43
43
|
"lib/databasion/googlize.rb",
|
44
44
|
"lib/databasion/loadlize.rb",
|
45
45
|
"lib/databasion/migitize.rb",
|
File without changes
|
data/lib/databasion/googlize.rb
CHANGED
@@ -59,7 +59,8 @@ module Databasion
|
|
59
59
|
spreadsheet.worksheets.each do |worksheet|
|
60
60
|
next unless master_list.collect { |row| row['spreadsheet'] }.include?(worksheet.title)
|
61
61
|
data_hash = parse(worksheet)
|
62
|
-
data_hash['connection'] = master_list.collect { |row| row if row['spreadsheet'] ==
|
62
|
+
data_hash['connection'] = master_list.collect { |row| row if row['spreadsheet'] == worksheet.title }.reject { |d| d.nil? }[0]
|
63
|
+
puts data_hash.inspect
|
63
64
|
Databasion::Yamalize.yamlbate(data_hash, @@config['output']['yaml_path'])
|
64
65
|
end
|
65
66
|
end
|
@@ -103,11 +104,13 @@ module Databasion
|
|
103
104
|
|
104
105
|
case row[0]
|
105
106
|
when "table"
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
107
|
+
begin
|
108
|
+
d = row[1].split(",")
|
109
|
+
name = d[0].strip
|
110
|
+
plural = false if d[1].strip == 'false'
|
111
|
+
rescue
|
110
112
|
name = row[1]
|
113
|
+
plural = true
|
111
114
|
end
|
112
115
|
when "field"
|
113
116
|
row.each do |field|
|
data/lib/databasion/migitize.rb
CHANGED
@@ -58,7 +58,7 @@ module Databasion
|
|
58
58
|
|
59
59
|
def self.set_table_name(meta)
|
60
60
|
return meta['name'].pluralize if meta['plural']
|
61
|
-
meta['name']
|
61
|
+
meta['name']
|
62
62
|
end
|
63
63
|
|
64
64
|
def self.ruby_model(meta)
|
@@ -76,7 +76,7 @@ module Databasion
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def self.ruby_model_name(meta)
|
79
|
-
meta['
|
79
|
+
meta['name'].camelize
|
80
80
|
end
|
81
81
|
|
82
82
|
def self.ruby_model_table_name(meta)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: databasion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Jones
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-10-12 00:00:00 +09:00
|
20
20
|
default_executable: databasion
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -115,7 +115,7 @@ files:
|
|
115
115
|
- lib/databasion/csvilize.rb
|
116
116
|
- lib/databasion/datacize.rb
|
117
117
|
- lib/databasion/excelize.rb
|
118
|
-
- lib/databasion/
|
118
|
+
- lib/databasion/gitilize.rb
|
119
119
|
- lib/databasion/googlize.rb
|
120
120
|
- lib/databasion/loadlize.rb
|
121
121
|
- lib/databasion/migitize.rb
|