sql-maker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/CHANGELOG.md +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +23 -0
  7. data/Rakefile +14 -0
  8. data/lib/sql-maker.rb +5 -0
  9. data/lib/sql/maker.rb +676 -0
  10. data/lib/sql/maker/condition.rb +378 -0
  11. data/lib/sql/maker/error.rb +3 -0
  12. data/lib/sql/maker/helper.rb +22 -0
  13. data/lib/sql/maker/quoting.rb +138 -0
  14. data/lib/sql/maker/select.rb +544 -0
  15. data/lib/sql/maker/select/oracle.rb +30 -0
  16. data/lib/sql/maker/select_set.rb +194 -0
  17. data/lib/sql/maker/util.rb +54 -0
  18. data/lib/sql/query_maker.rb +429 -0
  19. data/scripts/perl2ruby.rb +34 -0
  20. data/spec/maker/bind_param_spec.rb +62 -0
  21. data/spec/maker/condition/add_raw_spec.rb +29 -0
  22. data/spec/maker/condition/compose_empty_spec.rb +72 -0
  23. data/spec/maker/condition/empty_values_spec.rb +25 -0
  24. data/spec/maker/condition/make_term_spec.rb +38 -0
  25. data/spec/maker/condition/where_spec.rb +35 -0
  26. data/spec/maker/delete_spec.rb +116 -0
  27. data/spec/maker/insert_empty_spec.rb +23 -0
  28. data/spec/maker/insert_spec.rb +61 -0
  29. data/spec/maker/new_line_spec.rb +9 -0
  30. data/spec/maker/select/oracle/oracle_spec.rb +16 -0
  31. data/spec/maker/select/pod_select_spec.rb +34 -0
  32. data/spec/maker/select/statement_spec.rb +805 -0
  33. data/spec/maker/select_set_spec.rb +294 -0
  34. data/spec/maker/select_spec.rb +470 -0
  35. data/spec/maker/simple_spec.rb +54 -0
  36. data/spec/maker/strict_spec.rb +45 -0
  37. data/spec/maker/subquery_spec.rb +77 -0
  38. data/spec/maker/update_spec.rb +138 -0
  39. data/spec/maker/util_spec.rb +6 -0
  40. data/spec/maker/where_spec.rb +28 -0
  41. data/spec/query_maker/and_using_hash_spec.rb +13 -0
  42. data/spec/query_maker/cheatsheet_spec.rb +32 -0
  43. data/spec/query_maker/column_bind_spec.rb +55 -0
  44. data/spec/query_maker/refs_in_bind_spec.rb +19 -0
  45. data/spec/spec_helper.rb +15 -0
  46. data/sql-maker.gemspec +25 -0
  47. metadata +185 -0
