twurl 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +23 -0
- data/Rakefile +2 -21
- data/lib/twurl.rb +1 -1
- data/lib/twurl/cli.rb +6 -2
- data/lib/twurl/request_controller.rb +2 -2
- data/lib/twurl/version.rb +4 -4
- data/test/request_controller_test.rb +2 -2
- data/twurl.gemspec +25 -0
- metadata +85 -16
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
twurl (0.6.1)
|
5
|
+
oauth (~> 0.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
oauth (0.4.3)
|
11
|
+
rake (0.8.7)
|
12
|
+
rr (1.0.0)
|
13
|
+
test-unit (2.1.1)
|
14
|
+
|
15
|
+
PLATFORMS
|
16
|
+
ruby
|
17
|
+
|
18
|
+
DEPENDENCIES
|
19
|
+
oauth (~> 0.4)
|
20
|
+
rake (~> 0.8)
|
21
|
+
rr (~> 1.0)
|
22
|
+
test-unit (~> 2.1)
|
23
|
+
twurl!
|
data/Rakefile
CHANGED
@@ -30,26 +30,7 @@ namespace :test do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
namespace :dist do
|
33
|
-
spec = Gem::Specification.
|
34
|
-
s.name = 'twurl'
|
35
|
-
s.version = Gem::Version.new(Twurl::Version)
|
36
|
-
s.summary = "Curl for the Twitter API"
|
37
|
-
s.description = s.summary
|
38
|
-
s.email = ['marcel@twitter.com', 'raffi@twitter.com']
|
39
|
-
s.authors = ['Marcel Molina', 'Raffi Krikorian']
|
40
|
-
s.has_rdoc = true
|
41
|
-
s.extra_rdoc_files = %w(README COPYING INSTALL)
|
42
|
-
s.homepage = 'http://github.com/marcel/twurl'
|
43
|
-
s.rubyforge_project = 'twurl'
|
44
|
-
s.files = FileList['Rakefile', 'lib/**/*.rb', 'bin/*']
|
45
|
-
s.executables << 'twurl'
|
46
|
-
s.test_files = Dir['test/**/*']
|
47
|
-
|
48
|
-
s.add_dependency 'oauth'
|
49
|
-
s.rdoc_options = ['--title', "twurl -- OAuth-enabled curl for the Twitter API",
|
50
|
-
'--main', 'README',
|
51
|
-
'--line-numbers', '--inline-source']
|
52
|
-
end
|
33
|
+
spec = Gem::Specification.load('twurl.gemspec')
|
53
34
|
|
54
35
|
Rake::GemPackageTask.new(spec) do |pkg|
|
55
36
|
pkg.need_tar_gz = true
|
@@ -69,4 +50,4 @@ namespace :dist do
|
|
69
50
|
cd 'pkg'
|
70
51
|
system("gem unpack '#{spec.name}-#{spec.version}.gem' --target=$TWITTER/vendor/gems")
|
71
52
|
end
|
72
|
-
end
|
53
|
+
end
|
data/lib/twurl.rb
CHANGED
@@ -5,7 +5,7 @@ require 'ostruct'
|
|
5
5
|
require 'stringio'
|
6
6
|
require 'yaml'
|
7
7
|
|
8
|
-
library_files = Dir[File.join(File.dirname(__FILE__), "/twurl/**/*.rb")]
|
8
|
+
library_files = Dir[File.join(File.dirname(__FILE__), "/twurl/**/*.rb")].sort
|
9
9
|
library_files.each do |file|
|
10
10
|
require file
|
11
11
|
end
|
data/lib/twurl/cli.rb
CHANGED
@@ -79,13 +79,17 @@ module Twurl
|
|
79
79
|
Twurl.options
|
80
80
|
end
|
81
81
|
|
82
|
+
def print(*args, &block)
|
83
|
+
output.print(*args, &block)
|
84
|
+
end
|
85
|
+
|
82
86
|
def puts(*args, &block)
|
83
87
|
output.puts(*args, &block)
|
84
88
|
end
|
85
89
|
|
86
90
|
def prompt_for(label)
|
87
91
|
system "stty -echo"
|
88
|
-
print "#{label}: "
|
92
|
+
CLI.print "#{label}: "
|
89
93
|
result = STDIN.gets.chomp
|
90
94
|
CLI.puts
|
91
95
|
result
|
@@ -255,4 +259,4 @@ module Twurl
|
|
255
259
|
super || DEFAULT_HOST
|
256
260
|
end
|
257
261
|
end
|
258
|
-
end
|
262
|
+
end
|
data/lib/twurl/version.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Twurl
|
2
2
|
module VERSION
|
3
|
-
MAJOR = '0'
|
4
|
-
MINOR = '6'
|
5
|
-
TINY = '
|
6
|
-
BETA = nil # Time.now.to_i.to_s
|
3
|
+
MAJOR = '0' unless defined? MAJOR
|
4
|
+
MINOR = '6' unless defined? MINOR
|
5
|
+
TINY = '2' unless defined? TINY
|
6
|
+
BETA = nil unless defined? BETA # Time.now.to_i.to_s
|
7
7
|
end
|
8
8
|
|
9
9
|
Version = [VERSION::MAJOR, VERSION::MINOR, VERSION::TINY, VERSION::BETA].compact * '.'
|
@@ -46,7 +46,7 @@ class Twurl::RequestController::RequestTest < Twurl::RequestController::Abstract
|
|
46
46
|
|
47
47
|
controller.perform_request
|
48
48
|
|
49
|
-
assert_equal expected_body, Twurl::CLI.output.string
|
49
|
+
assert_equal expected_body, Twurl::CLI.output.string
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_invalid_or_unspecified_urls_report_error
|
@@ -55,4 +55,4 @@ class Twurl::RequestController::RequestTest < Twurl::RequestController::Abstract
|
|
55
55
|
|
56
56
|
controller.perform_request
|
57
57
|
end
|
58
|
-
end
|
58
|
+
end
|
data/twurl.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/twurl/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "twurl"
|
6
|
+
s.version = Twurl::Version
|
7
|
+
s.authors = ["Marcel Molina", "Raffi Krikorian"]
|
8
|
+
s.default_executable = "twurl"
|
9
|
+
s.description = %q{Curl for the Twitter API}
|
10
|
+
s.email = ["marcel@twitter.com", "raffi@twitter.com"]
|
11
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
s.extra_rdoc_files = %w(README COPYING INSTALL)
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
|
+
s.homepage = "http://github.com/marcel/twurl"
|
15
|
+
s.rdoc_options = ["--title", "twurl -- OAuth-enabled curl for the Twitter API", "--main", "README", "--line-numbers", "--inline-source"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = "twurl"
|
18
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
|
19
|
+
s.summary = s.description
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
s.add_development_dependency("rake", ["~> 0.8"])
|
22
|
+
s.add_development_dependency("rr", ["~> 1.0"])
|
23
|
+
s.add_development_dependency("test-unit", ["~> 2.1"])
|
24
|
+
s.add_runtime_dependency("oauth", ["~> 0.4"])
|
25
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twurl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Marcel Molina
|
@@ -15,21 +16,69 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-
|
19
|
-
default_executable:
|
19
|
+
date: 2010-09-29 00:00:00 -07:00
|
20
|
+
default_executable: twurl
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
23
|
+
name: rake
|
23
24
|
prerelease: false
|
24
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
25
27
|
requirements:
|
26
|
-
- -
|
28
|
+
- - ~>
|
27
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 27
|
28
31
|
segments:
|
29
32
|
- 0
|
30
|
-
|
31
|
-
|
33
|
+
- 8
|
34
|
+
version: "0.8"
|
35
|
+
type: :development
|
32
36
|
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rr
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
version: "1.0"
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: test-unit
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 1
|
61
|
+
segments:
|
62
|
+
- 2
|
63
|
+
- 1
|
64
|
+
version: "2.1"
|
65
|
+
type: :development
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: oauth
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
- 4
|
79
|
+
version: "0.4"
|
80
|
+
type: :runtime
|
81
|
+
version_requirements: *id004
|
33
82
|
description: Curl for the Twitter API
|
34
83
|
email:
|
35
84
|
- marcel@twitter.com
|
@@ -43,7 +92,15 @@ extra_rdoc_files:
|
|
43
92
|
- COPYING
|
44
93
|
- INSTALL
|
45
94
|
files:
|
95
|
+
- .gitignore
|
96
|
+
- COPYING
|
97
|
+
- Gemfile
|
98
|
+
- Gemfile.lock
|
99
|
+
- INSTALL
|
100
|
+
- README
|
46
101
|
- Rakefile
|
102
|
+
- bin/twurl
|
103
|
+
- lib/twurl.rb
|
47
104
|
- lib/twurl/abstract_command_controller.rb
|
48
105
|
- lib/twurl/account_information_controller.rb
|
49
106
|
- lib/twurl/aliases_controller.rb
|
@@ -54,11 +111,17 @@ files:
|
|
54
111
|
- lib/twurl/rcfile.rb
|
55
112
|
- lib/twurl/request_controller.rb
|
56
113
|
- lib/twurl/version.rb
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
114
|
+
- test/account_information_controller_test.rb
|
115
|
+
- test/alias_controller_test.rb
|
116
|
+
- test/authorization_controller_test.rb
|
117
|
+
- test/cli_options_test.rb
|
118
|
+
- test/cli_test.rb
|
119
|
+
- test/configuration_controller_test.rb
|
120
|
+
- test/oauth_client_test.rb
|
121
|
+
- test/rcfile_test.rb
|
122
|
+
- test/request_controller_test.rb
|
123
|
+
- test/test_helper.rb
|
124
|
+
- twurl.gemspec
|
62
125
|
has_rdoc: true
|
63
126
|
homepage: http://github.com/marcel/twurl
|
64
127
|
licenses: []
|
@@ -74,23 +137,29 @@ rdoc_options:
|
|
74
137
|
require_paths:
|
75
138
|
- lib
|
76
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
77
141
|
requirements:
|
78
142
|
- - ">="
|
79
143
|
- !ruby/object:Gem::Version
|
144
|
+
hash: 3
|
80
145
|
segments:
|
81
146
|
- 0
|
82
147
|
version: "0"
|
83
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
84
150
|
requirements:
|
85
151
|
- - ">="
|
86
152
|
- !ruby/object:Gem::Version
|
153
|
+
hash: 23
|
87
154
|
segments:
|
88
|
-
-
|
89
|
-
|
155
|
+
- 1
|
156
|
+
- 3
|
157
|
+
- 6
|
158
|
+
version: 1.3.6
|
90
159
|
requirements: []
|
91
160
|
|
92
161
|
rubyforge_project: twurl
|
93
|
-
rubygems_version: 1.3.
|
162
|
+
rubygems_version: 1.3.7
|
94
163
|
signing_key:
|
95
164
|
specification_version: 3
|
96
165
|
summary: Curl for the Twitter API
|