twurl 0.6.4 → 0.6.5

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/README CHANGED
@@ -116,4 +116,4 @@ Notice that one of those consumer keys is marked as the default. To change the d
116
116
  +--------------+
117
117
 
118
118
  Marcel Molina <marcel@twitter.com> / @noradio
119
- Raffi Krikorian <raffi@twitter.com> / @raffi
119
+ Erick Michaels-Ober / @sferik
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
@@ -2,7 +2,7 @@ module Twurl
2
2
  module VERSION
3
3
  MAJOR = '0' unless defined? MAJOR
4
4
  MINOR = '6' unless defined? MINOR
5
- TINY = '4' unless defined? TINY
5
+ TINY = '5' unless defined? TINY
6
6
  BETA = nil unless defined? BETA # Time.now.to_i.to_s
7
7
  end
8
8
 
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", "Raffi Krikorian"]
10
+ s.authors = ["Marcel Molina", "Erik Michaels-Ober"]
11
11
  s.description = %q{Curl for the Twitter API}
12
- s.email = ['marcel@twitter.com', 'raffi@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: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 4
10
- version: 0.6.4
9
+ - 5
10
+ version: 0.6.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcel Molina
14
- - Raffi Krikorian
14
+ - Erik Michaels-Ober
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-31 00:00:00 -07:00
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: []