dustin-twitter 0.3.2.1 → 0.3.2.2

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.
Files changed (3) hide show
  1. data/lib/twitter/base.rb +4 -3
  2. data/twitter.gemspec +1 -1
  3. metadata +1 -1
data/lib/twitter/base.rb CHANGED
@@ -7,9 +7,10 @@ module Twitter
7
7
  class Base
8
8
 
9
9
  # Initializes the configuration for making requests to twitter
10
- def initialize(email, password, host='twitter.com')
10
+ def initialize(email, password, host='twitter.com', path='')
11
11
  @config, @config[:email], @config[:password] = {}, email, password
12
12
  @api_host = host
13
+ @api_path = path
13
14
  end
14
15
 
15
16
  # Returns an array of statuses for a timeline; Defaults to your friends timeline.
@@ -87,7 +88,7 @@ module Twitter
87
88
 
88
89
  # Sends a direct message <code>text</code> to <code>user</code>
89
90
  def d(user, text)
90
- url = URI.parse("http://#{@api_host}/direct_messages/new.xml")
91
+ url = URI.parse("http://#{@api_host}#{@api_path}/direct_messages/new.xml")
91
92
  req = Net::HTTP::Post.new(url.path)
92
93
  req.basic_auth(@config[:email], @config[:password])
93
94
  req.set_form_data({'text' => text, 'user' => user})
@@ -160,7 +161,7 @@ module Twitter
160
161
  def post(status, options={})
161
162
  form_data = {'status' => status}
162
163
  form_data.merge({'source' => options[:source]}) if options[:source]
163
- url = URI.parse("http://#{@api_host}/statuses/update.xml")
164
+ url = URI.parse("http://#{@api_host}#{@api_path}/statuses/update.xml")
164
165
  req = Net::HTTP::Post.new(url.path)
165
166
  req.basic_auth(@config[:email], @config[:password])
166
167
  req.set_form_data(form_data)
data/twitter.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{twitter}
3
- s.version = "0.3.2.1"
3
+ s.version = "0.3.2.2"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["John Nunemaker"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dustin-twitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.1
4
+ version: 0.3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker