dbcompile 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +5 -5
- data/VERSION +1 -1
- data/dbcompile.gemspec +60 -0
- data/example/compile.empty.yml +4 -0
- data/lib/dbcompile.rb +7 -1
- data/lib/tasks/dbcompile.rake +1 -1
- metadata +10 -8
data/README.markdown
CHANGED
@@ -10,15 +10,15 @@ script/plugin install git://github.com/redhatcat/dbcompile.git
|
|
10
10
|
|
11
11
|
### Setup
|
12
12
|
|
13
|
-
Configuration is contained in one file,
|
13
|
+
Configuration is contained in one file, **#{Rails.root}/db/compile.yml**.
|
14
14
|
In here, you describe the statement and dependencies. You can fine an example
|
15
15
|
with comments [here](http://github.com/redhatcat/dbcompile/blob/master/example/compile.yml).
|
16
16
|
|
17
|
-
The SQL scripts themselves are places in several directories under
|
17
|
+
The SQL scripts themselves are places in several directories under **#{Rails.root}/db**.
|
18
18
|
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
19
|
+
* #{Rails.root}/db/functions contains function scripts.
|
20
|
+
* #{Rails.root}/db/triggers contains trigger scripts.
|
21
|
+
* #{Rails.root}/db/views contains view scripts.
|
22
22
|
|
23
23
|
All of these scripts, with the exception of views, should be self replacing,
|
24
24
|
e.g. you will want to use statements like *CREATE OR REPLACE FUNCTION*.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
1.0.0
|
data/dbcompile.gemspec
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "dbcompile"
|
8
|
+
s.version = "1.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Tyler Lesmann"]
|
12
|
+
s.date = "2012-11-21"
|
13
|
+
s.description = "Rails plugin for loading various SQL constructs, like views, functions, and triggers"
|
14
|
+
s.email = "redhatcat@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.markdown"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
"Gemfile",
|
21
|
+
"LICENSE.txt",
|
22
|
+
"README.markdown",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"dbcompile.gemspec",
|
26
|
+
"example/compile.empty.yml",
|
27
|
+
"example/compile.yml",
|
28
|
+
"lib/dbcompile.rb",
|
29
|
+
"lib/dbcompile/construct.rb",
|
30
|
+
"lib/dbcompile/function.rb",
|
31
|
+
"lib/dbcompile/transaction.rb",
|
32
|
+
"lib/dbcompile/trigger.rb",
|
33
|
+
"lib/dbcompile/view.rb",
|
34
|
+
"lib/tasks/dbcompile.rake"
|
35
|
+
]
|
36
|
+
s.homepage = "http://github.com/redhatcat/dbcompile"
|
37
|
+
s.licenses = ["MIT"]
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
s.rubygems_version = "1.8.15"
|
40
|
+
s.summary = "Rails plugin for loading various SQL constructs, like views, functions, and triggers"
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
s.specification_version = 3
|
44
|
+
|
45
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
47
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
48
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
51
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
52
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
53
|
+
end
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
56
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
data/lib/dbcompile.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
require 'dbcompile/transaction.rb'
|
2
2
|
|
3
3
|
module DbCompile
|
4
|
+
class Task < Rails::Railtie
|
5
|
+
rake_tasks do
|
6
|
+
Dir[File.join(File.dirname(__FILE__),'tasks/*.rake')].each { |f| load f }
|
7
|
+
end
|
8
|
+
end
|
4
9
|
def self.build_transaction(path=nil)
|
5
10
|
if not path
|
6
|
-
path = File.join(
|
11
|
+
path = File.join(Rails.root, 'db')
|
7
12
|
end
|
8
13
|
transaction = Transaction.new(path)
|
9
14
|
transaction.execute
|
@@ -12,3 +17,4 @@ module DbCompile
|
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
20
|
+
|
data/lib/tasks/dbcompile.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbcompile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-11-21 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
16
|
-
requirement: &
|
16
|
+
requirement: &22047420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.12'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *22047420
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &22046180 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *22046180
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &22061120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 1.8.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *22061120
|
47
47
|
description: Rails plugin for loading various SQL constructs, like views, functions,
|
48
48
|
and triggers
|
49
49
|
email: redhatcat@gmail.com
|
@@ -58,6 +58,8 @@ files:
|
|
58
58
|
- README.markdown
|
59
59
|
- Rakefile
|
60
60
|
- VERSION
|
61
|
+
- dbcompile.gemspec
|
62
|
+
- example/compile.empty.yml
|
61
63
|
- example/compile.yml
|
62
64
|
- lib/dbcompile.rb
|
63
65
|
- lib/dbcompile/construct.rb
|
@@ -81,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
83
|
version: '0'
|
82
84
|
segments:
|
83
85
|
- 0
|
84
|
-
hash:
|
86
|
+
hash: -4280784668053764050
|
85
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
88
|
none: false
|
87
89
|
requirements:
|