tumblr_client 0.7.1 → 0.7.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.
data/Rakefile CHANGED
@@ -12,9 +12,9 @@ end
12
12
  task :release => :build do
13
13
  # tag and push
14
14
  system "git tag v#{Tumblr::VERSION}"
15
- system "git push origin --tags"
15
+ #system "git push origin --tags"
16
16
  # push the gem
17
- system "gem push ice_cube-#{Tumblr::VERSION}.gem"
17
+ system "gem push tumblr_client-#{Tumblr::VERSION}.gem"
18
18
  end
19
19
 
20
20
  RSpec::Core::RakeTask.new(:test) do |t|
data/bin/tumblr CHANGED
@@ -9,6 +9,9 @@ require 'irb/completion'
9
9
 
10
10
  path = File.join ENV['HOME'], '.tumblr'
11
11
 
12
+ host = Tumblr::Client.default_api_host.dup
13
+ host.gsub! 'api.', 'www.'
14
+
12
15
  if File.exist?(path)
13
16
 
14
17
  # Load configuration from data
@@ -23,16 +26,16 @@ else
23
26
 
24
27
  Tumblr.configure do |config|
25
28
 
26
- puts "Register an application at: http://www.tumblr.com/oauth/apps"
29
+ puts "Register an application at: http://#{host}/oauth/apps"
27
30
  print 'OAuth Consumer key: '
28
31
  config.consumer_key = gets.chomp
29
32
 
30
33
  print 'OAuth Consumer secret: '
31
34
  config.consumer_secret = gets.chomp
32
35
 
33
- site = 'http://www.tumblr.com'
36
+ site = "http://#{host}"
34
37
  consumer = OAuth::Consumer.new(config.consumer_key, config.consumer_secret, :site => site)
35
- request_token = consumer.get_request_token
38
+ request_token = consumer.get_request_token :oauth_callback => 'http://localhost/'
36
39
 
37
40
  puts
38
41
 
data/lib/tumblr/client.rb CHANGED
@@ -9,6 +9,12 @@ require 'tumblr/helpers'
9
9
  module Tumblr
10
10
  class Client
11
11
 
12
+ class << self
13
+ def default_api_host
14
+ ENV['TUMBLR_API_HOST'] || 'api.tumblr.com'
15
+ end
16
+ end
17
+
12
18
  include Tumblr::Request
13
19
  include Tumblr::Blog
14
20
  include Tumblr::User
@@ -25,7 +31,7 @@ module Tumblr
25
31
  end
26
32
 
27
33
  def api_host
28
- ENV['TUMBLR_API_HOST'] || 'api.tumblr.com'
34
+ self.class.default_api_host
29
35
  end
30
36
 
31
37
  def credentials
@@ -1,5 +1,5 @@
1
1
  module Tumblr
2
2
 
3
- VERSION = '0.7.1'
3
+ VERSION = '0.7.2'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.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: 2013-03-28 00:00:00.000000000 Z
13
+ date: 2013-05-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -188,9 +188,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  - - ! '>='
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
- segments:
192
- - 0
193
- hash: -1559546719117937655
194
191
  required_rubygems_version: !ruby/object:Gem::Requirement
195
192
  none: false
196
193
  requirements: