ar-monocle 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +11 -11
- data/README.md +1 -1
- data/lib/monocle.rb +7 -0
- data/lib/monocle/version.rb +1 -1
- data/lib/tasks/monocle.rake +10 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e223d27b9b0fa7d4720eacd64a56937f256735a2
|
4
|
+
data.tar.gz: 829fbc4d879893d7a8d014c3a00474d112aad446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1137ca323d94f3f472870bf5796171fd729c4ff915a9faec6bde18c0de80ff1e08632511dcb036b482b92ce525cc3a6c41bd8c57d2ad43a9b26c484fd424ecd1
|
7
|
+
data.tar.gz: 07d3c8e4087d2167c633c49f1c5ade9c4c680ac4b8e220b0bb538786f9603b736d4e787d6de1d63cdcb1be7867f9df636cadc7dd1585fb7db64a3917a86637e7
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ar-monocle (0.1.
|
4
|
+
ar-monocle (0.1.3)
|
5
5
|
activerecord (>= 4, < 6)
|
6
6
|
activesupport (>= 4, < 6)
|
7
7
|
rake
|
@@ -9,18 +9,18 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (5.0
|
13
|
-
activesupport (= 5.0
|
14
|
-
activerecord (5.0
|
15
|
-
activemodel (= 5.0
|
16
|
-
activesupport (= 5.0
|
17
|
-
arel (~>
|
18
|
-
activesupport (5.0
|
12
|
+
activemodel (5.1.0)
|
13
|
+
activesupport (= 5.1.0)
|
14
|
+
activerecord (5.1.0)
|
15
|
+
activemodel (= 5.1.0)
|
16
|
+
activesupport (= 5.1.0)
|
17
|
+
arel (~> 8.0)
|
18
|
+
activesupport (5.1.0)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (~> 0.7)
|
21
21
|
minitest (~> 5.1)
|
22
22
|
tzinfo (~> 1.1)
|
23
|
-
arel (
|
23
|
+
arel (8.0.0)
|
24
24
|
coderay (1.1.1)
|
25
25
|
concurrent-ruby (1.0.5)
|
26
26
|
database_cleaner (1.5.3)
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
i18n (0.8.1)
|
30
30
|
metaclass (0.0.4)
|
31
31
|
method_source (0.8.2)
|
32
|
-
minitest (5.10.
|
32
|
+
minitest (5.10.2)
|
33
33
|
mocha (1.2.1)
|
34
34
|
metaclass (~> 0.0.1)
|
35
35
|
pg (0.19.0)
|
@@ -72,4 +72,4 @@ DEPENDENCIES
|
|
72
72
|
rspec (~> 3.0)
|
73
73
|
|
74
74
|
BUNDLED WITH
|
75
|
-
1.14.
|
75
|
+
1.14.6
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# Monocle
|
3
3
|
|
4
|
-
|
4
|
+
Monocle helps you tame your database views by keeping the SQLs versioned neatly in your project and knowing when and how to migrate them if necessary. It knows how to deal with PostgreSQL materialized views and dependencies (view A points to view B) as well as regular views.
|
5
5
|
|
6
6
|
Monocle works with or without Rails, all it assumes is you're using ActiveRecord. See _Usage_ for more details.
|
7
7
|
|
data/lib/monocle.rb
CHANGED
@@ -51,6 +51,13 @@ module Monocle
|
|
51
51
|
fetch(view_name).refresh concurrently: concurrently
|
52
52
|
end
|
53
53
|
|
54
|
+
def refresh_all
|
55
|
+
list.each do |key, view|
|
56
|
+
logger.info "Refreshing view #{key}..."
|
57
|
+
view.refresh # this will be a noop for non matviews
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
54
61
|
# Enables you to configure things in a block, i.e
|
55
62
|
# Monocle.configure do |config|
|
56
63
|
# config.logger = MyLogger.new
|
data/lib/monocle/version.rb
CHANGED
data/lib/tasks/monocle.rake
CHANGED
@@ -15,6 +15,16 @@ namespace :monocle do
|
|
15
15
|
Rake::Task['db:structure:dump'].invoke
|
16
16
|
end
|
17
17
|
|
18
|
+
desc "Refreshes a given monocle view"
|
19
|
+
task :refresh, [:view_name] => :environment do |t, args|
|
20
|
+
Monocle.refresh(args.view_name)
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Refreshes a given monocle view"
|
24
|
+
task :refresh_all => :environment do |t, args|
|
25
|
+
Monocle.refresh_all
|
26
|
+
end
|
27
|
+
|
18
28
|
desc "Bump a monocle view's timestamp by name"
|
19
29
|
task :bump, [:view_name] do |t, args|
|
20
30
|
Rake::Task['environment'].invoke
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar-monocle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonardo Bighetti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -169,6 +169,7 @@ executables: []
|
|
169
169
|
extensions: []
|
170
170
|
extra_rdoc_files: []
|
171
171
|
files:
|
172
|
+
- ".ruby-version"
|
172
173
|
- Gemfile
|
173
174
|
- Gemfile.lock
|
174
175
|
- LICENSE.txt
|