database_loader 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Edgars Beigarts
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -42,6 +42,10 @@ In Rails 2.x you also need to add this to you Rakefile
42
42
  rake db:sql:load:local
43
43
  rake db:sql:load:ext
44
44
 
45
+ To load a single file into database provide file name without extension in NAME environment variable
46
+
47
+ rake db:sql:load:local:view NAME="xx_example_v"
48
+
45
49
  ## Preview generated SQL
46
50
 
47
51
  rake db:sql:dump:local
@@ -55,6 +59,11 @@ you can generate a package containing all your SQL files and send it to DBA.
55
59
  rake db:sql:package:local NAME="v1"
56
60
  rake db:sql:package:ext NAME="v1"
57
61
 
62
+ By default the package is going to be generated between your current commit and Master branch.
63
+ If you would like to change this behavior, provide the starting point as COMMIT parameter.
64
+
65
+ rake db:sql:package:ext NAME="v1" COMMIT="master"
66
+
58
67
  ## Configuration
59
68
 
60
69
  config/initializers/database_loader.rb
@@ -12,7 +12,7 @@ do
12
12
  if test -r ${sql_file}
13
13
  then
14
14
  echo create ${sql_dir} ${sql_file}
15
- sqlplus -s $1/$1 @${sql_file}
15
+ sqlplus -s $1/$2 @${sql_file}
16
16
  fi
17
17
  done
18
18
  fi
@@ -119,7 +119,7 @@ namespace :db do
119
119
  # Try to open the folder for manual reviewing
120
120
  system `open #{File.join(pkg_dir, pkg_name)}`
121
121
  # Cleanup & compress
122
- puts "Press any key to continue"; STDIN.getc
122
+ puts "Press return key to continue"; STDIN.getc
123
123
  Dir.chdir(pkg_dir)
124
124
  sh "tar cf #{pkg_name}.tar #{pkg_name}"
125
125
  ### print
@@ -14,11 +14,11 @@ module DatabaseLoader
14
14
  when :erb
15
15
  require "erb"
16
16
  struct = OpenStruct.new(options)
17
- ERB.new(contents).result(struct.send(:binding))
17
+ ERB.new(contents).result(struct.instance_eval{binding})
18
18
  when :erubis
19
19
  require "erubis"
20
20
  struct = OpenStruct.new(options)
21
- Erubis::Eruby.new(contents).result(struct.send(:binding))
21
+ Erubis::Eruby.new(contents).result(struct.instance_eval{binding})
22
22
  else
23
23
  contents
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module DatabaseLoader
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,36 +1,26 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: database_loader
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Edgars Beigarts
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-01-18 00:00:00 +02:00
19
- default_executable:
12
+ date: 2012-06-16 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
14
  description: Load SQL views, materialized views, grants, etc. into database
23
- email:
15
+ email:
24
16
  - 1@wb4.lv
25
17
  executables: []
26
-
27
18
  extensions: []
28
-
29
19
  extra_rdoc_files: []
30
-
31
- files:
20
+ files:
32
21
  - .gitignore
33
22
  - Gemfile
23
+ - LICENSE
34
24
  - README.md
35
25
  - Rakefile
36
26
  - database_loader.gemspec
@@ -43,39 +33,28 @@ files:
43
33
  - lib/database_loader/tasks.rb
44
34
  - lib/database_loader/template.rb
45
35
  - lib/database_loader/version.rb
46
- has_rdoc: true
47
36
  homepage: http://github.com/ebeigarts/database_loader
48
37
  licenses: []
49
-
50
38
  post_install_message:
51
39
  rdoc_options: []
52
-
53
- require_paths:
40
+ require_paths:
54
41
  - lib
55
- required_ruby_version: !ruby/object:Gem::Requirement
42
+ required_ruby_version: !ruby/object:Gem::Requirement
56
43
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
64
- required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
49
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
73
54
  requirements: []
74
-
75
55
  rubyforge_project:
76
- rubygems_version: 1.4.1
56
+ rubygems_version: 1.8.24
77
57
  signing_key:
78
58
  specification_version: 3
79
59
  summary: Load SQL views, materialized views, grants, etc. into database
80
60
  test_files: []
81
-