bearcat 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a8cdd48888da3855a6f40366e2fd2ee23f6df40b
4
+ data.tar.gz: 980c5d8ea753e547eb244c5900b56725f7e7d6e1
5
+ SHA512:
6
+ metadata.gz: f714f00a9bd60b49ccc2c95920060a9cc2a1df45caf37ec3ebbdcc8e2ba1508b67e57d724faee5461b9381cdd879abe2a98049ac0f2bdb331383ad06bab25839
7
+ data.tar.gz: 54f05a2802a363c9581000a0a1055b6b77b6718289888f490a313f73cce7e96030f7545a668922accb97d4c7e1a7014a41d2be99c37a833607870077a9cf2a10
@@ -21,6 +21,7 @@ module Bearcat
21
21
  require 'bearcat/client/canvas_files'
22
22
  require 'bearcat/client/calendar_events'
23
23
  require 'bearcat/client/discussions'
24
+ require 'bearcat/client/search'
24
25
  require 'bearcat/client/quizzes'
25
26
 
26
27
  include Assignments
@@ -42,6 +43,7 @@ module Bearcat
42
43
  include CalendarEvents
43
44
  include Discussions
44
45
  include FileHelper
46
+ include Search
45
47
  include Quizzes
46
48
 
47
49
 
@@ -0,0 +1,11 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module Search
4
+
5
+ def find_recipients(params={})
6
+ get('/api/v1/conversations/find_recipients', params)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.0.1' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.0.2' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -15,7 +15,7 @@ describe Bearcat::Client::Accounts do
15
15
  it "returns enrollment terms for an account" do
16
16
  stub_get(@client, "/api/v1/accounts/1/terms").to_return(json_response("enrollment_terms.json"))
17
17
  account = @client.terms(1)
18
- terms = account['enrollment_terms']
18
+ terms = account.members
19
19
  terms.count.should == 1
20
20
  terms.first['id'].should == 4
21
21
  terms.first['name'].should == 'Term 1'
@@ -0,0 +1,16 @@
1
+ require 'helper'
2
+
3
+ describe Bearcat::Client::Search do
4
+ before do
5
+ @client = Bearcat::Client.new(prefix:"http://canvas.instructure.com", token: "test_token")
6
+ end
7
+
8
+ it "returns search results for recipients" do
9
+ stub_get(@client, "/api/v1/conversations/find_recipients?search=test").to_return(json_response("search_find_recipients.json"))
10
+ results = @client.find_recipients(:search => 'test')
11
+ results.first['name'].should == 'Test'
12
+ results.first['id'].should == 9
13
+ end
14
+
15
+
16
+ end
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "id": 9,
4
+ "name": "Test",
5
+ "avatar_url": "http://localhost:3000/images/messages/avatar-group-50.png",
6
+ "type": "context",
7
+ "user_count": 5,
8
+ "permissions": {}
9
+ }
10
+ ]
metadata CHANGED
@@ -1,110 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bearcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
4
+ version: 1.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nathan Mills, Jake Sorce
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.0.0
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.0.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: '2.6'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: '2.6'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: webmock
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: pry
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: footrest
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: 0.2.2
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: 0.2.2
110
97
  description: Ruby interface for interacting with the canvas API
@@ -116,7 +103,9 @@ extra_rdoc_files: []
116
103
  files:
117
104
  - Rakefile
118
105
  - bearcat.gemspec
106
+ - lib/bearcat.rb
119
107
  - lib/bearcat/api_array.rb
108
+ - lib/bearcat/client.rb
120
109
  - lib/bearcat/client/account_reports.rb
121
110
  - lib/bearcat/client/accounts.rb
122
111
  - lib/bearcat/client/assignments.rb
@@ -135,13 +124,11 @@ files:
135
124
  - lib/bearcat/client/outcomes.rb
136
125
  - lib/bearcat/client/quizzes.rb
137
126
  - lib/bearcat/client/reports.rb
127
+ - lib/bearcat/client/search.rb
138
128
  - lib/bearcat/client/sections.rb
139
- - lib/bearcat/client/sis_imports.rb
140
129
  - lib/bearcat/client/submissions.rb
141
130
  - lib/bearcat/client/users.rb
142
- - lib/bearcat/client.rb
143
131
  - lib/bearcat/version.rb
144
- - lib/bearcat.rb
145
132
  - spec/bearcat/client/accounts_spec.rb
146
133
  - spec/bearcat/client/assignments_spec.rb
147
134
  - spec/bearcat/client/calendar_events_spec.rb
@@ -158,6 +145,7 @@ files:
158
145
  - spec/bearcat/client/outcomes_spec.rb
159
146
  - spec/bearcat/client/quizzes_spec.rb
160
147
  - spec/bearcat/client/reports_spec.rb
148
+ - spec/bearcat/client/search_spec.rb
161
149
  - spec/bearcat/client/sections_spec.rb
162
150
  - spec/bearcat/client/submissions_spec.rb
163
151
  - spec/bearcat/client/users_spec.rb
@@ -218,6 +206,7 @@ files:
218
206
  - spec/fixtures/report_history.json
219
207
  - spec/fixtures/report_list.json
220
208
  - spec/fixtures/report_status.json
209
+ - spec/fixtures/search_find_recipients.json
221
210
  - spec/fixtures/section.json
222
211
  - spec/fixtures/section_enrollments.json
223
212
  - spec/fixtures/single_account.json
@@ -234,27 +223,26 @@ files:
234
223
  - spec/helper.rb
235
224
  homepage:
236
225
  licenses: []
226
+ metadata: {}
237
227
  post_install_message:
238
228
  rdoc_options: []
239
229
  require_paths:
240
230
  - lib
241
231
  required_ruby_version: !ruby/object:Gem::Requirement
242
- none: false
243
232
  requirements:
244
- - - ! '>='
233
+ - - ">="
245
234
  - !ruby/object:Gem::Version
246
235
  version: '0'
247
236
  required_rubygems_version: !ruby/object:Gem::Requirement
248
- none: false
249
237
  requirements:
250
- - - ! '>='
238
+ - - ">="
251
239
  - !ruby/object:Gem::Version
252
240
  version: '0'
253
241
  requirements: []
254
242
  rubyforge_project:
255
- rubygems_version: 1.8.23
243
+ rubygems_version: 2.2.2
256
244
  signing_key:
257
- specification_version: 3
245
+ specification_version: 4
258
246
  summary: Canvas API
259
247
  test_files:
260
248
  - spec/bearcat/client/accounts_spec.rb
@@ -273,6 +261,7 @@ test_files:
273
261
  - spec/bearcat/client/outcomes_spec.rb
274
262
  - spec/bearcat/client/quizzes_spec.rb
275
263
  - spec/bearcat/client/reports_spec.rb
264
+ - spec/bearcat/client/search_spec.rb
276
265
  - spec/bearcat/client/sections_spec.rb
277
266
  - spec/bearcat/client/submissions_spec.rb
278
267
  - spec/bearcat/client/users_spec.rb
@@ -333,6 +322,7 @@ test_files:
333
322
  - spec/fixtures/report_history.json
334
323
  - spec/fixtures/report_list.json
335
324
  - spec/fixtures/report_status.json
325
+ - spec/fixtures/search_find_recipients.json
336
326
  - spec/fixtures/section.json
337
327
  - spec/fixtures/section_enrollments.json
338
328
  - spec/fixtures/single_account.json
@@ -347,4 +337,3 @@ test_files:
347
337
  - spec/fixtures/user_page_views.json
348
338
  - spec/fixtures/user_profile.json
349
339
  - spec/helper.rb
350
- has_rdoc:
@@ -1,20 +0,0 @@
1
- module Bearcat
2
- class Client < Footrest::Client
3
- module SisImports
4
-
5
- def sis_imports(account, params = {})
6
- post("/api/v1/accounts/#{account}/sis_imports", params)
7
- end
8
-
9
- def get_sis_imports(account)
10
- binding.pry
11
- get("/api/v1/accounts/#{account}/sis_imports")
12
- end
13
-
14
- def import_status(account, import_id)
15
- get("/api/v1/accounts/#{account}/sis_imports/#{import_id}")
16
- end
17
-
18
- end
19
- end
20
- end