twurl 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/twurl/cli.rb +9 -1
- data/lib/twurl/version.rb +1 -1
- data/test/cli_test.rb +8 -0
- data/twurl.gemspec +2 -2
- metadata +5 -6
data/README
CHANGED
data/lib/twurl/cli.rb
CHANGED
@@ -82,6 +82,14 @@ module Twurl
|
|
82
82
|
Twurl.options
|
83
83
|
end
|
84
84
|
|
85
|
+
def output
|
86
|
+
if Twurl.options && Twurl.options.output
|
87
|
+
Twurl.options.output
|
88
|
+
else
|
89
|
+
@output
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
85
93
|
def print(*args, &block)
|
86
94
|
output.print(*args, &block)
|
87
95
|
end
|
@@ -187,7 +195,7 @@ module Twurl
|
|
187
195
|
def data
|
188
196
|
on('-d', '--data [data]', 'Sends the specified data in a POST request to the HTTP server.') do |data|
|
189
197
|
data.split('&').each do |pair|
|
190
|
-
key, value = pair.split('=')
|
198
|
+
key, value = pair.split('=', 2)
|
191
199
|
options.data[key] = value
|
192
200
|
end
|
193
201
|
end
|
data/lib/twurl/version.rb
CHANGED
data/test/cli_test.rb
CHANGED
@@ -91,6 +91,14 @@ class Twurl::CLI::OptionParsingTest < MiniTest::Unit::TestCase
|
|
91
91
|
options = Twurl::CLI.parse_options(['-d', 'key=value&another=pair'])
|
92
92
|
assert_equal({'key' => 'value', 'another' => 'pair'}, options.data)
|
93
93
|
end
|
94
|
+
|
95
|
+
def test_extracting_an_empty_key_value_pair
|
96
|
+
options = Twurl::CLI.parse_options(['-d', 'key='])
|
97
|
+
assert_equal({'key' => ''}, options.data)
|
98
|
+
|
99
|
+
options = Twurl::CLI.parse_options(['--data', 'key='])
|
100
|
+
assert_equal({'key' => ''}, options.data)
|
101
|
+
end
|
94
102
|
end
|
95
103
|
include DataParsingTests
|
96
104
|
|
data/twurl.gemspec
CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.add_development_dependency 'rr', '~> 1.0'
|
8
8
|
s.add_development_dependency 'simplecov', '~> 0.4'
|
9
9
|
s.add_development_dependency 'minitest', '~> 2.5'
|
10
|
-
s.authors = ["Marcel Molina", "
|
10
|
+
s.authors = ["Marcel Molina", "Erik Michaels-Ober"]
|
11
11
|
s.description = %q{Curl for the Twitter API}
|
12
|
-
s.email = ['marcel@twitter.com'
|
12
|
+
s.email = ['marcel@twitter.com']
|
13
13
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
14
|
s.extra_rdoc_files = %w(CHANGELOG COPYING INSTALL README)
|
15
15
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twurl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 5
|
10
|
+
version: 0.6.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marcel Molina
|
14
|
-
-
|
14
|
+
- Erik Michaels-Ober
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-10-23 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -97,7 +97,6 @@ dependencies:
|
|
97
97
|
description: Curl for the Twitter API
|
98
98
|
email:
|
99
99
|
- marcel@twitter.com
|
100
|
-
- raffi@twitter.com
|
101
100
|
executables:
|
102
101
|
- twurl
|
103
102
|
extensions: []
|