sql-maker 0.0.4 → 0.0.5

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: df6b66323d8c864915eacfa06aecea6273e58c46
4
- data.tar.gz: 307efe4066f6b8ab303fe749ea80ae8022737325
3
+ metadata.gz: 332dd67e2a9366458f6b6dc6b59935af9086bc8b
4
+ data.tar.gz: c79fc9b7ede53d3d17c88952950ec1e18f5fabd9
5
5
  SHA512:
6
- metadata.gz: 26c0a612e3bb5a35709ba269a2e775a10923cc0f628ff333d9226a2183947cc7bf034bd24b974271078150eb84fa18a6b29b9f48a4b194048d7628db1c0eac39
7
- data.tar.gz: aadebe81d0678883500fc8dae3f2a66b7e799e7cebf23ef2a58f70e5f2be1de80dfb2cef5c850230f540c5d2a2fa3bd9bca4afc24762fa5d5e33667dbd3787dd
6
+ metadata.gz: fe0432e6651c494a66fd12440a5245ce7cf1c49ed67c0c709b9091bae70c9f0425a512b7e8e35c5f5e1d134d5dd29543469ee54b042bca6093ef09c1ee418f18
7
+ data.tar.gz: cced5c06cf5ba70fa31b43d0a14196565988a07a7d8626ce261fdcd6682deae35b26ea39ddf6a3cafdea8498f89b8f6ea604a09ceed25371b45681bd56773216
@@ -1,3 +1,9 @@
1
+ ## 0.0.5 (2015/02/11)
2
+
3
+ Enhancements:
4
+
5
+ * Add SQL::Maker::Quoting.escape as alias to SQL::Maker::Quoting.quote_string
6
+
1
7
  ## 0.0.4 (2014/09/14)
2
8
 
3
9
  Fixes:
data/README.md CHANGED
@@ -80,6 +80,18 @@ See following articles for more details (perl version)
80
80
  * http://blog.kazuhooku.com/2014/07/the-json-sql-injection-vulnerability.html (English)
81
81
  * http://developers.mobage.jp/blog/2014/7/3/jsonsql-injection (Japanese)
82
82
 
83
+ ## SQL Escape
84
+
85
+ SQL Maker automatically does escape, but when you want to do it manually by some reasons, call
86
+
87
+ ```
88
+ SQL::Maker::Quoting.quote(string)
89
+ ```
90
+
91
+ ## See Also
92
+
93
+ * [perl の SQL::Maker (と SQL::QueryMaker) を ruby に移植した - sonots:blog](http://blog.livedoor.jp/sonots/archives/38723820.html) (Japanese)
94
+
83
95
  ## ChangeLog
84
96
 
85
97
  See [CHANGELOG.md](CHANGELOG.md) for details.
@@ -73,11 +73,16 @@ module SQL::Maker::Quoting
73
73
  end
74
74
 
75
75
  # Quotes a string, escaping any ' (single quote) and \ (backslash)
76
- # characters.
76
+ # characters as SQL escape
77
77
  def self.quote_string(s)
78
78
  s.gsub(/\\/, '\&\&').gsub(/'/, "''") # ' (for ruby-mode)
79
79
  end
80
80
 
81
+ # alias to module function quote_string
82
+ def self.escape(s)
83
+ quote_string(s)
84
+ end
85
+
81
86
  # # def quote_string(s)
82
87
  # def self.define_quote_string
83
88
  # klass = self.singleton_class
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "sql-maker"
7
- spec.version = "0.0.4"
7
+ spec.version = "0.0.5"
8
8
  spec.authors = ["Naotoshi Seo"]
9
9
  spec.email = ["sonots@gmail.com"]
10
10
  spec.summary = %q{SQL Builder for Ruby}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql-maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-14 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler