nylas 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/restful_model.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  require 'time_attr_accessor'
2
2
  require 'parameters'
3
3
 
4
- module Inbox
4
+ module Nylas
5
5
  class RestfulModel
6
- extend Inbox::TimeAttrAccessor
7
- include Inbox::Parameters
6
+ extend Nylas::TimeAttrAccessor
7
+ include Nylas::Parameters
8
8
 
9
9
  parameter :id
10
10
  parameter :account_id
@@ -17,7 +17,7 @@ module Inbox
17
17
  end
18
18
 
19
19
  def initialize(api, account_id = nil)
20
- raise StandardError.new unless api.class <= Inbox::API
20
+ raise StandardError.new unless api.class <= Nylas::API
21
21
  @account_id = account_id
22
22
  @_api = api
23
23
  end
@@ -65,7 +65,7 @@ module Inbox
65
65
 
66
66
  ::RestClient.send(http_method, self.url(action), data.to_json, :content_type => :json, :params => params) do |response, request, result|
67
67
  unless http_method == 'delete'
68
- json = Inbox.interpret_response(result, response, :expected_class => Object)
68
+ json = Nylas.interpret_response(result, response, :expected_class => Object)
69
69
  inflate(json)
70
70
  end
71
71
  end
@@ -73,8 +73,8 @@ module Inbox
73
73
  end
74
74
 
75
75
  def destroy(params = {})
76
- ::RestClient.send('delete', self.url, :params => params) do |response, request|
77
- Inbox.interpret_http_status(response)
76
+ ::RestClient.send('delete', self.url, :params => params) do |response, request, result|
77
+ Nylas.interpret_response(result, response, {:raw_response => true})
78
78
  end
79
79
  end
80
80
 
@@ -1,12 +1,12 @@
1
1
  require 'restful_model'
2
2
 
3
- module Inbox
3
+ module Nylas
4
4
  class RestfulModelCollection
5
5
 
6
6
  attr_accessor :filters
7
7
 
8
8
  def initialize(model_class, api, filters = {})
9
- raise StandardError.new unless api.class <= Inbox::API
9
+ raise StandardError.new unless api.class <= Nylas::API
10
10
  @model_class = model_class
11
11
  @filters = filters
12
12
  @_api = api
@@ -30,7 +30,7 @@ module Inbox
30
30
 
31
31
  def count
32
32
  RestClient.get(url, params: @filters.merge(view: 'count')) { |response,request,result|
33
- json = Inbox.interpret_response(result, response)
33
+ json = Nylas.interpret_response(result, response)
34
34
  return json['count']
35
35
  }
36
36
  end
@@ -125,7 +125,7 @@ module Inbox
125
125
  model = nil
126
126
 
