twurl 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
+ bundler_args: --without development
1
2
  language: ruby
2
3
  rvm:
3
4
  - rbx-18mode
@@ -7,4 +8,4 @@ rvm:
7
8
  - 1.8.7
8
9
  - 1.9.2
9
10
  - 1.9.3
10
- - ruby-head
11
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,7 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- platforms :jruby do
4
- gem 'jruby-openssl', '~> 0.7'
3
+ gem 'jruby-openssl', :platforms => :jruby
4
+ gem 'rake'
5
+
6
+ group :test do
7
+ gem 'coveralls', :require => false
8
+ gem 'minitest', '>= 5'
9
+ gem 'rr', '>= 1.1'
10
+ gem 'simplecov', :require => false
5
11
  end
6
12
 
7
13
  gemspec
data/README CHANGED
@@ -24,8 +24,8 @@ When you have your consumer key and its secret you authorize
24
24
  your Twitter account to make API requests with your consumer key
25
25
  and secret.
26
26
 
27
- % twurl authorize --consumer-key the_key \
28
- --consumer-secret the_secret
27
+ % twurl authorize --consumer-key key \
28
+ --consumer-secret secret
29
29
 
30
30
  This will return an URL that you should open up in your browser.
31
31
  Authenticate to Twitter, and then enter the returned PIN back into
@@ -35,9 +35,9 @@ to make requests with the API. Twurl will tell you as much.
35
35
  If your consumer application has xAuth enabled, then you can use
36
36
  a variant of the above
37
37
 
38
- % twurl authorize -u username -p password \
39
- --consumer-key the_key \
40
- --consumer-secret the_secret
38
+ % twurl authorize -u username -p password \
39
+ --consumer-key key \
40
+ --consumer-secret secret
41
41
 
42
42
  And, again assuming your username, password, key and secret is
43
43
  correct, will authorize you in one step.
@@ -49,25 +49,25 @@ correct, will authorize you in one step.
49
49
  The simplest request just requires that you specify the path you
50
50
  want to request.
51
51
 
52
- % twurl /1/statuses/home_timeline.xml
52
+ % twurl /1.1/statuses/home_timeline.json
53
53
 
54
54
  Similar to curl, a GET request is performed by default.
55
55
 
56
56
  You can implicitly perform a POST request by passing the -d option,
57
57
  which specifies POST parameters.
58
58
 
59
- % twurl -d 'status=Testing twurl' /1/statuses/update.xml
59
+ % twurl -d 'status=Testing twurl' /1.1/statuses/update.json
60
60
 
61
61
  You can explicitly specify what request method to perform with
62
62
  the -X (or --request-method) option.
63
63
 
64
- % twurl -X DELETE /1/statuses/destroy/123456.xml
64
+ % twurl -X POST /1.1/statuses/destroy/1234567890.json
65
65
 
66
66
  +------------------+
67
67
  | Creating aliases |
68
68
  +------------------+
69
69
 
70
- % twurl alias h /1/statuses/home_timeline.xml
70
+ % twurl alias h /1.1/statuses/home_timeline.json
71
71
 
72
72
  You can then use "h" in place of the full path.
73
73
 
@@ -77,7 +77,7 @@ Paths that require additional options such as request parameters for example can
77
77
  be used with aliases the same as with full explicit paths, just as you might
78
78
  expect.
79
79
 
80
- % twurl alias tweet /1/statuses/update.xml
80
+ % twurl alias tweet /1.1/statuses/update.json
81
81
  % twurl tweet -d "status=Aliases in twurl are convenient"
82
82
 
83
83
  +-------------------------------+
data/lib/twurl/cli.rb CHANGED
@@ -44,10 +44,12 @@ module Twurl
44
44
  option_parser = OptionParser.new do |o|
45
45
  o.extend AvailableOptions
46
46
 
47
- o.banner = "Usage: twurl authorize -u username -p password --consumer-key HQsAGcVm5MQT3n6j7qVJw --consumer-secret asdfasd223sd2\n" +
48
- " twurl [options] /statuses/home_timeline.xml\n" +
49
- "\n" +
50
- "Supported Commands:\n#{SUPPORTED_COMMANDS.sort.join(', ')}"
47
+ o.banner = <<-BANNER
48
+ Usage: twurl authorize --consumer-key key --consumer-secret secret
49
+ twurl [options] /1.1/statuses/home_timeline.json
50
+
51
+ Supported Commands: #{SUPPORTED_COMMANDS.sort.join(', ')}
52
+ BANNER
51
53
 
52
54
  o.section "Getting started:" do
53
55
  tutorial
