Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
PATH
remote: .
specs:
ZCRMSDK (0.1.0)
json (~> 1.8)
ZCRMSDK (1.0.1)
json (~> 2.2)
multipart-post (~> 2.0)
rest-client (~> 2.0)

GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.3)
domain_name (0.5.20180417)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
json (1.8.3.1)
mime-types (3.2.2)
json (2.2.0)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mime-types-data (3.2019.1009)
multipart-post (2.1.1)
mysql2 (0.5.2)
netrc (0.11.0)
rake (10.5.0)
rest-client (2.0.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
Expand All @@ -48,6 +51,7 @@ PLATFORMS
DEPENDENCIES
ZCRMSDK!
bundler (~> 2.0)
mysql2 (~> 0.5.2)
rake (~> 10.0)
rspec (~> 3.0)

Expand Down
2 changes: 1 addition & 1 deletion ZCRMSDK.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_runtime_dependency 'multipart-post', '~> 2.0'
spec.add_runtime_dependency 'rest-client', '~> 2.0'
spec.add_runtime_dependency 'json', '~> 1.8'
spec.add_runtime_dependency 'json', '~> 2.2'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'mysql2', '~> 0.5.2'
Expand Down
5 changes: 3 additions & 2 deletions lib/ZCRMSDK/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def save_oauth_tokens(oauth_tokens)
file_obj.close
arr = Marshal.load(serialized) unless serialized.nil? || serialized.empty?
arr.push(oauth_tokens)
file_obj = File.open(path, 'w+')
file_obj.write(Marshal.dump(arr))
marshalled_tokens = Marshal.dump(arr)
file_obj = File.open(path, "w:#{marshalled_tokens.encoding.to_s}")
file_obj.write(marshalled_tokens)
file_obj.close
end

Expand Down
7 changes: 7 additions & 0 deletions lib/ZCRMSDK/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ def initialize(url, status_code, err_message, exception_code = 'error', details
def self.get_instance(url, status_code, err_message, exception_code = 'error', details = nil, content = nil)
ZCRMException.new(url, status_code, err_message, exception_code, details, content)
end

def to_s
"#{self.class}\n#{exception.url}\n#{exception.status_code}"\
"- #{exception.error_message}\n"\
"#{exception.exception_code}\n#{error_details}\n#{error_content}"
end

end
end
end
2 changes: 1 addition & 1 deletion lib/ZCRMSDK/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ZCRMSDK
VERSION = '1.0.0'
VERSION = '1.0.2'
end