listen_sql 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c54c83fcbf2176382bb77c8fc0c1b93a620ee5e
4
- data.tar.gz: aae8823e8e3147e3d2043465d7a1af699062e101
3
+ metadata.gz: 32ef53c64373b9c3e09ddd399bea9a2b5835d7d5
4
+ data.tar.gz: aa6fb8d49296f275b30af53ba64d55430acb9b54
5
5
  SHA512:
6
- metadata.gz: fede8c8451607716012a5fc9f64b64f75e49c6f4e34c984285779d41b6e3fd2dbb5cfa0474639d6a2f2d07789d77f5f3b1e6d21000c2c9504f8c82b84cddef09
7
- data.tar.gz: a47a5b39da00fbf5f13a6d28ccb4dc286e67d34382ee366f0a51e06ae255058863511c4da41f80c9b0a1666548daf62cf42855bcc9d77749eab3ae891869039e
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
- if $0 == __FILE__
30
- db_name = ARGV.shift || usage('DBNAME should be first argument or set PGDATABASE in ENV!')
31
- src = ARGV.shift || usage('SRC should be second argument!')
32
- no_color = ARGV.detect{|a| a == '--no-color'}
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
- if $0 == __FILE__
35
- listener.start # not blocking
36
- puts "Watching for changes to #{dir}"
37
- puts "<CTRL-C> to quit"
38
- sleep
39
- end
33
+ listener.start # not blocking
34
+ puts "Watching for changes to #{dir}"
35
+ puts "<CTRL-C> to quit"
36
+ sleep
@@ -1,3 +1,3 @@
1
1
  module ListenSql
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listen_sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Pierce