hsql 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hsql +7 -2
- data/lib/hsql/file.rb +1 -1
- data/lib/hsql/template.rb +2 -2
- data/lib/hsql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cbc29780960ce0454e0bdd075f296a75eff08a
|
4
|
+
data.tar.gz: 866fa2ea979dd4d9bb1df5381181d35f323cf178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8b9a2a8a856a53bfe5205c6330483fca9b8f0e7426fbd1e7a1a69249c0604f50b479ed89d692edcb62eef1d030b879164e508dae9bef59cba84040b67f3b2c
|
7
|
+
data.tar.gz: fef426598ce5b2de7efc13dbb437f6a80a55f78bd785a0c8371582060383d225f9602fda4e663312fe428978f383e968a09af76a10e2d6a7ae22654d926c0e3d
|
data/bin/hsql
CHANGED
@@ -28,7 +28,12 @@ else
|
|
28
28
|
# Runs the whole SQL string through the parser to find the individual queries
|
29
29
|
# and then deparses it
|
30
30
|
file.queries.each do |query|
|
31
|
-
|
32
|
-
|
31
|
+
warn '-- Parsed and deparsed SQL:' if command_line.options[:verbose]
|
32
|
+
begin
|
33
|
+
puts query
|
34
|
+
rescue => e
|
35
|
+
warn "-- #{e.inspect}" if command_line.options[:verbose]
|
36
|
+
puts file.rendered_sql
|
37
|
+
end
|
33
38
|
end
|
34
39
|
end
|
data/lib/hsql/file.rb
CHANGED
@@ -8,7 +8,7 @@ module HSQL
|
|
8
8
|
# YAML data from the front matter section and a list of the queries in the SQL
|
9
9
|
# portion.
|
10
10
|
class File
|
11
|
-
attr_reader :string, :timestamp, :environment
|
11
|
+
attr_reader :string, :timestamp, :environment, :rendered_sql
|
12
12
|
|
13
13
|
def initialize(string, options)
|
14
14
|
@string = string
|
data/lib/hsql/template.rb
CHANGED
@@ -19,8 +19,8 @@ module HSQL
|
|
19
19
|
Mustache.raise_on_context_miss = true
|
20
20
|
output = Mustache.render(input, hash)
|
21
21
|
if @verbose
|
22
|
-
|
23
|
-
|
22
|
+
warn '-- Rendered SQL:'
|
23
|
+
warn output
|
24
24
|
end
|
25
25
|
output
|
26
26
|
rescue Mustache::ContextMiss => e
|
data/lib/hsql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hsql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Danger Canty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mustache
|