data/lib/twurl/version.rb CHANGED
@@ -1,10 +1,17 @@
1
1
  module Twurl
2
- module VERSION
3
- MAJOR = 0 unless defined? MAJOR
4
- MINOR = 8 unless defined? MINOR
5
- PATCH = 1 unless defined? PATCH
6
- BETA = nil unless defined? BETA # Time.now.to_i.to_s
2
+ class Version
3
+ MAJOR = 0 unless defined? Twurl::Version::MAJOR
4
+ MINOR = 8 unless defined? Twurl::Version::MINOR
5
+ PATCH = 2 unless defined? Twurl::Version::PATCH
6
+ BETA = nil unless defined? Twurl::Version::BETA # Time.now.to_i.to_s
7
+
8
+ class << self
9
+ # @return [String]
10
+ def to_s
11
+ [MAJOR, MINOR, PATCH, BETA].compact.join('.')
12
+ end
13
+ end
7
14
  end
8
15
 
9
- Version = [VERSION::MAJOR, VERSION::MINOR, VERSION::PATCH, VERSION::BETA].compact * '.'
16
+ VERSION = Version.to_s
10
17
  end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::AccountInformationController::DispatchWithNoAuthorizedAccountsTest < MiniTest::Unit::TestCase
3
+ class Twurl::AccountInformationController::DispatchWithNoAuthorizedAccountsTest < Minitest::Test
4
4
  attr_reader :options, :client, :controller
5
5
  def setup
6
6
  @options = Twurl::Options.new
@@ -16,7 +16,7 @@ class Twurl::AccountInformationController::DispatchWithNoAuthorizedAccountsTest
16
16
  end
17
17
  end
18
18
 
19
- class Twurl::AccountInformationController::DispatchWithOneAuthorizedAccountTest < MiniTest::Unit::TestCase
19
+ class Twurl::AccountInformationController::DispatchWithOneAuthorizedAccountTest < Minitest::Test
20
20
  attr_reader :options, :client, :controller
21
21
  def setup
22
22
  @options = Twurl::Options.test_exemplar
@@ -34,7 +34,7 @@ class Twurl::AccountInformationController::DispatchWithOneAuthorizedAccountTest
34
34
  end
35
35
  end
36
36
 
37
- class Twurl::AccountInformationController::DispatchWithOneUsernameThatHasAuthorizedMultipleAccountsTest < MiniTest::Unit::TestCase
37
+ class Twurl::AccountInformationController::DispatchWithOneUsernameThatHasAuthorizedMultipleAccountsTest < Minitest::Test
38
38
  attr_reader :default_client_options, :default_client, :other_client_options, :other_client, :controller
39
39
  def setup
40
40
  @default_client_options = Twurl::Options.test_exemplar
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::AliasesController::DispatchTest < MiniTest::Unit::TestCase
3
+ class Twurl::AliasesController::DispatchTest < Minitest::Test
4
4
  attr_reader :options, :client
5
5
  def setup
6
6
  @options = Twurl::Options.test_exemplar
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::AuthorizationController::DispatchTest < MiniTest::Unit::TestCase
3
+ class Twurl::AuthorizationController::DispatchTest < Minitest::Test
4
4
  attr_reader :options, :client, :controller
5
5
  def setup
6
6
  @options = Twurl::Options.new
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::Options::Test < MiniTest::Unit::TestCase
3
+ class Twurl::Options::Test < Minitest::Test
4
4
  attr_reader :options
5
5
  def setup
6
6
  @options = Twurl::Options.new
data/test/cli_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::CLI::OptionParsingTest < MiniTest::Unit::TestCase
3
+ class Twurl::CLI::OptionParsingTest < Minitest::Test
4
4
  module CommandParsingTests
5
5
  def test_no_command_specified_falls_to_default_command
6
6
  options = Twurl::CLI.parse_options(['/1.1/url/does/not/matter.json'])
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::ConfigurationController::DispatchTest < MiniTest::Unit::TestCase
3
+ class Twurl::ConfigurationController::DispatchTest < Minitest::Test
4
4
  def test_error_message_is_displayed_if_setting_is_unrecognized
5
5
  options = Twurl::Options.test_exemplar
6
6
  client = Twurl::OAuthClient.test_exemplar
@@ -15,7 +15,7 @@ class Twurl::ConfigurationController::DispatchTest < MiniTest::Unit::TestCase
15
15
  end
16
16
  end
17
17
 
18
- class Twurl::ConfigurationController::DispatchDefaultSettingTest < MiniTest::Unit::TestCase
18
+ class Twurl::ConfigurationController::DispatchDefaultSettingTest < Minitest::Test
19
19
  def test_setting_default_profile_just_by_username
