listen_sql 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/exec_sql +5 -7
- data/exe/listen_sql +5 -8
- data/lib/listen_sql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ef53c64373b9c3e09ddd399bea9a2b5835d7d5
|
4
|
+
data.tar.gz: aa6fb8d49296f275b30af53ba64d55430acb9b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c116014e0f8f15a3633c05aac84cff7056c48a8f8d0056ae3d29f07ed6fdbbb75bb03562cf4c1e7f6a10fa97f16daf210f74624197506a110a1b8214ccc0b955
|
7
|
+
data.tar.gz: e0e921a0dcde86af0288f2f17881b5b72fbb0e491f37dbf1341866daafd0a84983d8163cf2f351e4ba3f4b46ec2ce357d9c5c64708755591940828d17c28321c
|
data/exe/exec_sql
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'bundler/setup'
|
4
3
|
require 'listen_sql'
|
4
|
+
require 'coderay'
|
5
5
|
|
6
6
|
def usage(message=nil)
|
7
7
|
text = <<-TEXT
|
@@ -26,9 +26,7 @@ def usage(message=nil)
|
|
26
26
|
puts text
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
ListenSql.exec_sql(db_name, src, color: !no_color)
|
34
|
-
end
|
29
|
+
db_name = ARGV.shift || usage('DBNAME should be first argument or set PGDATABASE in ENV!')
|
30
|
+
src = ARGV.shift || usage('SRC should be second argument!')
|
31
|
+
no_color = ARGV.detect{|a| a == '--no-color'}
|
32
|
+
ListenSql.exec_sql(db_name, src, color: !no_color)
|
data/exe/listen_sql
CHANGED
@@ -3,9 +3,8 @@
|
|
3
3
|
# Listens for any SQL file changes and executes them using the default PSQL
|
4
4
|
# settings.
|
5
5
|
|
6
|
-
require 'bundler/setup'
|
7
|
-
require 'listen_sql'
|
8
6
|
require 'listen'
|
7
|
+
require 'listen_sql'
|
9
8
|
|
10
9
|
def usage(message=nil)
|
11
10
|
text = <<-TEXT
|
@@ -31,9 +30,7 @@ listener = Listen.to(dir, only: /\.sql$/) do |modified, _|
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
sleep
|
39
|
-
end
|
33
|
+
listener.start # not blocking
|
34
|
+
puts "Watching for changes to #{dir}"
|
35
|
+
puts "<CTRL-C> to quit"
|
36
|
+
sleep
|
data/lib/listen_sql/version.rb
CHANGED