piggly 2.2.3 → 2.2.4

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: a2b78c278ad31f77e5dbf4677a77e42f6a24a267
4
- data.tar.gz: c9a87f1bca511331450caf12f26d48bd165d8744
3
+ metadata.gz: 4f39e49434ecf4d819d325d757fa35296b0ef57d
4
+ data.tar.gz: 893b9a44543b794fb421ced51ccc82b0e3bf0b55
5
5
  SHA512:
6
- metadata.gz: 796cd9e88a976fd7fd5365f6a123168e254b4acf41a70c7de338cdf5f96c46c5d21fa0a51c3fb54a67d08089712a45eafedc1b776fea2dd289a4efb61b45dad4
7
- data.tar.gz: 99fe5b35d5e9dc01c923b0f30cdc79a0ac4628b6be6883bb68cf5fb1e06b0b73d3fe4381c938f0f83d402352df4a36e6c07b851866c0e578e45037c1f2c93323
6
+ metadata.gz: 70dec8fb3d903f549acb6589e53990cf8cee42433de404dfe05cfcd06157d7f678b68e4d910e4ffc9cd8bc7a08336fc16ad251365aeacab40d08e6dcd2315991
7
+ data.tar.gz: e2936119f128db3bce6564a2edd02f5a8be06bab473d2b97c50481c9b5597effe2a8105c490f0f7015a5c7c40e8c5320f6e708ed5b352f07c07541f7aa7d374d
@@ -238,17 +238,16 @@ grammar Piggly
238
238
  end
239
239
 
240
240
  rule stmtRaise
241
- bodyStub:stubNode
242
- body:(kwRAISE tSpace level:kwEXCEPTION tSpace expr:expressionUntilSemiColon) ';' <Piggly::Parser::Nodes::Throw>
243
- /
244
241
  kwRAISE tSpace
245
242
  level:( kwWARNING
246
243
  / kwNOTICE
247
244
  / kwINFO
248
245
  / kwLOG
249
246
  / kwDEBUG )
250
- tSpace
251
- expr:expressionUntilSemiColon ';' <Piggly::Parser::Nodes::Raise>
247
+ ( tSpace expr:expressionUntilSemiColon )? ';' <Piggly::Parser::Nodes::Raise>
248
+ /
249
+ bodyStub:stubNode
250
+ body:(kwRAISE ( tSpace level:kwEXCEPTION tSpace? )? expr:expressionUntilSemiColon) ';' <Piggly::Parser::Nodes::Throw>
252
251
  end
253
252
 
254
253
  rule stmtExecSql
@@ -2,9 +2,9 @@ module Piggly
2
2
  module VERSION
3
3
  MAJOR = 2
4
4
  MINOR = 2
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
- RELEASE_DATE = "2017-10-23"
7
+ RELEASE_DATE = "2017-11-01"
8
8
  end
9
9
 
10
10
  class << VERSION
@@ -25,6 +25,32 @@ module Piggly
25
25
  node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 1
26
26
  end
27
27
  end
28
+
29
+ it "doesn't require a message" do
30
+ node = parse(:statement, "RAISE EXCEPTION;")
31
+ node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 1
32
+ node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 0
33
+ end
34
+
35
+ it "doesn't require a message" do
36
+ %w(WARNING LOG INFO NOTICE DEBUG).each do |event|
37
+ node = parse(:statement, "RAISE #{event};")
38
+ node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 0
39
+ node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 1
40
+ end
41
+ end
42
+
43
+ it "has default level of EXCEPTION" do
44
+ node = parse(:statement, "RAISE 'message';")
45
+ node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 1
46
+ node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 0
47
+ end
48
+
49
+ it "doesn't require a level or message" do
50
+ node = parse(:statement, "RAISE;")
51
+ node.count{|e| e.is_a?(Parser::Nodes::Throw) }.should == 1
52
+ node.count{|e| e.is_a?(Parser::Nodes::Raise) }.should == 0
53
+ end
28
54
  end
29
55
 
30
56
  describe "catch" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piggly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvle Putnam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2017-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop