ugc 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/README.md +6 -0
- data/lib/ugc/commands/login.rb +2 -1
- data/lib/ugc/helpers/parse.rb +5 -1
- data/lib/ugc/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -171,6 +171,12 @@ If you specify column names in your query, you will be unable to reference the r
|
|
171
171
|
|
172
172
|
## Release notes
|
173
173
|
|
174
|
+
### 0.9.1
|
175
|
+
* New features
|
176
|
+
1. allow non-interactive password on login (-p or --password)
|
177
|
+
* Bug fixes
|
178
|
+
1. fix display issue with assign query (select {user:username} from...)
|
179
|
+
|
174
180
|
### 0.9.0
|
175
181
|
* New features
|
176
182
|
1. path reference '@n' in commands to previous list entities
|
data/lib/ugc/commands/login.rb
CHANGED
@@ -6,11 +6,12 @@ arg_name 'username'
|
|
6
6
|
command :login do |c|
|
7
7
|
|
8
8
|
c.switch [:a,:admin]
|
9
|
+
c.flag [:p,:password]
|
9
10
|
c.action do |global_options,options,args|
|
10
11
|
|
11
12
|
help_now! unless args[0]
|
12
13
|
|
13
|
-
password = ask('password: ') { |q| q.echo = '*' }
|
14
|
+
password = options[:password] || ask('password: ') { |q| q.echo = '*' }
|
14
15
|
|
15
16
|
if password
|
16
17
|
if options[:admin]
|
data/lib/ugc/helpers/parse.rb
CHANGED
@@ -5,10 +5,14 @@ def parse_sql(query)
|
|
5
5
|
keywords = %w(select from where limit)
|
6
6
|
current = nil
|
7
7
|
query.downcase.split(/[\s,*]/).each do |ea|
|
8
|
-
next if ea == ''
|
8
|
+
next if ea == '' || (current == 'select' && ea == 'distinct')
|
9
9
|
if keywords.include? ea
|
10
10
|
current = ea
|
11
11
|
elsif current
|
12
|
+
if current == 'select' and ea.start_with? "{"
|
13
|
+
current = nil
|
14
|
+
next
|
15
|
+
end
|
12
16
|
if result[current]
|
13
17
|
if result[current].is_a? Array
|
14
18
|
result[current] << ea
|
data/lib/ugc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ugc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
segments:
|
185
185
|
- 0
|
186
|
-
hash:
|
186
|
+
hash: 1880156411111521140
|
187
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
188
|
none: false
|
189
189
|
requirements:
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
segments:
|
194
194
|
- 0
|
195
|
-
hash:
|
195
|
+
hash: 1880156411111521140
|
196
196
|
requirements: []
|
197
197
|
rubyforge_project:
|
198
198
|
rubygems_version: 1.8.24
|