monocle-views 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53586f4daaba8fb51c88c7e6a21120a3f4e6ab16
4
- data.tar.gz: f76088758289e841ff8b6d1d90a12963b41995c9
3
+ metadata.gz: 995abad36c22c364f7ddefeb1d08139158b9e7d5
4
+ data.tar.gz: 6a449d53cd2e830a6f45b4a132715ec45715f3bf
5
5
  SHA512:
6
- metadata.gz: f04d6a94c484e8c9f9fafb6d60128ed532c294494d67608dfca41e1c521964bfdb0c52520c1ffc3a046c7fad25ce93b2ad9001d1eed30f3f8dec260c83eb1b42
7
- data.tar.gz: 8eb2112b7f67c0883cdcda43469b076e846e829a93abdc7b27ad2e54389db2ba23566b4d90b212a1778179505d8a0e5d105bb2c7fa5a57e00dbd317a06089692
6
+ metadata.gz: 8eb594e8342260008027c8a22bfe06f78ee8aa375b6e3b5494e12b7f797a9f8233e1130e4fab251b13a19027ccabb8a71d1aa8b53987d2cf70bbbeb15ca04b95
7
+ data.tar.gz: feed16501767742214d8421b30cc2b51714c2d5a7216dfcbd4afd65717e3c214a1fffb12c8d66c7b794a380058a1da3677cf1cc46efa35a109c32ed6ee571279
@@ -0,0 +1,23 @@
1
+ class Monocle::DropCommand
2
+
3
+ attr_reader :view
4
+
5
+ def initialize(view)
6
+ @view = view
7
+ end
8
+
9
+ def call
10
+ # Get the SQL from the file, skipping the timestamp row
11
+ # Drop the newlines too
12
+ sql = File.readlines(view.path_for_sql)[1..-1]
13
+ # Generate the new timestamp line
14
+ drop_directive = ["-- Drop\n"]
15
+ # Put it back together
16
+ new_sql = (drop_directive + sql).join
17
+ # Open the file for writing (no w+, we want to clear it up)
18
+ File.open(view.path_for_sql, "w") do |f|
19
+ f << new_sql
20
+ end
21
+ end
22
+
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Monocle
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monocle-views
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Bighetti
@@ -170,17 +170,13 @@ executables: []
170
170
  extensions: []
171
171
  extra_rdoc_files: []
172
172
  files:
173
- - ".ruby-version"
174
- - Gemfile
175
- - Gemfile.lock
176
173
  - LICENSE.txt
177
174
  - README.md
178
175
  - Rakefile
179
- - bin/console
180
- - bin/setup
181
176
  - lib/monocle.rb
182
177
  - lib/monocle/bump_command.rb
183
178
  - lib/monocle/configuration.rb
179
+ - lib/monocle/drop_command.rb
184
180
  - lib/monocle/generators/install_generator.rb
185
181
  - lib/monocle/generators/matview_generator.rb
186
182
  - lib/monocle/generators/view_generator.rb
@@ -191,7 +187,6 @@ files:
191
187
  - lib/monocle/version_generator.rb
192
188
  - lib/monocle/view.rb
193
189
  - lib/tasks/monocle.rake
194
- - monocle.gemspec
195
190
  homepage: https://github.com/tommyfriendhusen08/monocle
196
191
  licenses:
197
192
  - MIT
@@ -1 +0,0 @@
1
- 2.3.1
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in monocle.gemspec
4
- gemspec
@@ -1,75 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- ar-monocle (0.1.6)
5
- activerecord (>= 4, < 6)
6
- activesupport (>= 4, < 6)
7
- rake
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
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
- concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (~> 0.7)
21
- minitest (~> 5.1)
22
- tzinfo (~> 1.1)
23
- arel (8.0.0)
24
- coderay (1.1.1)
25
- concurrent-ruby (1.0.5)
26
- database_cleaner (1.5.3)
27
- diff-lcs (1.3)
28
- dotenv (2.2.0)
29
- i18n (0.8.1)
30
- metaclass (0.0.4)
31
- method_source (0.8.2)
32
- minitest (5.10.2)
33
- mocha (1.2.1)
34
- metaclass (~> 0.0.1)
35
- pg (0.19.0)
36
- pry (0.10.4)
37
- coderay (~> 1.1.0)
38
- method_source (~> 0.8.1)
39
- slop (~> 3.4)
40
- pry-nav (0.2.4)
41
- pry (>= 0.9.10, < 0.11.0)
42
- rake (12.0.0)
43
- rspec (3.5.0)
44
- rspec-core (~> 3.5.0)
45
- rspec-expectations (~> 3.5.0)
46
- rspec-mocks (~> 3.5.0)
47
- rspec-core (3.5.4)
48
- rspec-support (~> 3.5.0)
49
- rspec-expectations (3.5.0)
50
- diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.5.0)
52
- rspec-mocks (3.5.0)
53
- diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.5.0)
55
- rspec-support (3.5.0)
56
- slop (3.6.0)
57
- thread_safe (0.3.6)
58
- tzinfo (1.2.3)
59
- thread_safe (~> 0.1)
60
-
61
- PLATFORMS
62
- ruby
63
-
64
- DEPENDENCIES
65
- ar-monocle!
66
- bundler (~> 1.14)
67
- database_cleaner
68
- dotenv
69
- mocha
70
- pg
71
- pry-nav
72
- rspec (~> 3.0)
73
-
74
- BUNDLED WITH
75
- 1.14.6
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "monocle"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,35 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'monocle/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "monocle-views"
8
- spec.version = Monocle::VERSION
9
- spec.authors = ["Leonardo Bighetti", "Eric Draut"]
10
- spec.email = ["eric@invitedhome.com"]
11
-
12
- spec.summary = %q{Monocle helps you manage your DB views.}
13
- spec.description = %q{Monocle helps you manage your DB views.}
14
- spec.homepage = "https://github.com/tommyfriendhusen08/monocle"
15
- spec.license = "MIT"
16
-
17
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features)/})
19
- end
20
- spec.bindir = "exe"
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
- spec.require_paths = ["lib"]
23
-
24
- spec.add_development_dependency "bundler", "~> 1.14"
25
- spec.add_development_dependency "rspec", "~> 3.0"
26
- spec.add_development_dependency "mocha"
27
- spec.add_development_dependency "pry-nav"
28
- spec.add_development_dependency "dotenv"
29
- spec.add_development_dependency "pg"
30
- spec.add_development_dependency "database_cleaner"
31
-
32
- spec.add_dependency "rake"
33
- spec.add_dependency "activesupport", ">= 4", "< 6"
34
- spec.add_dependency "activerecord", ">= 4", "< 6"
35
- end