threetaps-client 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/client/posting_client.rb +2 -2
- data/lib/models/posting.rb +4 -3
- data/threetaps-client.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
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)
|
data/lib/models/posting.rb
CHANGED
@@ -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.
|
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
|
data/threetaps-client.gemspec
CHANGED
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:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 8
|
10
|
+
version: 1.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- 3taps.com
|