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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce29f4c933417b28a33a4741dd68a5272fa826a5
4
- data.tar.gz: 16b6f10369799d91d44b1826718c971f13963201
3
+ metadata.gz: 12cbc29780960ce0454e0bdd075f296a75eff08a
4
+ data.tar.gz: 866fa2ea979dd4d9bb1df5381181d35f323cf178
5
5
  SHA512:
6
- metadata.gz: 5bfc48d11fe07b44a55111afdd05beed8adb2d3ce8d7ef99afee150ef0ced242123bf669f0fc1a30e39bb2c18d3ce968fadd2e7b7ce28c5da5a0fa625175bfbb
7
- data.tar.gz: aec9536a228153c16622d22c1fbe675b2551f00208ccd4337b972950f7938c8550ee6baeee5fbf4234c3f9c9561e10b95bb342277a8a7ce09f98574d0a5546f9
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
- puts '-- Parsed and deparsed SQL:' if command_line.options[:verbose]
32
- puts query
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
- STDERR.puts '-- Rendered SQL:'
23
- STDERR.puts output
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
@@ -1,4 +1,4 @@
1
1
  # http://semver.org/
2
2
  module HSQL
3
- VERSION = '0.3.6'
3
+ VERSION = '0.3.7'
4
4
  end
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.6
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-08-21 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mustache