ringcentral_sdk 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b397469518faf248324c39e55e10d65ce93191e2
4
- data.tar.gz: b33aad360bf66be021dbb2a3a175befa196f8aea
3
+ metadata.gz: 95ea214f77faebf0d968b06c655e01eb6f2438df
4
+ data.tar.gz: 4f15d3dbe834d599bacb0ae0115d3972148ed496
5
5
  SHA512:
6
- metadata.gz: 2275f8a557e7fbb962c563fc04ed4184d1f5e8f1cab7dbf19ad2205fffc753ffd5bde343881bb919b81f200c9abd8ec76e43bbfff2b7753abe96d16018e522d2
7
- data.tar.gz: ca69cc1b1559f6582e5c2c60ea4b454e201573a9e7b05f29148286b815d4cdc4a83ab117854556f98c4d2ab2301c85d399da00f1f68c78686ba2d7cdbd825044
6
+ metadata.gz: 0f145704fcda7ad16687237c0e7e096c0de9c690543e1fdbc28b7b65cf0f86db5fa905857495f7bbd41f6c208f15c2dca6a983ff910f0dd0a6949b8b22457a88
7
+ data.tar.gz: 5a993b31c4c1e943fc54564411463eaee2e90288cf53039824ccdb4e2098ee2b8349e2eef68f8a75bad5f7243a87448447db462129802b6d3161faee73229791
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  CHANGELOG
2
2
  ---------
3
+ - **2015-08-29**: 0.1.3
4
+ - Add `platform.client` getter
3
5
  - **2015-05-31**: 0.1.2
4
6
  - Add Ruby 1.8.7 support
5
7
  - Add CI for Ruby 2.2.0 & 2.1.6: 2.2.2, 2.2.0, 2.1.6, 2.1.0, 2.0.0, 1.9.3, 1.8.7
data/README.md CHANGED
@@ -4,6 +4,7 @@ RingCentral SDK
4
4
  [![Gem Version](https://badge.fury.io/rb/ringcentral_sdk.svg)](http://badge.fury.io/rb/ringcentral_sdk)
5
5
  [![Build Status](https://img.shields.io/travis/grokify/ringcentral-sdk-ruby/master.svg)](https://travis-ci.org/grokify/ringcentral-sdk-ruby)
6
6
  [![Code Climate](https://codeclimate.com/github/grokify/ringcentral-sdk-ruby/badges/gpa.svg)](https://codeclimate.com/github/grokify/ringcentral-sdk-ruby)
7
+ [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/grokify/ringcentral-sdk-ruby/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/grokify/ringcentral-sdk-ruby/?branch=master)
7
8
  [![Coverage Status](https://coveralls.io/repos/grokify/ringcentral-sdk-ruby/badge.svg?branch=master)](https://coveralls.io/r/grokify/ringcentral-sdk-ruby?branch=master)
8
9
  [![Docs](https://img.shields.io/badge/docs-readthedocs-blue.svg)](http://ringcentral-sdk-ruby.readthedocs.org/)
9
10
  [![Docs](https://img.shields.io/badge/docs-rubydoc-blue.svg)](http://www.rubydoc.info/gems/ringcentral_sdk/)
@@ -37,9 +38,9 @@ This SDK is an early stage library and subject to breaking changes.
37
38
 
38
39
  ### Included
39
40
 
40
- * OAuth2 authorization & token refresh via INTRIDEA OAuth2::AccessToken
41
- * Generic API requests handled via Faraday client
42
- * Fax request helper to create multipart/mixed messages
41
+ * OAuth2 authorization & token refresh via INTRIDEA `OAuth2::AccessToken`
42
+ * Generic API requests handled via `Faraday` client
43
+ * Fax request helper to create `multipart/mixed` messages
43
44
  * Docs via [Read the Docs](http://ringcentral-sdk-ruby.readthedocs.org/) and [RubyDoc](http://www.rubydoc.info/gems/ringcentral_sdk/)
44
45
 
45
46
  ### To Do
@@ -188,6 +189,9 @@ end
188
189
 
189
190
  ## Change Log
190
191
 
192
+ - **2015-05-31**: 0.1.2
193
+ - Add Ruby 1.8.7 support
194
+ - Add CI for Ruby 2.2.0 & 2.1.6: 2.2.2, 2.2.0, 2.1.6, 2.1.0, 2.0.0, 1.9.3, 1.8.7
191
195
  - **2015-05-31**: 0.1.1
192
196
  - Add Ruby 2.2.2 support
193
197
  - **2015-05-31**: 0.1.0
data/VERSION.txt CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -71,13 +71,7 @@ module RingCentralSdk::Helpers
71
71
 
72
72
  def get_file_part(file_name=nil, content_type=nil, base64_encode=false)
73
73
 
74
- unless File.file?(file_name.to_s)
75
- raise "File \"#{file_name.to_s}\" does not exist or cannot be read"
76
- end
77
-
78
- file_bytes = RUBY_VERSION < '1.9' \
79
- ? File.open(file_name, 'rb') { |f| f.read } \
80
- : File.open(file_name, 'rb:BINARY') { |f| f.read }
74
+ file_bytes = get_file_bytes(file_name)
81
75
 
82
76
  file_part = base64_encode \
83
77
  ? MIME::Text.new(Base64.encode64(file_bytes)) \
@@ -90,6 +84,20 @@ module RingCentralSdk::Helpers
90
84
  return file_part
91
85
  end
92
86
 
87
+ def get_file_bytes(file_name=nil)
88
+
89
+ unless File.file?(file_name.to_s)
90
+ raise "File \"#{file_name.to_s}\" does not exist or cannot be read"
91
+ end
92
+
93
+ file_bytes = RUBY_VERSION < '1.9' \
94
+ ? File.open(file_name, 'rb') { |f| f.read } \
95
+ : File.open(file_name, 'rb:BINARY') { |f| f.read }
96
+
97
+ return file_bytes
98
+
99
+ end
100
+
93
101
  def get_file_content_type(file_name=nil, content_type=nil)
94
102
  return (content_type.is_a?(String) && content_type =~ /^[^\/\s]+\/[^\/\s]+/) \
95
103
  ? content_type : MIME::Types.type_for(file_name).first.content_type || 'application/octet-stream'
@@ -19,6 +19,8 @@ module RingCentralSdk::Platform
19
19
 
20
20
  attr_accessor :server_url
21
21
 
22
+ attr_reader :client
23
+
22
24
  def initialize(app_key='', app_secret='', server_url=RingCentralSdk::Sdk::RC_SERVER_SANDBOX)
23
25
 
24
26
  @app_key = app_key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ringcentral_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-31 00:00:00.000000000 Z
11
+ date: 2015-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday