each_sql 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +3 -0
- data/VERSION +1 -1
- data/each_sql.gemspec +58 -0
- data/lib/each_sql.rb +1 -1
- data/test/test_each_sql.rb +7 -3
- metadata +11 -10
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/each_sql.gemspec
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{each_sql}
|
8
|
+
s.version = "0.2.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Junegunn Choi"]
|
12
|
+
s.date = %q{2011-07-08}
|
13
|
+
s.description = %q{Enumerate each SQL statement in SQL scripts.}
|
14
|
+
s.email = %q{junegunn.c@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"CHANGELOG.rdoc",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"lib/each_sql.rb",
|
29
|
+
"lib/each_sql/each_sql.rb",
|
30
|
+
"test/helper.rb",
|
31
|
+
"test/postgres.sql",
|
32
|
+
"test/test_each_sql.rb"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/junegunn/each_sql}
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.7.2}
|
38
|
+
s.summary = %q{Enumerate each SQL statement in SQL scripts.}
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 3
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
45
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
|
46
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
49
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
50
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
51
|
+
end
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
54
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
55
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
data/lib/each_sql.rb
CHANGED
@@ -37,7 +37,7 @@ class EachSQL
|
|
37
37
|
:ignore => [],
|
38
38
|
:replace => {},
|
39
39
|
# Let's assume we don't change delimiters within usual sql scripts
|
40
|
-
:strip_delimiter => lambda { |obj, stmt| stmt.
|
40
|
+
:strip_delimiter => lambda { |obj, stmt| stmt.sub(/\A;+/, '').sub(/;+\Z/, '') }
|
41
41
|
},
|
42
42
|
|
43
43
|
:mysql => {
|
data/test/test_each_sql.rb
CHANGED
@@ -128,6 +128,10 @@ end;",
|
|
128
128
|
|
129
129
|
@oracle_script = "
|
130
130
|
select * from dual;
|
131
|
+
;;;;;;;
|
132
|
+
;;;
|
133
|
+
;;
|
134
|
+
|
131
135
|
create /* procedure */ sequence a;
|
132
136
|
create package something as
|
133
137
|
procedure log;
|
@@ -235,8 +239,8 @@ begin
|
|
235
239
|
end $$
|
236
240
|
delimiter ;
|
237
241
|
|
238
|
-
select * from dual
|
239
|
-
select b `begin` from dual;
|
242
|
+
select * from dual;;;;;
|
243
|
+
;;;select b `begin` from dual;
|
240
244
|
select b \"begin\" from dual;
|
241
245
|
select
|
242
246
|
begin , begin.* from begin"
|
@@ -250,7 +254,7 @@ select
|
|
250
254
|
assert true, 'No error expected'
|
251
255
|
end
|
252
256
|
|
253
|
-
script = @sql.map { |e| e.strip + '
|
257
|
+
script = @sql.map { |e| e.strip + ';;;;' }.join $/
|
254
258
|
EachSQL(script).each_with_index do |sql,idx|
|
255
259
|
puts sql
|
256
260
|
puts '-' * 40
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: each_sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-08-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &2154603460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2154603460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jeweler
|
27
|
-
requirement: &
|
27
|
+
requirement: &2154602960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.2
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2154602960
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rcov
|
38
|
-
requirement: &
|
38
|
+
requirement: &2154602480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2154602480
|
47
47
|
description: Enumerate each SQL statement in SQL scripts.
|
48
48
|
email: junegunn.c@gmail.com
|
49
49
|
executables: []
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- README.rdoc
|
61
61
|
- Rakefile
|
62
62
|
- VERSION
|
63
|
+
- each_sql.gemspec
|
63
64
|
- lib/each_sql.rb
|
64
65
|
- lib/each_sql/each_sql.rb
|
65
66
|
- test/helper.rb
|
@@ -80,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
81
|
version: '0'
|
81
82
|
segments:
|
82
83
|
- 0
|
83
|
-
hash: -
|
84
|
+
hash: -2701967104175695105
|
84
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
86
|
none: false
|
86
87
|
requirements:
|
@@ -89,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
90
|
version: '0'
|
90
91
|
requirements: []
|
91
92
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.
|
93
|
+
rubygems_version: 1.8.5
|
93
94
|
signing_key:
|
94
95
|
specification_version: 3
|
95
96
|
summary: Enumerate each SQL statement in SQL scripts.
|