pg_gnostic 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -10
- data/Rakefile +2 -2
- data/lib/pg_gnostic.rb +1 -1
- data/rails/generators/pg_view/templates/model.rb +1 -1
- data/tasks/pg_gnostic_tasks.rake +5 -5
- data/test/rails_root/app/model/views/role.rb +1 -1
- data/test/rails_root/app/model/views/user.rb +1 -1
- metadata +56 -81
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
== PgGnostic
|
2
2
|
|
3
|
-
Rails and postgres deeper integration
|
3
|
+
Rails and postgres deeper integration
|
4
4
|
|
5
5
|
== Install
|
6
6
|
|
@@ -8,7 +8,7 @@ in config/environment.rb:
|
|
8
8
|
|
9
9
|
config.gem 'pg_gnostic'
|
10
10
|
|
11
|
-
and then
|
11
|
+
and then
|
12
12
|
|
13
13
|
sudo rake gems:install
|
14
14
|
|
@@ -21,16 +21,18 @@ and then
|
|
21
21
|
|
22
22
|
== CHANGE LOG:
|
23
23
|
|
24
|
-
0.
|
25
|
-
0.
|
26
|
-
0.0
|
27
|
-
0.0.5 - compatibility with Ruby 1.9
|
28
|
-
0.
|
24
|
+
* 0.1.2 - replace usages of RAILS_ROOT with Rails.root
|
25
|
+
* 0.1.1 - fix problem with removing entire directory with views on rails destroy pg_view
|
26
|
+
* 0.1.0 - converted to Rails 3 format. No backward compatibility with Rails 2.x
|
27
|
+
* 0.0.5 - compatibility with Ruby 1.9
|
28
|
+
* 0.0.4 - kung_figure dependency updated
|
29
|
+
* 0.0.3 - add PgGnostic::ViewDefinition#clear_declarations method
|
30
|
+
* 0.0.2 - backup/restore rakes
|
29
31
|
|
30
|
-
== TODO
|
32
|
+
== TODO
|
31
33
|
|
32
|
-
* backup rake
|
33
|
-
* loganalize rake
|
34
|
+
* backup rake
|
35
|
+
* loganalize rake
|
34
36
|
* functions generator
|
35
37
|
|
36
38
|
== LICENSE:
|
data/Rakefile
CHANGED
@@ -29,13 +29,13 @@ PKG_FILES = FileList[ '[a-zA-Z]*', 'rails/generators/**/*', 'lib/**/*', 'rails/*
|
|
29
29
|
require File.join(File.dirname(__FILE__), 'lib/pg_gnostic')
|
30
30
|
spec = Gem::Specification.new do |s|
|
31
31
|
s.name = "pg_gnostic"
|
32
|
-
s.version = PgGnostic::VERSION
|
32
|
+
s.version = PgGnostic::VERSION
|
33
33
|
s.author = "niquola"
|
34
34
|
s.email = "niquola@gmail.com"
|
35
35
|
s.homepage = "http://github.com/niquola/pg_gnostic"
|
36
36
|
s.platform = Gem::Platform::RUBY
|
37
37
|
s.summary = "Rails plugin for postgres"
|
38
|
-
s.files = PKG_FILES.to_a
|
38
|
+
s.files = PKG_FILES.to_a
|
39
39
|
s.require_path = "lib"
|
40
40
|
s.has_rdoc = false
|
41
41
|
s.extra_rdoc_files = ["README.rdoc"]
|
data/lib/pg_gnostic.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<% unless nest_in_module.empty? %>
|
2
2
|
module <%= nest_in_module %>
|
3
3
|
<% end %>
|
4
|
-
class <%= class_name %> < ActiveRecord::Base
|
4
|
+
class <%= class_name %> < ActiveRecord::Base
|
5
5
|
<% unless prefix_view_name.empty? %>
|
6
6
|
set_table_name "<%= prefix_view_name %>_#{table_name}"
|
7
7
|
<% end %>
|
data/tasks/pg_gnostic_tasks.rake
CHANGED
@@ -41,7 +41,7 @@ namespace :pg do
|
|
41
41
|
|
42
42
|
file = ENV["PGBACKUP"]
|
43
43
|
config = ActiveRecord::Base.configurations[RAILS_ENV || 'development']
|
44
|
-
backupdir = get_backup_dir
|
44
|
+
backupdir = get_backup_dir
|
45
45
|
if file && File.exists?(file)
|
46
46
|
file = file
|
47
47
|
elsif file && File.exists?(File.join(backupdir,file))
|
@@ -61,7 +61,7 @@ namespace :pg do
|
|
61
61
|
'port'=>config["port"],
|
62
62
|
'username'=>config["username"]
|
63
63
|
}.map{|k,v| "--#{k}=#{v}" if v}.join(' ')
|
64
|
-
unarchiver = PgGnostic.config.backup.unarchive_command
|
64
|
+
unarchiver = PgGnostic.config.backup.unarchive_command
|
65
65
|
command = "export PGPASSWORD=#{config["password"]} && #{unarchiver} #{file} | psql #{params} -w #{config["database"]}"
|
66
66
|
puts "Execute: #{command}"
|
67
67
|
system command
|
@@ -77,7 +77,7 @@ namespace :pg do
|
|
77
77
|
task :drop_views=>:environment do
|
78
78
|
#ActiveRecord::Base.logger=Logger.new STDOUT
|
79
79
|
PgGnostic::ViewDefinition.clear_declarations
|
80
|
-
PgGnostic::ViewDefinition.load_declarations(File.join(
|
80
|
+
PgGnostic::ViewDefinition.load_declarations(File.join(Rails.root,'db','views'))
|
81
81
|
PgGnostic::ViewDefinition.delete_all
|
82
82
|
end
|
83
83
|
|
@@ -85,13 +85,13 @@ namespace :pg do
|
|
85
85
|
task :views=>:environment do
|
86
86
|
#ActiveRecord::Base.logger=Logger.new STDOUT
|
87
87
|
PgGnostic::ViewDefinition.clear_declarations
|
88
|
-
PgGnostic::ViewDefinition.load_declarations File.join(
|
88
|
+
PgGnostic::ViewDefinition.load_declarations File.join(Rails.root,'db','views')
|
89
89
|
PgGnostic::ViewDefinition.update
|
90
90
|
end
|
91
91
|
|
92
92
|
desc "updates functions"
|
93
93
|
task :functions => [:environment] do
|
94
|
-
Dir["#{File.join(
|
94
|
+
Dir["#{File.join(Rails.root,'db','functions')}/*.sql"].sort.each do |f|
|
95
95
|
begin
|
96
96
|
puts "execute #{f}"
|
97
97
|
sql=open(f,'r').readlines.join("\n")
|
metadata
CHANGED
@@ -1,129 +1,104 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_gnostic
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
version: 0.1.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- niquola
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-17 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: kung_figure
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &10736320 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
31
22
|
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rails
|
35
23
|
prerelease: false
|
36
|
-
|
24
|
+
version_requirements: *10736320
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails
|
27
|
+
requirement: &10734880 !ruby/object:Gem::Requirement
|
37
28
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
segments:
|
42
|
-
- 3
|
43
|
-
- 0
|
44
|
-
- 0
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
45
32
|
version: 3.0.0
|
46
33
|
type: :runtime
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: test-unit
|
50
34
|
prerelease: false
|
51
|
-
|
35
|
+
version_requirements: *10734880
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: test-unit
|
38
|
+
requirement: &10734300 !ruby/object:Gem::Requirement
|
52
39
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
- 0
|
58
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
59
44
|
type: :development
|
60
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *10734300
|
61
47
|
description:
|
62
48
|
email: niquola@gmail.com
|
63
49
|
executables: []
|
64
|
-
|
65
50
|
extensions: []
|
66
|
-
|
67
|
-
extra_rdoc_files:
|
51
|
+
extra_rdoc_files:
|
68
52
|
- README.rdoc
|
69
|
-
files:
|
70
|
-
- Rakefile
|
53
|
+
files:
|
71
54
|
- MIT-LICENSE
|
72
55
|
- README.rdoc
|
73
|
-
-
|
56
|
+
- Rakefile
|
74
57
|
- rails/generators/pg_view/templates/view.sql
|
58
|
+
- rails/generators/pg_view/templates/view.rb
|
75
59
|
- rails/generators/pg_view/templates/model.rb
|
76
|
-
- rails/generators/pg_view/USAGE
|
77
60
|
- rails/generators/pg_view/pg_view_generator.rb
|
61
|
+
- rails/generators/pg_view/USAGE
|
62
|
+
- lib/pg_gnostic.rb
|
63
|
+
- lib/pg_gnostic/railtie.rb
|
78
64
|
- lib/pg_gnostic/view_definition.rb
|
79
65
|
- lib/pg_gnostic/config.rb
|
80
|
-
- lib/pg_gnostic/railtie.rb
|
81
|
-
- lib/pg_gnostic.rb
|
82
66
|
- tasks/pg_gnostic_tasks.rake
|
67
|
+
- test/config_test.rb
|
68
|
+
- test/view_definition_test.rb
|
69
|
+
- test/rails_root/db/views/roles.sql
|
70
|
+
- test/rails_root/db/views/users.rb
|
71
|
+
- test/rails_root/app/model/views/role.rb
|
72
|
+
- test/rails_root/app/model/views/user.rb
|
73
|
+
- test/db/schema.rb
|
83
74
|
- test/db/views/users.rb
|
84
75
|
- test/db/views/other_users.sql
|
85
|
-
- test/db/schema.rb
|
86
76
|
- test/database.yml
|
87
|
-
- test/config_test.rb
|
88
|
-
- test/view_definition_test.rb
|
89
77
|
- test/pg_gnostic_test.rb
|
90
78
|
- test/test_helper.rb
|
91
79
|
- test/view_generator_test.rb
|
92
|
-
- test/rails_root/db/views/users.rb
|
93
|
-
- test/rails_root/db/views/roles.sql
|
94
|
-
- test/rails_root/app/model/views/user.rb
|
95
|
-
- test/rails_root/app/model/views/role.rb
|
96
|
-
has_rdoc: true
|
97
80
|
homepage: http://github.com/niquola/pg_gnostic
|
98
81
|
licenses: []
|
99
|
-
|
100
82
|
post_install_message:
|
101
83
|
rdoc_options: []
|
102
|
-
|
103
|
-
require_paths:
|
84
|
+
require_paths:
|
104
85
|
- lib
|
105
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
87
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
|
112
|
-
version: "0"
|
113
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
93
|
none: false
|
115
|
-
requirements:
|
116
|
-
- -
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
|
119
|
-
- 0
|
120
|
-
version: "0"
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
121
98
|
requirements: []
|
122
|
-
|
123
99
|
rubyforge_project:
|
124
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.8.10
|
125
101
|
signing_key:
|
126
102
|
specification_version: 3
|
127
103
|
summary: Rails plugin for postgres
|
128
104
|
test_files: []
|
129
|
-
|