spectacles 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -0
- data/lib/spectacles/configuration.rb +2 -1
- data/lib/spectacles/railtie.rb +5 -2
- data/lib/spectacles/schema_dumper.rb +9 -3
- data/lib/spectacles/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c61cd91dee27e0e255cc4e1d98f493e6d94a12f
|
4
|
+
data.tar.gz: 1d95c23e8f0235f4468ec337632a79a7caed2fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 289104b7bf5334b9af7861017d91c3ec7235af1ec01f038708dc9617ba0d3fe581ccb2972882332faf3035c3f56408c3148cdf81b64841b76d7fdfcbe696fbdb
|
7
|
+
data.tar.gz: ee5dbd357210a7f218b21b9811325904ece703065ae82968fe187a57532e0e2c2c367d6d8c18ae506ca9838df2a41a12bcf25f62f196b5aa02b64ba7e1320d27
|
data/.travis.yml
ADDED
data/lib/spectacles/railtie.rb
CHANGED
@@ -5,11 +5,14 @@ module Spectacles
|
|
5
5
|
class Railtie < ::Rails::Railtie
|
6
6
|
config.spectacles = ::ActiveSupport::OrderedOptions.new
|
7
7
|
|
8
|
-
initializer
|
8
|
+
initializer 'spectacles.configure' do |app|
|
9
9
|
Spectacles.configure do |config|
|
10
|
-
if app.config.spectacles.
|
10
|
+
if app.config.spectacles.key?(:enable_schema_dump)
|
11
11
|
config.enable_schema_dump = app.config.spectacles[:enable_schema_dump]
|
12
12
|
end
|
13
|
+
if app.config.spectacles.key?(:skip_views)
|
14
|
+
config.skip_views = app.config.spectacles[:skip_views]
|
15
|
+
end
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
@@ -1,17 +1,19 @@
|
|
1
1
|
module Spectacles
|
2
2
|
module SchemaDumper
|
3
3
|
def self.dump_views(stream, connection)
|
4
|
-
unless
|
4
|
+
unless Spectacles.config.enable_schema_dump == false
|
5
5
|
connection.views.sort.each do |view|
|
6
|
+
next if skip_view?(view)
|
6
7
|
dump_view(stream, connection, view)
|
7
8
|
end
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
11
12
|
def self.dump_materialized_views(dumper, stream, connection)
|
12
|
-
unless
|
13
|
+
unless Spectacles.config.enable_schema_dump == false
|
13
14
|
if connection.supports_materialized_views?
|
14
15
|
connection.materialized_views.sort.each do |view|
|
16
|
+
next if skip_view?(view)
|
15
17
|
dump_materialized_view(stream, connection, view)
|
16
18
|
dumper.send(:indexes, view, stream)
|
17
19
|
end
|
@@ -46,7 +48,7 @@ module Spectacles
|
|
46
48
|
def self.format_option_hash(hash)
|
47
49
|
hash.map do |key, value|
|
48
50
|
"#{key}: #{format_option_value(value)}"
|
49
|
-
end.join(
|
51
|
+
end.join(', ')
|
50
52
|
end
|
51
53
|
|
52
54
|
def self.format_option_value(value)
|
@@ -58,5 +60,9 @@ module Spectacles
|
|
58
60
|
else raise "can't format #{value.inspect}"
|
59
61
|
end
|
60
62
|
end
|
63
|
+
|
64
|
+
def self.skip_view?(view)
|
65
|
+
Spectacles.config.skip_views.any? { |item| item === view }
|
66
|
+
end
|
61
67
|
end
|
62
68
|
end
|
data/lib/spectacles/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spectacles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hutchison, Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -75,6 +75,7 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE
|
80
81
|
- Rakefile
|
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
131
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.6.12
|
132
133
|
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: Spectacles (derived from RailsSQLViews) adds database view functionality
|