sdbtools 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/selection.rb +14 -6
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
@@ -21,6 +21,18 @@ module SDBTools
21
21
  # For testing
22
22
  attr_writer :starting_token
23
23
 
24
+ def self.quote_name(name)
25
+ if name.to_s =~ /^[A-Z$_][A-Z0-9$_]*$/i
26
+ name.to_s
27
+ else
28
+ "`" + name.to_s.gsub("`", "``") + "`"
29
+ end
30
+ end
31
+
32
+ def self.quote_value(value)
33
+ '"' + value.to_s.gsub(/"/, '""') + '"'
34
+ end
35
+
24
36
  def initialize(sdb, domain, options={})
25
37
  @sdb = sdb
26
38
  @domain = domain.to_s
@@ -118,15 +130,11 @@ module SDBTools
118
130
  private
119
131
 
120
132
  def quote_name(name)
121
- if name.to_s =~ /^[A-Z$_][A-Z0-9$_]*$/i
122
- name.to_s
123
- else
124
- "`" + name.to_s.gsub("`", "``") + "`"
125
- end
133
+ self.class.quote_name(name)
126
134
  end
127
135
 
128
136
  def quote_value(value)
129
- '"' + value.to_s.gsub(/"/, '""') + '"'
137
+ self.class.quote_value(value)
130
138
  end
131
139
 
132
140
  def output_list
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdbtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avdi Grimm
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-21 00:00:00 -05:00
12
+ date: 2010-01-23 00:00:00 -05:00
13
13
  default_executable: sdbtool
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency