top4r 0.1.5 → 0.1.6

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.
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  class Top4R::Client
3
3
  alias :old_inspect :inspect
4
- attr_accessor :total_results
4
+ attr_accessor :total_results, :parameters, :session
5
5
  attr_reader :login
6
6
 
7
7
  def inspect
@@ -14,13 +14,12 @@ class Top4R::Client
14
14
  @@logger = Top4R::Logger.new(@@config.logger, @@config.trace)
15
15
  if @parameters and @session
16
16
  @parameters = Base64.decode64(@parameters).split('&').inject({}) do |hsh, i| kv = i.split('='); hsh[kv[0]] = kv[1]; hsh end
17
- @login = user(@parameters['visitor_nick'].to_utf8)
18
- # puts "login: #{@login.inspect}"
17
+ @login = user(@parameters['visitor_nick'])
19
18
  end
20
19
  end
21
20
 
22
21
  protected
23
- attr_accessor :app_key, :app_secret, :parameters, :session
22
+ attr_accessor :app_key, :app_secret
24
23
 
25
24
  def login_required(model, method)
26
25
  return if logged_in?
@@ -60,7 +60,7 @@ module Top4R
60
60
  class Trade
61
61
  include ModelMixin
62
62
  @@ATTRIBUTES = [:id, :seller_nick, :buyer_nick, :title, :type, :created, :iid, :price,
63
- :pic_path, :num, :tid, :buyer_message, :shipping_type, :alipay_no, :payment,
63
+ :pic_path, :num, :tid, :buyer_message, :shipping_type, :alipay_no, :payment, :sid,
64
64
  :discount_fee, :adjust_fee, :snapshot_url, :snapshot, :status, :seller_rate, :buyer_rate,
65
65
  :buyer_memo, :seller_memo, :trade_memo, :pay_time, :end_time, :modified, :buyer_obtain_point_fee,
66
66
  :point_fee, :real_point_fee, :total_fee, :post_fee, :buyer_alipay_no, :receiver_name,
@@ -66,7 +66,7 @@ module Top4R
66
66
  # User Model
67
67
  class User
68
68
  include ModelMixin
69
- @@ATTRIBUTES = [:id, :user_id, :nick, :sex, :buyer_credit, :seller_credit, :location,
69
+ @@ATTRIBUTES = [:id, :user_id, :nick, :sex, :avatar, :buyer_credit, :seller_credit, :location,
70
70
  :created, :last_visit, :birthday, :type, :has_more_pic, :item_img_num, :item_img_size,
71
71
  :prop_img_num, :prop_img_size, :auto_repost, :promoted_type, :status, :alipay_bind,
72
72
  :consumer_protection, :alipay_account, :alipay_no, :email, :magazine_subscribe, :vertical_market]
@@ -81,7 +81,7 @@ module Top4R
81
81
  end
82
82
 
83
83
  def default_private_fields
84
- ["location.zip", "birthday"]
84
+ ["location.zip", "birthday", "avatar", "email"]
85
85
  end
86
86
 
87
87
  def find(u, client)
@@ -98,7 +98,7 @@ module Top4R
98
98
  end
99
99
 
100
100
  def is_me?
101
- @nick == @client.instance_eval("@parameters['visitor_nick']").to_utf8
101
+ @nick == @client.instance_eval("@parameters['visitor_nick']")
102
102
  end
103
103
 
104
104
  def unmarshal_other_attrs
@@ -110,7 +110,7 @@ module Top4R
110
110
  end
111
111
  @buyer_credit = UserCredit.new(@buyer_credit) if @buyer_credit && @buyer_credit.size > 0
112
112
  @seller_credit = UserCredit.new(@seller_credit) if @seller_credit && @seller_credit.size > 0
113
- # @nick = @nick.to_utf8
113
+ # @nick = @nick
114
114
  self
115
115
  end
116
116
  end # User model
data/lib/top4r/version.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  module Top4R::Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- REVISION = 5
5
+ REVISION = 6
6
6
 
7
7
  class << self
8
8
  # Returns X.Y.Z formatted version string
metadata CHANGED
@@ -1,38 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: top4r
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.5
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 6
9
+ version: 0.1.6
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Nowa Zhu
9
- autorequire:
13
+ autorequire: top4r
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2011-09-21 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2011-11-15 00:00:00 +08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: json
16
- requirement: &2156016740 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 1
30
+ - 1
21
31
  version: 1.1.1
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2156016740
33
+ version_requirements: *id001
25
34
  description:
26
35
  email: nowazhu@gmail.com
27
- executables:
28
- - top4rsh
36
+ executables: []
37
+
29
38
  extensions: []
30
- extra_rdoc_files:
39
+
40
+ extra_rdoc_files:
31
41
  - README
32
42
  - CHANGES
33
43
  - TODO
34
44
  - MIT-LICENSE
35
- files:
45
+ files:
36
46
  - lib/top4r/client/base.rb
37
47
  - lib/top4r/client/item.rb
38
48
  - lib/top4r/client/shipping.rb
@@ -63,30 +73,37 @@ files:
63
73
  - CHANGES
64
74
  - TODO
65
75
  - MIT-LICENSE
66
- - bin/top4rsh
76
+ has_rdoc: true
67
77
  homepage: http://top4r.labs.nowa.me
68
78
  licenses: []
79
+
69
80
  post_install_message:
70
81
  rdoc_options: []
71
- require_paths:
82
+
83
+ require_paths:
72
84
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
79
- required_rubygems_version: !ruby/object:Gem::Requirement
80
- none: false
81
- requirements:
82
- - - ! '>='
83
- - !ruby/object:Gem::Version
84
- version: '0'
85
- requirements: []
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ segments:
90
+ - 1
91
+ - 8
92
+ - 2
93
+ version: 1.8.2
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ requirements:
102
+ - Ruby 1.8.4+
86
103
  rubyforge_project: top4r
87
- rubygems_version: 1.8.10
104
+ rubygems_version: 1.3.6
88
105
  signing_key:
89
106
  specification_version: 3
90
- summary: TOP4R is a library that can help you build plugin for TaoBao.com quickly
91
- in pure Ruby.
107
+ summary: TOP4R is a library that can help you build plugin for TaoBao.com quickly in pure Ruby.
92
108
  test_files: []
109
+
data/bin/top4rsh DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env ruby
2
-