20
20
  options = Twurl::Options.test_exemplar
21
21
  client = Twurl::OAuthClient.test_exemplar
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::OAuthClient::AbstractOAuthClientTest < MiniTest::Unit::TestCase
3
+ class Twurl::OAuthClient::AbstractOAuthClientTest < Minitest::Test
4
4
  attr_reader :client, :options
5
5
  def setup
6
6
  Twurl::OAuthClient.instance_variable_set(:@rcfile, nil)
@@ -9,7 +9,7 @@ class Twurl::OAuthClient::AbstractOAuthClientTest < MiniTest::Unit::TestCase
9
9
  @client = Twurl::OAuthClient.test_exemplar
10
10
  options.base_url = 'api.twitter.com'
11
11
  options.request_method = 'get'
12
- options.path = '/path/does/not/matter.xml'
12
+ options.path = '/path/does/not/matter.json'
13
13
  options.data = {}
14
14
  options.headers = {}
15
15
 
data/test/rcfile_test.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::RCFile::PathConstructionTest < MiniTest::Unit::TestCase
3
+ class Twurl::RCFile::PathConstructionTest < Minitest::Test
4
4
  def test_file_path_appends_file_to_directory
5
5
  assert_equal File.join(Twurl::RCFile.directory, Twurl::RCFile::FILE), Twurl::RCFile.file_path
6
6
  end
7
7
  end
8
8
 
9
- class Twurl::RCFile::LoadingTest < MiniTest::Unit::TestCase
9
+ class Twurl::RCFile::LoadingTest < Minitest::Test
10
10
  def test_load_parses_and_loads_file_if_it_exists
11
11
  mock(YAML).load_file(Twurl::RCFile.file_path).times(1)
12
12
  mock(Twurl::RCFile).default_rcfile_structure.never
@@ -22,7 +22,7 @@ class Twurl::RCFile::LoadingTest < MiniTest::Unit::TestCase
22
22
  end
23
23
  end
24
24
 
25
- class Twurl::RCFile::InitializationTest < MiniTest::Unit::TestCase
25
+ class Twurl::RCFile::InitializationTest < Minitest::Test
26
26
  def test_initializing_when_the_file_does_not_exist_loads_default_rcfile_structure
27
27
  mock(YAML).load_file(Twurl::RCFile.file_path) { raise Errno::ENOENT }.times(1)
28
28
 
@@ -40,7 +40,7 @@ class Twurl::RCFile::InitializationTest < MiniTest::Unit::TestCase
40
40
  end
41
41
  end
42
42
 
43
- class Twurl::RCFile::DefaultProfileFromDefaultRCFileTest < MiniTest::Unit::TestCase
43
+ class Twurl::RCFile::DefaultProfileFromDefaultRCFileTest < Minitest::Test
44
44
  attr_reader :rcfile
45
45
  def setup
46
46
  mock(YAML).load_file(Twurl::RCFile.file_path) { raise Errno::ENOENT }.times(1)
@@ -66,7 +66,7 @@ class Twurl::RCFile::DefaultProfileFromDefaultRCFileTest < MiniTest::Unit::TestC
66
66
  end
67
67
  end
68
68
 
69
- class Twurl::RCFile::UpdatingTest < MiniTest::Unit::TestCase
69
+ class Twurl::RCFile::UpdatingTest < Minitest::Test
70
70
  attr_reader :rcfile
71
71
  def setup
72
72
  mock(YAML).load_file(Twurl::RCFile.file_path) { raise Errno::ENOENT }.times(1)
@@ -108,7 +108,7 @@ class Twurl::RCFile::UpdatingTest < MiniTest::Unit::TestCase
108
108
  end
109
109
  end
110
110
 
111
- class Twurl::RCFile::SavingTest < MiniTest::Unit::TestCase
111
+ class Twurl::RCFile::SavingTest < Minitest::Test
112
112
  attr_reader :rcfile
113
113
  def setup
114
114
  delete_rcfile
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
- class Twurl::RequestController::AbstractTestCase < MiniTest::Unit::TestCase
3
+ class Twurl::RequestController::AbstractTestCase < Minitest::Test
4
4
  attr_reader :options, :client, :controller
5
5
  def setup
6
6
  Twurl::CLI.output = StringIO.new
data/test/test_helper.rb CHANGED
@@ -1,17 +1,16 @@
1
- unless ENV['CI']
2
- require 'simplecov'
3
- SimpleCov.start do
4
- add_filter 'test'
5
- end
6
- end
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+
4
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
+ SimpleCov::Formatter::HTMLFormatter,
6
+ Coveralls::SimpleCov::Formatter
7
+ ]
8
+ SimpleCov.start
9
+
7
10
  require 'twurl'
