pjdavis-twitter 0.3.9 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{History.txt → History} +20 -7
- data/{License.txt → License} +0 -0
- data/{Manifest.txt → Manifest} +14 -16
- data/{README.txt → README} +0 -0
- data/Rakefile +41 -3
- data/bin/twitter +1 -2
- data/examples/direct_messages.rb +1 -0
- data/examples/favorites.rb +4 -4
- data/examples/replies.rb +1 -0
- data/examples/search.rb +1 -0
- data/examples/sent_messages.rb +1 -0
- data/examples/timeline.rb +1 -0
- data/lib/twitter.rb +13 -2
- data/lib/twitter/base.rb +51 -18
- data/lib/twitter/cli.rb +13 -7
- data/lib/twitter/cli/helpers.rb +20 -8
- data/lib/twitter/search.rb +6 -6
- data/lib/twitter/search_result.rb +83 -0
- data/lib/twitter/search_result_info.rb +82 -0
- data/lib/twitter/version.rb +1 -7
- data/spec/base_spec.rb +32 -2
- data/spec/cli/helper_spec.rb +21 -7
- data/spec/fixtures/follower_ids.xml +11 -0
- data/spec/fixtures/friend_ids.xml +12 -0
- data/spec/fixtures/friendship_already_exists.xml +5 -0
- data/spec/fixtures/friendship_created.xml +12 -0
- data/spec/fixtures/search_result_info.yml +147 -0
- data/spec/search_spec.rb +10 -3
- data/spec/spec_helper.rb +12 -1
- data/twitter.gemspec +18 -22
- data/website/index.html +4 -13
- metadata +49 -47
- data/config/hoe.rb +0 -74
- data/config/requirements.rb +0 -17
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -74
- data/setup.rb +0 -1585
- data/tasks/deployment.rake +0 -50
- data/tasks/environment.rake +0 -7
- data/tasks/website.rake +0 -17
data/spec/search_spec.rb
CHANGED
@@ -53,8 +53,8 @@ describe Twitter::Search do
|
|
53
53
|
@search.per_page(25).query[:rpp].should == 25
|
54
54
|
end
|
55
55
|
|
56
|
-
it "should be able to specify the page
|
57
|
-
@search.page(
|
56
|
+
it "should be able to specify the page number" do
|
57
|
+
@search.page(20).query[:page].should == 20
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should be able to specify only returning results greater than an id" do
|
@@ -89,7 +89,7 @@ describe Twitter::Search do
|
|
89
89
|
|
90
90
|
describe "fetching" do
|
91
91
|
before do
|
92
|
-
@response =
|
92
|
+
@response = YAML.load_file(File.dirname(__FILE__) + '/fixtures/search_result_info.yml')
|
93
93
|
@search.class.stub!(:get).and_return(@response)
|
94
94
|
end
|
95
95
|
|
@@ -97,6 +97,13 @@ describe Twitter::Search do
|
|
97
97
|
@search.class.should_receive(:get).and_return(@response)
|
98
98
|
@search.from('jnunemaker').fetch().should == @response
|
99
99
|
end
|
100
|
+
|
101
|
+
it "should support dot notation" do
|
102
|
+
@search.class.should_receive(:get).and_return(@response)
|
103
|
+
info = @search.from('httparty').fetch()
|
104
|
+
info["max_id"].should == info.max_id
|
105
|
+
info["results"].first["text"].should == info.results.first.text
|
106
|
+
end
|
100
107
|
end
|
101
108
|
|
102
109
|
it "should be able to iterate over results" do
|
data/spec/spec_helper.rb
CHANGED
@@ -9,4 +9,15 @@ end
|
|
9
9
|
dir = File.dirname(__FILE__)
|
10
10
|
|
11
11
|
$:.unshift(File.join(dir, '/../lib/'))
|
12
|
-
require dir + '/../lib/twitter'
|
12
|
+
require dir + '/../lib/twitter'
|
13
|
+
|
14
|
+
|
15
|
+
def stdout_for(&block)
|
16
|
+
# Inspired by http://www.ruby-forum.com/topic/58647
|
17
|
+
old_stdout = $stdout
|
18
|
+
$stdout = StringIO.new
|
19
|
+
yield
|
20
|
+
output = $stdout.string
|
21
|
+
$stdout = old_stdout
|
22
|
+
output
|
23
|
+
end
|
data/twitter.gemspec
CHANGED
@@ -1,49 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = %q{twitter}
|
3
|
-
s.version = "0.
|
5
|
+
s.version = "0.4.2"
|
4
6
|
|
5
|
-
s.required_rubygems_version = Gem::Requirement.new(">=
|
6
|
-
s.authors = ["John Nunemaker"
|
7
|
-
s.date = %q{
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["John Nunemaker"]
|
9
|
+
s.date = %q{2009-02-11}
|
8
10
|
s.default_executable = %q{twitter}
|
9
11
|
s.description = %q{a command line interface for twitter, also a library which wraps the twitter api}
|
10
12
|
s.email = %q{nunemaker@gmail.com}
|
11
13
|
s.executables = ["twitter"]
|
12
|
-
s.extra_rdoc_files = ["
|
13
|
-
s.files = ["
|
14
|
+
s.extra_rdoc_files = ["bin/twitter", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/search_result.rb", "lib/twitter/search_result_info.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "README"]
|
15
|
+
s.files = ["bin/twitter", "examples/blocks.rb", "examples/direct_messages.rb", "examples/favorites.rb", "examples/friends_followers.rb", "examples/friendships.rb", "examples/identica_timeline.rb", "examples/location.rb", "examples/posting.rb", "examples/replies.rb", "examples/search.rb", "examples/sent_messages.rb", "examples/timeline.rb", "examples/twitter.rb", "examples/verify_credentials.rb", "History", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/search_result.rb", "lib/twitter/search_result_info.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "License", "Manifest", "Rakefile", "README", "spec/base_spec.rb", "spec/cli/helper_spec.rb", "spec/direct_message_spec.rb", "spec/fixtures/follower_ids.xml", "spec/fixtures/followers.xml", "spec/fixtures/friend_ids.xml", "spec/fixtures/friends.xml", "spec/fixtures/friends_for.xml", "spec/fixtures/friends_lite.xml", "spec/fixtures/friends_timeline.xml", "spec/fixtures/friendship_already_exists.xml", "spec/fixtures/friendship_created.xml", "spec/fixtures/public_timeline.xml", "spec/fixtures/rate_limit_status.xml", "spec/fixtures/search_result_info.yml", "spec/fixtures/search_results.json", "spec/fixtures/status.xml", "spec/fixtures/user.xml", "spec/fixtures/user_timeline.xml", "spec/search_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/status_spec.rb", "spec/user_spec.rb", "twitter.gemspec", "website/css/common.css", "website/images/terminal_output.png", "website/index.html"]
|
14
16
|
s.has_rdoc = true
|
15
17
|
s.homepage = %q{http://twitter.rubyforge.org}
|
16
|
-
s.rdoc_options = ["--main", "README
|
18
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Twitter", "--main", "README"]
|
17
19
|
s.require_paths = ["lib"]
|
18
20
|
s.rubyforge_project = %q{twitter}
|
19
|
-
s.rubygems_version = %q{1.
|
21
|
+
s.rubygems_version = %q{1.3.1}
|
20
22
|
s.summary = %q{a command line interface for twitter, also a library which wraps the twitter api}
|
21
23
|
|
22
24
|
if s.respond_to? :specification_version then
|
23
25
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
26
|
s.specification_version = 2
|
25
27
|
|
26
|
-
if
|
28
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
29
|
s.add_runtime_dependency(%q<hpricot>, [">= 0.6"])
|
28
30
|
s.add_runtime_dependency(%q<activesupport>, [">= 2.1"])
|
29
|
-
s.add_runtime_dependency(%q<
|
30
|
-
s.
|
31
|
-
s.add_runtime_dependency(%q<activerecord>, [">= 2.1"])
|
32
|
-
s.add_runtime_dependency(%q<httparty>, [">= 0.1.0"])
|
31
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.2.4"])
|
32
|
+
s.add_development_dependency(%q<echoe>, [">= 0"])
|
33
33
|
else
|
34
34
|
s.add_dependency(%q<hpricot>, [">= 0.6"])
|
35
35
|
s.add_dependency(%q<activesupport>, [">= 2.1"])
|
36
|
-
s.add_dependency(%q<
|
37
|
-
s.add_dependency(%q<
|
38
|
-
s.add_dependency(%q<activerecord>, [">= 2.1"])
|
39
|
-
s.add_dependency(%q<httparty>, [">= 0.1.0"])
|
36
|
+
s.add_dependency(%q<httparty>, [">= 0.2.4"])
|
37
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
40
38
|
end
|
41
39
|
else
|
42
40
|
s.add_dependency(%q<hpricot>, [">= 0.6"])
|
43
41
|
s.add_dependency(%q<activesupport>, [">= 2.1"])
|
44
|
-
s.add_dependency(%q<
|
45
|
-
s.add_dependency(%q<
|
46
|
-
s.add_dependency(%q<activerecord>, [">= 2.1"])
|
47
|
-
s.add_dependency(%q<httparty>, [">= 0.1.0"])
|
42
|
+
s.add_dependency(%q<httparty>, [">= 0.2.4"])
|
43
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
48
44
|
end
|
49
|
-
end
|
45
|
+
end
|
data/website/index.html
CHANGED
@@ -87,7 +87,10 @@ Twitter::Search.new.from('jnunemaker').to('oaknd1').fetch()
|
|
87
87
|
|
88
88
|
<p><img src="images/terminal_output.png" alt="Terminal Output" style="width:560px;" /></p>
|
89
89
|
|
90
|
-
<p
|
90
|
+
<p>I removed the command line dependencies from the gem dependencies list so if you want to use the command line part of the twitter gem be sure to install the following gems as well.</p>
|
91
|
+
|
92
|
+
<pre><code>$ sudo gem install main highline sqlite3-ruby
|
93
|
+
$ sudo gem install activerecord -v 2.2.2</code></pre>
|
91
94
|
|
92
95
|
<p>The first thing you'll want to do is install the database so your account(s) can be stored.</p>
|
93
96
|
|
@@ -127,18 +130,6 @@ Account List
|
|
127
130
|
|
128
131
|
<h2>Support</h2>
|
129
132
|
<p>Conversations welcome in the <a href="http://groups.google.com/group/ruby-twitter-gem">google group</a> and bugs/features over at <a href="http://jnunemaker.lighthouseapp.com/projects/14843-twitter-gem/overview">lighthouse</a></p>
|
130
|
-
|
131
|
-
<h2>Uses</h2>
|
132
|
-
<ul>
|
133
|
-
<li><a href="http://snitch.rubyforge.org">Snitch</a></li>
|
134
|
-
<li><a href="http://al3x.net/entries/766">Growl + Twitter</a></li>
|
135
|
-
<li><a href="http://snippets.dzone.com/posts/show/3714">Twitter Woot Bot</a> (<a href="http://soylentfoo.jnewland.com/articles/2007/03/22/woot-twitter-bot-now-official">more here</a>)</li>
|
136
|
-
<li><a href="http://soylentfoo.jnewland.com/articles/2007/01/22/tweet-update-twitter-via-quicksilver">Tweet Quicksilver Action</a></li>
|
137
|
-
<li><a href="http://blog.evanweaver.com/articles/2007/02/09/log-system-security-events-to-twitter">logging security events to twitter</a></li>
|
138
|
-
<li><a href="http://shareomatic.com/">Shareomatic</a> is using it for their <a href="http://twitter.com/shareomatic">twitter account</a></li>
|
139
|
-
</ul>
|
140
|
-
|
141
|
-
<p>Using the twitter gem for something, <a href="mailto:nunemaker@gmail.com">let me know</a> and I'll add you above.</p>
|
142
133
|
</div>
|
143
134
|
|
144
135
|
<div id="footer">
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pjdavis-twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
|
-
- PJ Davis
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
11
|
|
13
|
-
date:
|
12
|
+
date: 2009-02-11 00:00:00 -08:00
|
14
13
|
default_executable: twitter
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
@@ -32,40 +31,22 @@ dependencies:
|
|
32
31
|
version: "2.1"
|
33
32
|
version:
|
34
33
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
36
|
-
version_requirement:
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 2.8.2
|
42
|
-
version:
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: highline
|
45
|
-
version_requirement:
|
46
|
-
version_requirements: !ruby/object:Gem::Requirement
|
47
|
-
requirements:
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 1.4.0
|
51
|
-
version:
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: activerecord
|
34
|
+
name: httparty
|
54
35
|
version_requirement:
|
55
36
|
version_requirements: !ruby/object:Gem::Requirement
|
56
37
|
requirements:
|
57
38
|
- - ">="
|
58
39
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
40
|
+
version: 0.2.4
|
60
41
|
version:
|
61
42
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
43
|
+
name: echoe
|
63
44
|
version_requirement:
|
64
45
|
version_requirements: !ruby/object:Gem::Requirement
|
65
46
|
requirements:
|
66
47
|
- - ">="
|
67
48
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
49
|
+
version: "0"
|
69
50
|
version:
|
70
51
|
description: a command line interface for twitter, also a library which wraps the twitter api
|
71
52
|
email: nunemaker@gmail.com
|
@@ -74,19 +55,31 @@ executables:
|
|
74
55
|
extensions: []
|
75
56
|
|
76
57
|
extra_rdoc_files:
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
58
|
+
- bin/twitter
|
59
|
+
- lib/twitter/base.rb
|
60
|
+
- lib/twitter/cli/config.rb
|
61
|
+
- lib/twitter/cli/helpers.rb
|
62
|
+
- lib/twitter/cli/migrations/20080722194500_create_accounts.rb
|
63
|
+
- lib/twitter/cli/migrations/20080722194508_create_tweets.rb
|
64
|
+
- lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb
|
65
|
+
- lib/twitter/cli/migrations/20080722214606_create_configurations.rb
|
66
|
+
- lib/twitter/cli/models/account.rb
|
67
|
+
- lib/twitter/cli/models/configuration.rb
|
68
|
+
- lib/twitter/cli/models/tweet.rb
|
69
|
+
- lib/twitter/cli.rb
|
70
|
+
- lib/twitter/direct_message.rb
|
71
|
+
- lib/twitter/easy_class_maker.rb
|
72
|
+
- lib/twitter/rate_limit_status.rb
|
73
|
+
- lib/twitter/search.rb
|
74
|
+
- lib/twitter/search_result.rb
|
75
|
+
- lib/twitter/search_result_info.rb
|
76
|
+
- lib/twitter/status.rb
|
77
|
+
- lib/twitter/user.rb
|
78
|
+
- lib/twitter/version.rb
|
79
|
+
- lib/twitter.rb
|
80
|
+
- README
|
81
81
|
files:
|
82
|
-
- History.txt
|
83
|
-
- License.txt
|
84
|
-
- Manifest.txt
|
85
|
-
- README.txt
|
86
|
-
- Rakefile
|
87
82
|
- bin/twitter
|
88
|
-
- config/hoe.rb
|
89
|
-
- config/requirements.rb
|
90
83
|
- examples/blocks.rb
|
91
84
|
- examples/direct_messages.rb
|
92
85
|
- examples/favorites.rb
|
@@ -101,9 +94,8 @@ files:
|
|
101
94
|
- examples/timeline.rb
|
102
95
|
- examples/twitter.rb
|
103
96
|
- examples/verify_credentials.rb
|
104
|
-
-
|
97
|
+
- History
|
105
98
|
- lib/twitter/base.rb
|
106
|
-
- lib/twitter/cli.rb
|
107
99
|
- lib/twitter/cli/config.rb
|
108
100
|
- lib/twitter/cli/helpers.rb
|
109
101
|
- lib/twitter/cli/migrations/20080722194500_create_accounts.rb
|
@@ -113,27 +105,36 @@ files:
|
|
113
105
|
- lib/twitter/cli/models/account.rb
|
114
106
|
- lib/twitter/cli/models/configuration.rb
|
115
107
|
- lib/twitter/cli/models/tweet.rb
|
108
|
+
- lib/twitter/cli.rb
|
116
109
|
- lib/twitter/direct_message.rb
|
117
110
|
- lib/twitter/easy_class_maker.rb
|
118
111
|
- lib/twitter/rate_limit_status.rb
|
119
112
|
- lib/twitter/search.rb
|
113
|
+
- lib/twitter/search_result.rb
|
114
|
+
- lib/twitter/search_result_info.rb
|
120
115
|
- lib/twitter/status.rb
|
121
116
|
- lib/twitter/user.rb
|
122
117
|
- lib/twitter/version.rb
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
118
|
+
- lib/twitter.rb
|
119
|
+
- License
|
120
|
+
- Manifest
|
121
|
+
- Rakefile
|
122
|
+
- README
|
127
123
|
- spec/base_spec.rb
|
128
124
|
- spec/cli/helper_spec.rb
|
129
125
|
- spec/direct_message_spec.rb
|
126
|
+
- spec/fixtures/follower_ids.xml
|
130
127
|
- spec/fixtures/followers.xml
|
128
|
+
- spec/fixtures/friend_ids.xml
|
131
129
|
- spec/fixtures/friends.xml
|
132
130
|
- spec/fixtures/friends_for.xml
|
133
131
|
- spec/fixtures/friends_lite.xml
|
134
132
|
- spec/fixtures/friends_timeline.xml
|
133
|
+
- spec/fixtures/friendship_already_exists.xml
|
134
|
+
- spec/fixtures/friendship_created.xml
|
135
135
|
- spec/fixtures/public_timeline.xml
|
136
136
|
- spec/fixtures/rate_limit_status.xml
|
137
|
+
- spec/fixtures/search_result_info.yml
|
137
138
|
- spec/fixtures/search_results.json
|
138
139
|
- spec/fixtures/status.xml
|
139
140
|
- spec/fixtures/user.xml
|
@@ -143,9 +144,6 @@ files:
|
|
143
144
|
- spec/spec_helper.rb
|
144
145
|
- spec/status_spec.rb
|
145
146
|
- spec/user_spec.rb
|
146
|
-
- tasks/deployment.rake
|
147
|
-
- tasks/environment.rake
|
148
|
-
- tasks/website.rake
|
149
147
|
- twitter.gemspec
|
150
148
|
- website/css/common.css
|
151
149
|
- website/images/terminal_output.png
|
@@ -154,8 +152,12 @@ has_rdoc: true
|
|
154
152
|
homepage: http://twitter.rubyforge.org
|
155
153
|
post_install_message:
|
156
154
|
rdoc_options:
|
155
|
+
- --line-numbers
|
156
|
+
- --inline-source
|
157
|
+
- --title
|
158
|
+
- Twitter
|
157
159
|
- --main
|
158
|
-
- README
|
160
|
+
- README
|
159
161
|
require_paths:
|
160
162
|
- lib
|
161
163
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -168,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
170
|
requirements:
|
169
171
|
- - ">="
|
170
172
|
- !ruby/object:Gem::Version
|
171
|
-
version: "
|
173
|
+
version: "1.2"
|
172
174
|
version:
|
173
175
|
requirements: []
|
174
176
|
|
data/config/hoe.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
require 'twitter/version'
|
2
|
-
|
3
|
-
AUTHOR = "John Nunemaker" # can also be an array of Authors
|
4
|
-
EMAIL = "nunemaker@gmail.com"
|
5
|
-
DESCRIPTION = "a command line interface for twitter, also a library which wraps the twitter api"
|
6
|
-
GEM_NAME = "twitter" # what ppl will type to install your gem
|
7
|
-
RUBYFORGE_PROJECT = "twitter" # The unix name for your project
|
8
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
-
RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
|
10
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
11
|
-
|
12
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
13
|
-
@config = nil
|
14
|
-
RUBYFORGE_USERNAME = "unknown"
|
15
|
-
def rubyforge_username
|
16
|
-
unless @config
|
17
|
-
begin
|
18
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
19
|
-
rescue
|
20
|
-
puts <<-EOS
|
21
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
22
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
23
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
24
|
-
EOS
|
25
|
-
exit
|
26
|
-
end
|
27
|
-
end
|
28
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
29
|
-
end
|
30
|
-
|
31
|
-
|
32
|
-
REV = nil
|
33
|
-
# UNCOMMENT IF REQUIRED:
|
34
|
-
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
35
|
-
VERS = Twitter::VERSION::STRING + (REV ? ".#{REV}" : "")
|
36
|
-
RDOC_OPTS = ['--quiet', '--title', 'twitter documentation',
|
37
|
-
"--opname", "index.html",
|
38
|
-
"--line-numbers",
|
39
|
-
"--main", "README",
|
40
|
-
"--inline-source"]
|
41
|
-
|
42
|
-
class Hoe
|
43
|
-
def extra_deps
|
44
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
45
|
-
@extra_deps
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Generate all the Rake tasks
|
50
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
51
|
-
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
52
|
-
p.author = AUTHOR
|
53
|
-
p.description = DESCRIPTION
|
54
|
-
p.email = EMAIL
|
55
|
-
p.summary = DESCRIPTION
|
56
|
-
p.url = HOMEPATH
|
57
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
58
|
-
p.test_globs = ["test/**/test_*.rb"]
|
59
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
60
|
-
|
61
|
-
# == Optional
|
62
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
63
|
-
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
64
|
-
p.extra_deps = [['hpricot', '>= 0.6'], ['activesupport', '>= 2.1'],
|
65
|
-
['main', '>= 2.8.2'], ['highline', '>= 1.4.0'],
|
66
|
-
['activerecord', '>= 2.1'], ['httparty', '>= 0.1.0']]
|
67
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
72
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
73
|
-
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
74
|
-
hoe.rsync_args = '-av --delete --ignore-errors'
|
data/config/requirements.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
16
|
-
|
17
|
-
require 'twitter'
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|