tsql_parser 0.1.2 → 0.1.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
  SHA256:
3
- metadata.gz: 62f81b6f4b6195e663c823dbb1fda82a8a7530d534ed73a9ba27a048fdacb42d
4
- data.tar.gz: c1af50b7c5421316290044ca548bd9983b568c8f6446402ba1d6b25ef46920ea
3
+ metadata.gz: '0473885bdca58523ffe440e748c72c6918e0c549e33a65d9287d3c48bf63e6b9'
4
+ data.tar.gz: fe2f61520f1ee60df0ed980af63f187273a8d275d245d5aeeb688ce52e3c8760
5
5
  SHA512:
6
- metadata.gz: 24c95e57e20af4b3dff6d7b15cb38e0736bddc683f025c9bc5300e6662992045e110990343497c13952524de2868fdc5341214ab744d6305416a2f001388d555
7
- data.tar.gz: 06d257666a82067a42990e8c0f9a4ac8dd1644ec399f7f8aa453cfe7d2465dc680a349c7623bcf92e6f1f0d412a6a4ea2440f818bdf1b239510896b601e891cd
6
+ metadata.gz: c0286ddb36e63aa05587d22ebc8bd26578de851779934fe590c77f43d7ff646379922d6eae4b5f265dbbf6a609b3e12de3bb829f865ef8850fc2314076c19d11
7
+ data.tar.gz: 48797d07c9d3dc5615ea692692717c0ac5312af185a930bf12e089eab2a4f2e80ca347790514e62dfbcf6238617ffc61b0ef248769ad3de4bb411c8dbe22399f
@@ -55,7 +55,7 @@ module TSqlParser::Parsing::Formatters
55
55
  formatted << line
56
56
  formatted << ""
57
57
  end
58
- elsif first != "SET" and line.include? " SET "
58
+ elsif first != "SET" and line.include? " SET " and not line.strip.start_with? "--"
59
59
  parts = line.strip.split(" SET ")
60
60
  tab_count = self.get_tab_count(line, tab)
61
61
  formatted << "#{tab * tab_count}#{parts[0]}\n"
@@ -107,8 +107,8 @@ module TSqlParser::Parsing::Formatters
107
107
  builder = ""
108
108
  end
109
109
  elsif c == "\n"
110
- parts << builder unless builder.empty?
111
- builder = ""
110
+ #parts << builder unless builder.empty?
111
+ #builder = ""
112
112
  elsif c == "-"
113
113
  if next_c == "-"
114
114
  comment = true
@@ -124,7 +124,7 @@ module TSqlParser::Parsing::Formatters
124
124
  end
125
125
  parts << builder unless builder.empty?
126
126
  parts = parts.map { |p| p.strip }.select { |p| not p.empty? }
127
- "\n#{parts.map { |p| "#{tab * (tab_count + 1)}#{p.strip}" }.join(",\n")}"
127
+ "\n#{parts.map { |p| "#{tab * (tab_count + 1)}#{p.strip.gsub(tab, " ")}" }.join(",\n")}"
128
128
  end
129
129
  end
130
130
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsql_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Stauffer