8
11
  require 'minitest/autorun'
9
12
  require 'rr'
10
13
 
11
- class MiniTest::Unit::TestCase
12
- include RR::Adapters::TestUnit
13
- end
14
-
15
14
  Twurl::RCFile.directory = ENV['TMPDIR']
16
15
 
17
16
  module Twurl
data/twurl.gemspec CHANGED
@@ -1,25 +1,25 @@
1
- # encoding: utf-8
2
- require File.expand_path('../lib/twurl/version', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'twurl/version'
3
5
 
4
- Gem::Specification.new do |s|
5
- s.add_dependency 'oauth', '~> 0.4'
6
- s.add_development_dependency 'rake'
7
- s.add_development_dependency 'rr'
8
- s.add_development_dependency 'simplecov'
9
- s.add_development_dependency 'minitest'
10
- s.authors = ["Marcel Molina", "Erik Michaels-Ober"]
11
- s.description = %q{Curl for the Twitter API}
12
- s.email = ['marcel@twitter.com']
13
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
14
- s.extra_rdoc_files = %w(COPYING INSTALL README)
15
- s.files = `git ls-files`.split("\n")
16
- s.homepage = 'http://github.com/marcel/twurl'
17
- s.name = 'twurl'
18
- s.rdoc_options = ['--title', 'twurl -- OAuth-enabled curl for the Twitter API', '--main', 'README', '--line-numbers', '--inline-source']
19
- s.require_paths = ['lib']
20
- s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
21
- s.rubyforge_project = 'twurl'
22
- s.summary = s.description
23
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
- s.version = Twurl::Version
6
+ Gem::Specification.new do |spec|
7
+ spec.add_dependency 'oauth', '~> 0.4'
8
+ spec.add_development_dependency 'bundler', '~> 1.0'
9
+ spec.authors = ["Marcel Molina", "Erik Michaels-Ober"]
10
+ spec.description = %q{Curl for the Twitter API}
11
+ spec.email = ['marcel@twitter.com']
12
+ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
+ spec.extra_rdoc_files = %w(COPYING INSTALL README)
14
+ spec.files = `git ls-files`.split("\n")
15
+ spec.homepage = 'http://github.com/marcel/twurl'
16
+ spec.licenses = ['MIT']
17
+ spec.name = 'twurl'
18
+ spec.rdoc_options = ['--title', 'twurl -- OAuth-enabled curl for the Twitter API', '--main', 'README', '--line-numbers', '--inline-source']
19
+ spec.require_paths = ['lib']
20
+ spec.required_rubygems_version = '>= 1.3.5'
21
+ spec.rubyforge_project = 'twurl'
22
+ spec.summary = spec.description
23
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
+ spec.version = Twurl::Version
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twurl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-10 00:00:00.000000000 Z
13
+ date: 2013-06-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oauth
@@ -29,69 +29,21 @@ dependencies:
29
29
  - !ruby/object:Gem::Version
30
30
  version: '0.4'
31
31
  - !ruby/object:Gem::Dependency
32
- name: rake
32
+ name: bundler
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  none: false
35
35
  requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: '0'
39
- type: :development
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: rr
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- - !ruby/object:Gem::Dependency
64
- name: simplecov
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
79
- - !ruby/object:Gem::Dependency
80
- name: minitest
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ! '>='
36
+ - - ~>
85
37
  - !ruby/object:Gem::Version
86
- version: '0'
38
+ version: '1.0'
87
39
  type: :development
88
40
  prerelease: false
89
41
  version_requirements: !ruby/object:Gem::Requirement
90
42
  none: false
91
43
  requirements:
92
- - - ! '>='
44
+ - - ~>
93
45
  - !ruby/object:Gem::Version
94
- version: '0'
46
+ version: '1.0'
95
47
  description: Curl for the Twitter API
96
48
  email:
97
49
  - marcel@twitter.com
@@ -135,7 +87,8 @@ files:
135
87
  - test/test_helper.rb
136
88
  - twurl.gemspec
137
89
  homepage: http://github.com/marcel/twurl
138
- licenses: []
90
+ licenses:
91
+ - MIT
139
92
  post_install_message:
140
93
  rdoc_options:
141
94
  - --title
@@ -157,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
110
  requirements:
158
111
  - - ! '>='
159
112
  - !ruby/object:Gem::Version
160
- version: 1.3.6
113
+ version: 1.3.5
161
114
  requirements: []
162
115
  rubyforge_project: twurl
163
116
  rubygems_version: 1.8.23