weibo 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -11,9 +11,6 @@ gem 'httparty', '>= 0.5.2'
11
11
  require 'httparty'
12
12
 
13
13
  module Weibo
14
- module Config
15
- mattr_accessor :api_key
16
- end
17
14
  class WeiboError < StandardError
18
15
  attr_reader :data
19
16
 
@@ -57,6 +54,7 @@ require File.join(directory, 'weibo', 'oauth')
57
54
  require File.join(directory, 'weibo', 'oauth_hack')
58
55
  require File.join(directory, 'weibo', 'httpauth')
59
56
  require File.join(directory, 'weibo', 'request')
57
+ require File.join(directory, 'weibo', 'config')
60
58
  require File.join(directory, 'weibo', 'base')
61
59
 
62
60
  # code is an adaptation of the twitter gem by John Nunemaker
@@ -0,0 +1,13 @@
1
+ module Weibo
2
+ module Config
3
+
4
+ def self.api_key=(val)
5
+ @@api_key = val
6
+ end
7
+
8
+ def self.api_key
9
+ @@api_key
10
+ end
11
+
12
+ end
13
+ end
@@ -2,7 +2,15 @@
2
2
  # as Sina Weibo doesn't follow the god damned OAuth specifications!!!
3
3
 
4
4
  module PostBodyHack
5
- mattr_accessor :parameters
5
+ @@parameters = nil
6
+ def self.parameters=(val)
7
+ @@parameters = val
8
+ end
9
+
10
+ def self.parameters
11
+ @@parameters
12
+ end
13
+
6
14
  def self.apply_hack(params={}, &block)
7
15
  self.parameters = params.stringify_keys
8
16
  rv = yield
@@ -23,6 +23,7 @@ module Weibo
23
23
 
24
24
  def initialize(client, method, path, options={})
25
25
  @client, @method, @path, @options = client, method, path, {:mash => true, :query => {:source => Weibo::Config.api_key}}.merge(options)
26
+ puts @options.inspect
26
27
  end
27
28
 
28
29
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{weibo}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Ballantyne"]
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "VERSION",
26
26
  "lib/weibo.rb",
27
27
  "lib/weibo/base.rb",
28
+ "lib/weibo/config.rb",
28
29
  "lib/weibo/httpauth.rb",
29
30
  "lib/weibo/oauth.rb",
30
31
  "lib/weibo/oauth_hack.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 0
9
- version: 0.0.0
8
+ - 1
9
+ version: 0.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Scott Ballantyne
@@ -47,6 +47,7 @@ files:
47
47
  - VERSION
48
48
  - lib/weibo.rb
49
49
  - lib/weibo/base.rb
50
+ - lib/weibo/config.rb
50
51
  - lib/weibo/httpauth.rb
51
52
  - lib/weibo/oauth.rb
52
53
  - lib/weibo/oauth_hack.rb