threetaps-client 1.0.7 → 1.0.8

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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.7
1
+ 1.0.8
@@ -33,7 +33,7 @@ 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}.join(',')
36
+ data << postings.collect{|posting| posting.to_json.gsub("%22","")}.join(',')
37
37
  data << "]"
38
38
  params = "posts=#{data}"
39
39
  response = execute_post("/posting/create", params)
@@ -52,7 +52,7 @@ class PostingClient < Client
52
52
  def update_posting(postings)
53
53
  postings = [postings] unless postings.is_a? Array
54
54
  data = "["
55
- data << postings.collect{|posting| posting.to_json_for_update}.join(',')
55
+ data << postings.collect{|posting| posting.to_json_for_update.gsub("%22","")}.join(',')
56
56
  data << "]"
57
57
  params = "data=#{data}"
58
58
  response = execute_post("posting/update", params)
@@ -48,12 +48,12 @@ class Posting < SuperModel::Base
48
48
  def to_json
49
49
  posting = "{"+'source:'+"'#{self.source}'" + ',category:' + "'#{self.category}'" + ',location:' + "'#{self.location}'" + ',heading:' + "'#{CGI.escape self.heading.to_s[0,255].to_json}'"
50
50
  if self.timestamp
51
- posting << ",timestamp: '#{(self.timestamp.utc.to_s(:db)).gsub(/\s/,"+")}'"
51
+ posting << ",timestamp: '#{(self.timestamp.utc.to_s(:db)).gsub(/\s/,"+").gsub("-","/")}'"
52
52
  else
53
- posting << ",timestamp: '#{(Time.now.utc.to_s(:db)).gsub(/\s/,"+")}'"
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.gsub!("\"","").to_json}'" unless self.body.blank?
56
+ posting << ',body:' + "'#{CGI.escape self.body.to_json}'" unless self.body.blank?
57
57
  posting << ',price:' + "#{self.price.to_f}"
58
58
  posting << ',currency:' + "'#{self.currency}'"
59
59
  posting << ',accountName:' + "'#{self.accountName}'"
@@ -89,6 +89,7 @@ class Posting < SuperModel::Base
89
89
  end
90
90
  data << "}"
91
91
  data << "]"
92
+ data.gsub()
92
93
  end
93
94
 
94
95
  def to_json_for_status
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{threetaps-client}
8
- s.version = "1.0.7"
8
+ s.version = "1.0.8"
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"]
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: 25
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 7
10
- version: 1.0.7
9
+ - 8
10
+ version: 1.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - 3taps.com