meducation_sdk 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/meducation_sdk.rb +1 -1
- data/lib/meducation_sdk/resources/{premium_tutorial.rb → collection_topic.rb} +7 -5
- data/lib/meducation_sdk/version.rb +1 -1
- data/test/resources/collection_topic_test.rb +15 -0
- metadata +7 -6
- data/test/resources/premium_tutorial_test.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3523ab619c1fb3b18096f1801ff62f8a61e51906
|
4
|
+
data.tar.gz: 879201230b70991fe95f6e7a9aa1466f78455187
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed849a56f7f10ba5fbd7edcd3a542211f7790310e715710a6f642dc21bfa72a040a9f08436dcbece3b15c5925bc53350af4709340fa42c0321d2bdc8ad1f7bb0
|
7
|
+
data.tar.gz: 1b1c94547e6187f986f92efed77f6757ebd4cd5dd3a72cf471b584551c5fb9b43ec9930445ee0cbb2adf16fe687080b8c8e72affcd390b9358784c13a6df7d91
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
#1.
|
1
|
+
# 1.2.0 / 2014-02-01
|
2
|
+
* [FEATURE] Add support for Collection Topics
|
3
|
+
* [FEATURE] Remove support for Premium Tutorials
|
4
|
+
|
5
|
+
# 1.1.2 / 2014-01-29
|
2
6
|
* [FEATURE] Adds views_in_last_30_days, views_in_last_60_days and usefulness to output
|
3
7
|
|
4
8
|
# 1.1.1 / 2014-01-24
|
data/lib/meducation_sdk.rb
CHANGED
@@ -6,6 +6,7 @@ require "meducation_sdk/configuration"
|
|
6
6
|
require "meducation_sdk/mocker"
|
7
7
|
|
8
8
|
RESOURCES = %w{
|
9
|
+
collection_topic
|
9
10
|
comment
|
10
11
|
community
|
11
12
|
community_membership
|
@@ -26,7 +27,6 @@ RESOURCES = %w{
|
|
26
27
|
mnemonic
|
27
28
|
notification
|
28
29
|
partner
|
29
|
-
premium_tutorial
|
30
30
|
syllabus_item
|
31
31
|
user
|
32
32
|
user_settings
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module MeducationSDK
|
2
|
-
class
|
3
|
-
self.path = "/
|
2
|
+
class CollectionTopic < Loquor::Resource
|
3
|
+
self.path = "/collection_topics"
|
4
4
|
|
5
5
|
def user
|
6
6
|
@user ||= User.find(user_id)
|
@@ -11,14 +11,16 @@ module MeducationSDK
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
class
|
14
|
+
class CollectionTopicMock < CollectionTopic
|
15
15
|
extend Loquor::ResourceMock
|
16
16
|
|
17
17
|
self.attributes = {
|
18
18
|
id: 1,
|
19
19
|
title: "Al's Medicine Tutorial",
|
20
|
-
|
21
|
-
|
20
|
+
comment_ids: [4,5,6],
|
21
|
+
rating: 10,
|
22
|
+
views_in_last_30_days: 30,
|
23
|
+
views_in_last_60_days: 60
|
22
24
|
}
|
23
25
|
end
|
24
26
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
require File.expand_path('../../resource_test', __FILE__)
|
3
|
+
|
4
|
+
module MeducationSDK
|
5
|
+
class CollectionTopicTest < ResourceTest
|
6
|
+
test_resource(CollectionTopic, '/collection_topics')
|
7
|
+
|
8
|
+
def test_comments_calls_sdk
|
9
|
+
topic = CollectionTopic.new(comment_ids: [7,8,9])
|
10
|
+
MeducationSDK::Comment.expects(:where).with(id: [7,8,9])
|
11
|
+
topic.comments
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meducation_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- lib/meducation_sdk.rb
|
113
113
|
- lib/meducation_sdk/configuration.rb
|
114
114
|
- lib/meducation_sdk/mocker.rb
|
115
|
+
- lib/meducation_sdk/resources/collection_topic.rb
|
115
116
|
- lib/meducation_sdk/resources/comment.rb
|
116
117
|
- lib/meducation_sdk/resources/community.rb
|
117
118
|
- lib/meducation_sdk/resources/community_membership.rb
|
@@ -132,7 +133,6 @@ files:
|
|
132
133
|
- lib/meducation_sdk/resources/mnemonic.rb
|
133
134
|
- lib/meducation_sdk/resources/notification.rb
|
134
135
|
- lib/meducation_sdk/resources/partner.rb
|
135
|
-
- lib/meducation_sdk/resources/premium_tutorial.rb
|
136
136
|
- lib/meducation_sdk/resources/syllabus_item.rb
|
137
137
|
- lib/meducation_sdk/resources/user.rb
|
138
138
|
- lib/meducation_sdk/resources/user_settings.rb
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- test/configuration_test.rb
|
143
143
|
- test/mocker_test.rb
|
144
144
|
- test/resource_test.rb
|
145
|
+
- test/resources/collection_topic_test.rb
|
145
146
|
- test/resources/comment_test.rb
|
146
147
|
- test/resources/community_membership_test.rb
|
147
148
|
- test/resources/community_test.rb
|
@@ -162,7 +163,6 @@ files:
|
|
162
163
|
- test/resources/mnemonic_test.rb
|
163
164
|
- test/resources/notification_test.rb
|
164
165
|
- test/resources/partner_test.rb
|
165
|
-
- test/resources/premium_tutorial_test.rb
|
166
166
|
- test/resources/syllabus_item_test.rb
|
167
167
|
- test/resources/user_settings_test.rb
|
168
168
|
- test/resources/user_test.rb
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
189
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.
|
190
|
+
rubygems_version: 2.1.9
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: The SDK for Meducation
|
@@ -196,6 +196,7 @@ test_files:
|
|
196
196
|
- test/configuration_test.rb
|
197
197
|
- test/mocker_test.rb
|
198
198
|
- test/resource_test.rb
|
199
|
+
- test/resources/collection_topic_test.rb
|
199
200
|
- test/resources/comment_test.rb
|
200
201
|
- test/resources/community_membership_test.rb
|
201
202
|
- test/resources/community_test.rb
|
@@ -216,8 +217,8 @@ test_files:
|
|
216
217
|
- test/resources/mnemonic_test.rb
|
217
218
|
- test/resources/notification_test.rb
|
218
219
|
- test/resources/partner_test.rb
|
219
|
-
- test/resources/premium_tutorial_test.rb
|
220
220
|
- test/resources/syllabus_item_test.rb
|
221
221
|
- test/resources/user_settings_test.rb
|
222
222
|
- test/resources/user_test.rb
|
223
223
|
- test/test_helper.rb
|
224
|
+
has_rdoc:
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.expand_path('../../test_helper', __FILE__)
|
2
|
-
require File.expand_path('../../resource_test', __FILE__)
|
3
|
-
|
4
|
-
module MeducationSDK
|
5
|
-
class PremiumTutorialTest < ResourceTest
|
6
|
-
test_resource(PremiumTutorial, '/premium_tutorials')
|
7
|
-
|
8
|
-
def test_user_calls_sdk
|
9
|
-
tutorial = PremiumTutorial.new(id: 2, user_id: 5)
|
10
|
-
MeducationSDK::User.expects(:find).with(5)
|
11
|
-
tutorial.user
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_comments_calls_sdk
|
15
|
-
tutorial = PremiumTutorial.new(comment_ids: [7,8,9])
|
16
|
-
MeducationSDK::Comment.expects(:where).with(id: [7,8,9])
|
17
|
-
tutorial.comments
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|