127
127
  RestClient.get("#{url}/#{id}"){ |response,request,result|
128
- json = Inbox.interpret_response(result, response, {:expected_class => Object})
128
+ json = Nylas.interpret_response(result, response, {:expected_class => Object})
129
129
  if @model_class < RestfulModel
130
130
  model = @model_class.new(@_api)
131
131
  model.inflate(json)
@@ -143,7 +143,7 @@ module Inbox
143
143
  models = []
144
144
 
145
145
  RestClient.get(url, :params => filters){ |response,request,result|
146
- items = Inbox.interpret_response(result, response, {:expected_class => Array})
146
+ items = Nylas.interpret_response(result, response, {:expected_class => Array})
147
147
  models = inflate_collection(items)
148
148
  }
149
149
  models
@@ -1,4 +1,4 @@
1
- module Inbox
1
+ module Nylas
2
2
  module TimeAttrAccessor
3
3
  def time_attr_accessor(attr)
4
4
  parameter attr
@@ -9,4 +9,4 @@ module Inbox
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
- module Inbox
2
- VERSION = "2.0.1"
1
+ module Nylas
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,206 +1,253 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nylas
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Gotow
8
8
  - Karim Hamidou
9
9
  - Jennie Lees
10
+ - Michael Pfister
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2016-02-12 00:00:00.000000000 Z
14
+ date: 2016-11-04 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rest-client
17
18
  requirement: !ruby/object:Gem::Requirement
18
19
  requirements:
19
- - - ~>
20
+ - - "~>"
20
21
  - !ruby/object:Gem::Version
21
22
  version: '1.6'
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
26
  requirements:
26
- - - ~>
27
+ - - "~>"
27
28
  - !ruby/object:Gem::Version
28
29
  version: '1.6'
29
30
  - !ruby/object:Gem::Dependency
30
31
  name: yajl-ruby
31
32
  requirement: !ruby/object:Gem::Requirement
32
33
  requirements:
33
- - - '>='
34
+ - - ">="
34
35
  - !ruby/object:Gem::Version
35
- version: '0'
36
+ version: 1.2.1
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.2'
36
40
  type: :runtime
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
39
43
  requirements:
40
- - - '>='
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.2.1
47
+ - - "~>"
41
48
  - !ruby/object:Gem::Version
42
- version: '0'
49
+ version: '1.2'
43
50
  - !ruby/object:Gem::Dependency
44
51
  name: em-http-request
45
52
  requirement: !ruby/object:Gem::Requirement
46
53
  requirements:
47
- - - '>='
54
+ - - ">="
48
55
  - !ruby/object:Gem::Version
49
- version: '0'
56
+ version: 1.1.3
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.1'
50
60
  type: :runtime
51
61
  prerelease: false
52
62
  version_requirements: !ruby/object:Gem::Requirement
53
63
  requirements:
54
- - - '>='
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 1.1.3
67
+ - - "~>"
55
68
  - !ruby/object:Gem::Version
56
- version: '0'
69
+ version: '1.1'
57
70
  - !ruby/object:Gem::Dependency
58
71
  name: rspec
59
72
  requirement: !ruby/object:Gem::Requirement
60
73
  requirements:
61
- - - '>='
74
+ - - ">="
62
75
  - !ruby/object:Gem::Version
63
- version: '0'
76
+ version: 3.5.0
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '3.5'
64
80
  type: :development
65
81
  prerelease: false
66
82
  version_requirements: !ruby/object:Gem::Requirement
67
83
  requirements:
68
- - - '>='
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 3.5.0
87
+ - - "~>"
69
88
  - !ruby/object:Gem::Version
70
- version: '0'
89
+ version: '3.5'
71
90
  - !ruby/object:Gem::Dependency
72
91
  name: shoulda
73
92
  requirement: !ruby/object:Gem::Requirement
74
93
  requirements:
75
- - - '>='
94
+ - - ">="
76
95
  - !ruby/object:Gem::Version
77
- version: '0'
96
+ version: 3.4.0
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '3.5'
78
100
  type: :development
79
101
  prerelease: false
80
102
  version_requirements: !ruby/object:Gem::Requirement
81
103
  requirements:
82
- - - '>='
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 3.4.0
107
+ - - "~>"
83
108
  - !ruby/object:Gem::Version
84
- version: '0'
109
+ version: '3.5'
85
110
  - !ruby/object:Gem::Dependency
86
111
  name: rdoc
87
112
  requirement: !ruby/object:Gem::Requirement
88
113
  requirements:
89
- - - ~>
114
+ - - "~>"
90
115
  - !ruby/object:Gem::Version
91
116
  version: '3.12'
92
117
  type: :development
93
118
  prerelease: false
94
119
  version_requirements: !ruby/object:Gem::Requirement
95
120
  requirements:
96
- - - ~>
121
+ - - "~>"
97
122
  - !ruby/object:Gem::Version
98
123
  version: '3.12'
99
124
  - !ruby/object:Gem::Dependency
100
125
  name: bundler
101
126
  requirement: !ruby/object:Gem::Requirement
102
127
  requirements:
103
- - - '>='
128
+ - - ">="
104
129
  - !ruby/object:Gem::Version
105
130
  version: 1.3.5
131
+ - - "~>"
132
+ - !ruby/object:Gem::Version
133
+ version: '1.3'
106
134
  type: :development
107
135
  prerelease: false
108
136
  version_requirements: !ruby/object:Gem::Requirement
109
137
  requirements:
110
- - - '>='
138
+ - - ">="
111
139
  - !ruby/object:Gem::Version
112
140
  version: 1.3.5
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '1.3'
113
144
  - !ruby/object:Gem::Dependency
114
145
  name: jeweler
115
146
  requirement: !ruby/object:Gem::Requirement
116
147
  requirements:
117
- - - ~>
148
+ - - ">="
118
149
  - !ruby/object:Gem::Version
119
- version: 1.8.4
150
+ version: 2.1.2
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '2.1'
120
154
  type: :development
121
155
  prerelease: false
122
156
  version_requirements: !ruby/object:Gem::Requirement
123
157
  requirements:
124
- - - ~>
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 2.1.2
161
+ - - "~>"
125
162
  - !ruby/object:Gem::Version
126
- version: 1.8.4
163
+ version: '2.1'
127
164
  - !ruby/object:Gem::Dependency
128
165
  name: pry
129
166
  requirement: !ruby/object:Gem::Requirement
130
167
  requirements:
131
- - - '>='
168
+ - - "~>"
132
169
  - !ruby/object:Gem::Version
133
- version: '0'
170
+ version: 0.10.4
134
171
  type: :development
135
172
  prerelease: false
136
173
  version_requirements: !ruby/object:Gem::Requirement
137
174
  requirements:
138
- - - '>='
175
+ - - "~>"
139
176
  - !ruby/object:Gem::Version
140
- version: '0'
177
+ version: 0.10.4
141
178
  - !ruby/object:Gem::Dependency
142
179
  name: pry-nav
143
180
  requirement: !ruby/object:Gem::Requirement
144
181
  requirements:
145
- - - '>='
182
+ - - "~>"
146
183
  - !ruby/object:Gem::Version
147
- version: '0'
184
+ version: 0.2.4
148
185
  type: :development
149
186
  prerelease: false
150
187
  version_requirements: !ruby/object:Gem::Requirement
151
188
  requirements:
152
- - - '>='
189
+ - - "~>"
153
190
  - !ruby/object:Gem::Version
154
- version: '0'
191
+ version: 0.2.4
155
192
  - !ruby/object:Gem::Dependency
156
193
  name: pry-stack_explorer
157
194
  requirement: !ruby/object:Gem::Requirement
158
195
  requirements:
159
- - - '>='
196
+ - - "~>"
160
197
  - !ruby/object:Gem::Version
161
- version: '0'
198
+ version: 0.4.9.2
162
199
  type: :development
163
200
  prerelease: false
164
201
  version_requirements: !ruby/object:Gem::Requirement
165
202
  requirements:
166
- - - '>='
203
+ - - "~>"
167
204
  - !ruby/object:Gem::Version
168
- version: '0'
205
+ version: 0.4.9.2
169
206
  - !ruby/object:Gem::Dependency
170
207
  name: webmock
171
208
  requirement: !ruby/object:Gem::Requirement
172
209
  requirements:
173
- - - '>='
210
+ - - ">="
174
211
  - !ruby/object:Gem::Version
175
- version: '0'
212
+ version: 2.1.0
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '2.1'
176
216
  type: :development
177
217
  prerelease: false
178
218
  version_requirements: !ruby/object:Gem::Requirement
179
219
  requirements:
180
- - - '>='
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 2.1.0
223
+ - - "~>"
181
224
  - !ruby/object:Gem::Version
182
- version: '0'
225
+ version: '2.1'
183
226
  - !ruby/object:Gem::Dependency
184
227
  name: sinatra
185
228
  requirement: !ruby/object:Gem::Requirement
186
229
  requirements:
187
- - - '>='
230
+ - - ">="
188
231
  - !ruby/object:Gem::Version
189
- version: '0'
232
+ version: 1.4.7
233
+ - - "~>"
234
+ - !ruby/object:Gem::Version
235
+ version: '1.4'
190
236
  type: :development
191
237
  prerelease: false
192
238
  version_requirements: !ruby/object:Gem::Requirement
193
239
  requirements:
194
- - - '>='
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: 1.4.7
243
+ - - "~>"
195
244
  - !ruby/object:Gem::Version
196
- version: '0'
245
+ version: '1.4'
197
246
  description: Gem for interacting with the Nylas API.
198
- email: ben@nylas.com
247
+ email: support@nylas.com
199
248
  executables: []
200
249
  extensions: []
201
- extra_rdoc_files:
202
- - LICENSE.txt
203
- - README.md
250
+ extra_rdoc_files: []
204
251
  files:
205
252
  - lib/account.rb
206
253
  - lib/api_account.rb
@@ -211,7 +258,6 @@ files:
211
258
  - lib/event.rb
212
259
  - lib/file.rb
213
260
  - lib/folder.rb
214
- - lib/inbox.rb
215
261
  - lib/label.rb
216
262
  - lib/message.rb
217
263
  - lib/mixins.rb
@@ -221,8 +267,6 @@ files:
221
267
  - lib/restful_model_collection.rb
222
268
  - lib/time_attr_accessor.rb
223
269
  - lib/version.rb
224
- - LICENSE.txt
225
- - README.md
226
270
  homepage: http://github.com/nylas/nylas-ruby
227
271
  licenses:
228
272
  - MIT
@@ -233,17 +277,17 @@ require_paths:
233
277
  - lib
234
278
  required_ruby_version: !ruby/object:Gem::Requirement
235
279
  requirements:
236
- - - '>='
280
+ - - ">="
237
281
  - !ruby/object:Gem::Version
238
282
  version: '0'
239
283
  required_rubygems_version: !ruby/object:Gem::Requirement
240
284
  requirements:
241
- - - '>='
285
+ - - ">="
242
286
  - !ruby/object:Gem::Version
243
287
  version: '0'
244
288
  requirements: []
245
289
  rubyforge_project:
246
- rubygems_version: 2.0.14
290
+ rubygems_version: 2.6.6
247
291
  signing_key:
248
292
  specification_version: 4
249
293
  summary: Gem for interacting with the Nylas API
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
- ----
3
-
4
- Copyright (c) 2014 InboxApp, Inc. and Contributors
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in
14
- all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- THE SOFTWARE.