scheman 0.0.5 → 0.0.6

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: 2fc602f3aa02ac3f06f48d632a05ffa7f7784fd7
4
- data.tar.gz: f44bbc67da9d9bae8e12ff783d186f305e355181
3
+ metadata.gz: 0f5b2dcdccc0eb4557f8afddd786c3510a4c05d2
4
+ data.tar.gz: 780b979f8c674c9234c59ee6df494875a206049a
5
5
  SHA512:
6
- metadata.gz: acd3b64fdcd250a3af7883586527239f115ac5104e5f236baed6cd366dffc7984336ffaa1afb7f94dadfd7881b2c534418c5b06c72c1674945d86389ed9a1aa7
7
- data.tar.gz: bfe6787b4b0b10ec11ff296c72cf1157a191856611a35b7e2d9dc48830958cb70769a173faf877ead5b222b1b7f7f869084b52754a9573aeae2c8383454dd8cb
6
+ metadata.gz: 9b00cc8f5fc5e3c3dd432c6ab5bd5550843a78bce588266a54af2097e2fb70cb0f295cd8c794fae09c2586a4ae1e683a77baeb59ea976145093a97fead9cf03e
7
+ data.tar.gz: b4903ed2d840c631f1ad2eefbf89acae9ba4d3bcf961078ed45e81c0443134d27807e30ca09a3c2b6887e94e1ef0557368a1b82196f14a47d1ef716a1b1e2017
@@ -1,17 +1,20 @@
1
+ ## 0.0.6
2
+ - Treat commented out line as space node (Thx @yuki-takeichi)
3
+
1
4
  ## 0.0.5
2
- * Improve parser rule for CREATE TABLE (Thx @yuki-takeichi)
5
+ - Improve parser rule for CREATE TABLE (Thx @yuki-takeichi)
3
6
 
4
7
  ## 0.0.4
5
- * Add `schema diff` command
6
- * Improve MySQL parser logic
8
+ - Add `schema diff` command
9
+ - Improve MySQL parser logic
7
10
 
8
11
  ## 0.0.3
9
- * Support DEFAULT column qualifier
12
+ - Support DEFAULT column qualifier
10
13
 
11
14
  ## 0.0.2
12
- * Support ADD INDEX
13
- * Support DROP INDEX
14
- * Detect altered column
15
+ - Support ADD INDEX
16
+ - Support DROP INDEX
17
+ - Detect altered column
15
18
 
16
19
  ## 0.0.1
17
- * 1st Release
20
+ - 1st Release
@@ -89,7 +89,7 @@ module Scheman
89
89
  end
90
90
 
91
91
  rule(:space) do
92
- match('\s')
92
+ match('\s') | comment
93
93
  end
94
94
 
95
95
  rule(:space?) do
@@ -222,7 +222,7 @@ module Scheman
222
222
  end
223
223
 
224
224
  rule(:create_definition) do
225
- index | field | comment
225
+ index | field
226
226
  end
227
227
 
228
228
  rule(:index) do
@@ -297,12 +297,11 @@ module Scheman
297
297
 
298
298
  rule(:field) do
299
299
  (
300
- comment.repeat >> field_name.as(:field_name) >> spaces >> field_type >>
300
+ field_name.as(:field_name) >> spaces >> field_type >>
301
301
  (spaces >> field_qualifiers).maybe.as(:field_qualifiers) >>
302
302
  (spaces >> field_comment).maybe >>
303
303
  (spaces >> reference_definition).maybe >>
304
- (spaces >> on_update).maybe >>
305
- comment.maybe
304
+ (spaces >> on_update).maybe
306
305
  ).as(:field)
307
306
  end
308
307
 
@@ -1,3 +1,3 @@
1
1
  module Scheman
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -564,5 +564,23 @@ describe Scheman::Parsers::Mysql do
564
564
  expect { subject }.not_to raise_error
565
565
  end
566
566
  end
567
+
568
+ context "with various comment outs" do
569
+ let(:str) do
570
+ <<-EOS.strip_heredoc
571
+ # comment
572
+ CREATE TABLE `table1` (
573
+ `column1` INTEGER(11) NOT NULL AUTO_INCREMENT,
574
+ -- `column1` VARCHAR(11) NOT NULL AUTO_INCREMENT,
575
+ `column2` VARCHAR(255)/* comment here! */NOT NULL,
576
+ PRIMARY KEY (`column1`)
577
+ ); -- comment out
578
+ EOS
579
+ end
580
+
581
+ it "succeeds in parse" do
582
+ expect { subject }.not_to raise_error
583
+ end
584
+ end
567
585
  end
568
586
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scheman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-23 00:00:00.000000000 Z
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport