databasion 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -131,7 +131,6 @@ If the currently created databasion project is committed to SVN, running the _--
131
131
  __0.1.0__
132
132
 
133
133
  * Add ability to read existing tables, and make relative alter table migration scripts.
134
- * Convert Yamalize and Migratize code to templates instead of inline.
135
134
 
136
135
  ## Testing
137
136
 
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.5"
11
+ gem.version = "0.0.6"
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.5"
8
+ s.version = "0.0.6"
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-05-21}
12
+ s.date = %q{2010-05-24}
13
13
  s.default_executable = %q{databasion}
14
14
  s.email = %q{mojobojo@gmail.com}
15
15
  s.executables = ["databasion"]
@@ -39,6 +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/gititlize.rb",
42
43
  "lib/databasion/googlize.rb",
43
44
  "lib/databasion/loadlize.rb",
44
45
  "lib/databasion/migitize.rb",
@@ -0,0 +1,7 @@
1
+ module Databasion
2
+
3
+ class Gitilize
4
+
5
+ end
6
+
7
+ end
@@ -16,15 +16,15 @@ module Databasion
16
16
  @@config = config
17
17
 
18
18
  Databasion::LOGGER.info "Migrabating..."
19
- configure_start
20
19
  parse(file_list)
21
20
  Databasion::LOGGER.info "Migrabated!"
22
21
  end
23
22
 
24
23
  private
25
- def self.configure_start
26
- files = Dir[@@config['output']['migrations']['path'] + "/**/*.rb"].collect { |file| file.split("/").pop }.sort
27
- @@migration_start = files[files.size-1].split("_")[0].to_i if files.size > 0
24
+ def self.configure_start(dbname)
25
+ @@migration_start = 100
26
+ files = Dir[@@config['output']['migrations']['path'] + "/%s/*.rb" % dbname].collect { |file| file.split("/").pop }.sort
27
+ @@migration_start = files[files.size-1].split("_")[0].to_i + 1 if files.size > 0
28
28
  end
29
29
 
30
30
  def self.parse(file_list)
@@ -38,6 +38,7 @@ module Databasion
38
38
  end
39
39
 
40
40
  def self.process(meta)
41
+ configure_start(meta['connection']['dbname'])
41
42
  write_migration(migration_class(meta), meta['name'], meta['connection']['dbname'])
42
43
  write_ruby(ruby_model(meta), meta['name'])
43
44
  Databasion::LOGGER.info "Migrabated %s..." % meta['name']
@@ -83,7 +84,6 @@ module Databasion
83
84
  end
84
85
 
85
86
  def self.write_migration(migration, file_name, sub_path)
86
- puts sub_path
87
87
  path = @@config['output']['migrations']['path'] + "/" + sub_path
88
88
  check_output_path(path)
89
89
  unless migration_exists?(file_name)
data/lib/databasion.rb CHANGED
@@ -72,5 +72,6 @@ module Databasion
72
72
  autoload :Loadlize, APP_PATH + '/databasion/loadlize.rb'
73
73
  autoload :Datacize, APP_PATH + '/databasion/datacize.rb'
74
74
  autoload :Svnilize, APP_PATH + '/databasion/svnilize.rb'
75
+ autoload :Gitilize, APP_PATH + '/databasion/gitilize.rb'
75
76
 
76
77
  end
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: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
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-05-21 00:00:00 +09:00
19
+ date: 2010-05-24 00:00:00 +09:00
20
20
  default_executable: databasion
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -115,6 +115,7 @@ files:
115
115
  - lib/databasion/csvilize.rb
116
116
  - lib/databasion/datacize.rb
117
117
  - lib/databasion/excelize.rb
118
+ - lib/databasion/gititlize.rb
118
119
  - lib/databasion/googlize.rb
119
120
  - lib/databasion/loadlize.rb
120
121
  - lib/databasion/migitize.rb