@@ -0,0 +1,19 @@
1
+ require_relative '../spec_helper'
2
+ require 'sql/query_maker'
3
+ require 'sql/maker/helper'
4
+
5
+ describe 'SQL::QueryMaker' do
6
+ include SQL::Maker::Helper
7
+
8
+ it "sql_eq" do
9
+ expect { sql_eq('foo' => [1,2,3]) }.to raise_error
10
+ end
11
+
12
+ it "sql_in" do
13
+ expect { sql_eq('foo' => [[1,2,3], 4]) }.to raise_error
14
+ end
15
+
16
+ it "sql_and" do
17
+ expect { sql_eq('foo' => [[1,2], 3]) }.to raise_error
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+ require 'bundler'
4
+ Bundler.setup(:default, :test)
5
+ Bundler.require(:default, :test)
6
+ require 'pry'
7
+ ROOT = File.dirname(File.dirname(__FILE__))
8
+
9
+ if ENV['TRAVIS']
10
+ require 'coveralls'
11
+ Coveralls.wear!
12
+ end
13
+
14
+ $TESTING=true
15
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
data/sql-maker.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "sql-maker"
7
+ spec.version = "0.0.1"
8
+ spec.authors = ["Naotoshi Seo"]
9
+ spec.email = ["sonots@gmail.com"]
10
+ spec.summary = %q{SQL Builder for Ruby}
11
+ spec.description = %q{SQL Builder for Ruby. Ruby port of perl's SQL::Maker.}
12
+ spec.homepage = ""
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.6"
21
+ spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "rspec"
23
+ spec.add_development_dependency "pry"
24
+ spec.add_development_dependency "pry-nav"
25
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sql-maker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Naotoshi Seo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry-nav
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: SQL Builder for Ruby. Ruby port of perl's SQL::Maker.
84
+ email:
85
+ - sonots@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - CHANGELOG.md
92
+ - Gemfile
93
+ - LICENSE.txt
94
+ - README.md
95
+ - Rakefile
96
+ - lib/sql-maker.rb
97
+ - lib/sql/maker.rb
98
+ - lib/sql/maker/condition.rb
99
+ - lib/sql/maker/error.rb
100
+ - lib/sql/maker/helper.rb
101
+ - lib/sql/maker/quoting.rb
102
+ - lib/sql/maker/select.rb
103
+ - lib/sql/maker/select/oracle.rb
104
+ - lib/sql/maker/select_set.rb
105
+ - lib/sql/maker/util.rb
106
+ - lib/sql/query_maker.rb
107
+ - scripts/perl2ruby.rb
108
+ - spec/maker/bind_param_spec.rb
109
+ - spec/maker/condition/add_raw_spec.rb
110
+ - spec/maker/condition/compose_empty_spec.rb
111
+ - spec/maker/condition/empty_values_spec.rb
112
+ - spec/maker/condition/make_term_spec.rb
113
+ - spec/maker/condition/where_spec.rb
114
+ - spec/maker/delete_spec.rb
115
+ - spec/maker/insert_empty_spec.rb
116
+ - spec/maker/insert_spec.rb
117
+ - spec/maker/new_line_spec.rb
118
+ - spec/maker/select/oracle/oracle_spec.rb
119
+ - spec/maker/select/pod_select_spec.rb
120
+ - spec/maker/select/statement_spec.rb
121
+ - spec/maker/select_set_spec.rb
122
+ - spec/maker/select_spec.rb
123
+ - spec/maker/simple_spec.rb
124
+ - spec/maker/strict_spec.rb
125
+ - spec/maker/subquery_spec.rb
126
+ - spec/maker/update_spec.rb
127
+ - spec/maker/util_spec.rb
128
+ - spec/maker/where_spec.rb
129
+ - spec/query_maker/and_using_hash_spec.rb
130
+ - spec/query_maker/cheatsheet_spec.rb
131
+ - spec/query_maker/column_bind_spec.rb
132
+ - spec/query_maker/refs_in_bind_spec.rb
133
+ - spec/spec_helper.rb
134
+ - sql-maker.gemspec
135
+ homepage: ''
136
+ licenses:
137
+ - MIT
138
+ metadata: {}
139
+ post_install_message:
140
+ rdoc_options: []
141
+ require_paths:
142
+ - lib
143
+ required_ruby_version: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ requirements: []
154
+ rubyforge_project:
155
+ rubygems_version: 2.2.2
156
+ signing_key:
157
+ specification_version: 4
158
+ summary: SQL Builder for Ruby
159
+ test_files:
160
+ - spec/maker/bind_param_spec.rb
161
+ - spec/maker/condition/add_raw_spec.rb
162
+ - spec/maker/condition/compose_empty_spec.rb
163
+ - spec/maker/condition/empty_values_spec.rb
164
+ - spec/maker/condition/make_term_spec.rb
165
+ - spec/maker/condition/where_spec.rb
166
+ - spec/maker/delete_spec.rb
167
+ - spec/maker/insert_empty_spec.rb
168
+ - spec/maker/insert_spec.rb
169
+ - spec/maker/new_line_spec.rb
170
+ - spec/maker/select/oracle/oracle_spec.rb
171
+ - spec/maker/select/pod_select_spec.rb
172
+ - spec/maker/select/statement_spec.rb
173
+ - spec/maker/select_set_spec.rb
174
+ - spec/maker/select_spec.rb
175
+ - spec/maker/simple_spec.rb
176
+ - spec/maker/strict_spec.rb
177
+ - spec/maker/subquery_spec.rb
178
+ - spec/maker/update_spec.rb
179
+ - spec/maker/util_spec.rb
180
+ - spec/maker/where_spec.rb
181
+ - spec/query_maker/and_using_hash_spec.rb
182
+ - spec/query_maker/cheatsheet_spec.rb
183
+ - spec/query_maker/column_bind_spec.rb
184
+ - spec/query_maker/refs_in_bind_spec.rb
185
+ - spec/spec_helper.rb