threetaps-client 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.9
@@ -33,9 +33,9 @@ class PostingClient < Client
33
33
  def create_posting(postings)
34
34
  postings = [postings] unless postings.is_a? Array
35
35
  data = "["
36
- data << postings.collect{|posting| posting.to_json.gsub("%22","")}.join(',')
36
+ data << postings.collect{|posting| posting.to_json}.join(',')
37
37
  data << "]"
38
- params = "posts=#{data}"
38
+ params = "postings=#{data}"
39
39
  response = execute_post("/posting/create", params)
40
40
  CreateResponse.from_array(decode(response))
41
41
  end
@@ -46,14 +46,14 @@ class Posting < SuperModel::Base
46
46
  end
47
47
 
48
48
  def to_json
49
- posting = "{"+'source:'+"'#{self.source}'" + ',category:' + "'#{self.category}'" + ',location:' + "'#{self.location}'" + ',heading:' + "'#{CGI.escape self.heading.to_s[0,255].to_json}'"
49
+ posting = "{"+'source:'+"'#{self.source}'" + ',category:' + "'#{self.category}'" + ',location:' + "'#{self.location}'" + ',heading:' + "'#{CGI.escape self.heading.to_s[0,254]}'"
50
50
  if self.timestamp
51
51
  posting << ",timestamp: '#{(self.timestamp.utc.to_s(:db)).gsub(/\s/,"+").gsub("-","/")}'"
52
52
  else
53
53
  posting << ",timestamp: '#{(Time.now.utc.to_s(:db)).gsub(/\s/,"+").gsub("-","/")}'"
54
54
  end
55
55
  posting << ',images:' + "[#{images.collect{ |image| "'#{image}'"}.join(',')}]"
56
- posting << ',body:' + "'#{CGI.escape self.body.to_json}'" unless self.body.blank?
56
+ posting << ',body:' + "'#{CGI.escape self.body}'" unless self.body.blank?
57
57
  posting << ',price:' + "#{self.price.to_f}"
58
58
  posting << ',currency:' + "'#{self.currency}'"
59
59
  posting << ',accountName:' + "'#{self.accountName}'"
@@ -70,12 +70,12 @@ class Posting < SuperModel::Base
70
70
 
71
71
  def to_json_for_update
72
72
  data = "['#{self.postKey}',"
73
- data << "{heading:"+ "'#{CGI.escape self.heading.to_json}'" unless self.heading.blank?
73
+ data << "{heading:"+ "'#{CGI.escape self.heading}'" unless self.heading.blank?
74
74
  data << ",images:" + "[#{images.collect{ |image| "'#{image}'"}.join(',')}]"
75
75
  data << ",source:'#{self.source}'" unless self.source.blank?
76
76
  data << ",category:'#{self.category}'" unless self.category.blank?
77
77
  data << ",location:'#{self.location}'" unless self.location.blank?
78
- data << ",body:" + "'#{CGI.escape self.body.to_json}'" unless self.body.blank?
78
+ data << ",body:" + "'#{CGI.escape self.body}'" unless self.body.blank?
79
79
  data << ',price:' + "'#{self.price}'"
80
80
  data << ',currency:' + "'#{self.currency}'"
81
81
  data << ',accountName:' + "'#{self.accountName}'"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{threetaps-client}
8
- s.version = "1.0.8"
8
+ s.version = "1.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["3taps.com"]
12
- s.date = %q{2011-04-19}
12
+ s.date = %q{2011-04-20}
13
13
  s.description = %q{A Ruby gem for accessing the 3taps API. See more at http://developers.3taps.net}
14
14
  s.email = %q{developers@3taps.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threetaps-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 8
10
- version: 1.0.8
9
+ - 9
10
+ version: 1.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - 3taps.com
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-19 00:00:00 Z
18
+ date: 2011-04-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  requirement: &id001 !ruby/object:Gem::Requirement