socialcastr 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/socialcastr/user.rb +7 -0
- data/lib/socialcastr/version.rb +1 -1
- data/lib/socialcastr.rb +1 -0
- data/spec/fixtures/user.xml +151 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/user_spec.rb +17 -0
- metadata +17 -12
data/lib/socialcastr/version.rb
CHANGED
data/lib/socialcastr.rb
CHANGED
@@ -0,0 +1,151 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<user>
|
3
|
+
<type>User</type>
|
4
|
+
<status-message>
|
5
|
+
<editable type="boolean">true</editable>
|
6
|
+
<ratings-count nil="true"></ratings-count>
|
7
|
+
<player-url nil="true"></player-url>
|
8
|
+
<media-files type="array"/>
|
9
|
+
<comments type="array"/>
|
10
|
+
<message-type>status_message</message-type>
|
11
|
+
<in-reply-to nil="true"></in-reply-to>
|
12
|
+
<deletable type="boolean">true</deletable>
|
13
|
+
<likes type="array"/>
|
14
|
+
<permalink-url>https://demo.socialcast.com/messages/234-getting-coffee</permalink-url>
|
15
|
+
<last-interacted-at type="integer">1219406580</last-interacted-at>
|
16
|
+
<icon>https://ne.wac.edgecastcdn.net/801245/demo-assets1.socialcast.com/images/icons/messages/status_message.png</icon>
|
17
|
+
<embed nil="true"></embed>
|
18
|
+
<source nil="true"></source>
|
19
|
+
<likable type="boolean">false</likable>
|
20
|
+
<player-params nil="true"></player-params>
|
21
|
+
<tags type="array"/>
|
22
|
+
<url>https://demo.socialcast.com/api/messages/234-getting-coffee</url>
|
23
|
+
<user>
|
24
|
+
<type>User</type>
|
25
|
+
<terminated type="boolean">false</terminated>
|
26
|
+
<username>EmilyJames</username>
|
27
|
+
<url>https://demo.socialcast.com/users/emilyjames</url>
|
28
|
+
<role>member</role>
|
29
|
+
<inactive type="boolean">false</inactive>
|
30
|
+
<name>Emily James</name>
|
31
|
+
<id type="integer">25</id>
|
32
|
+
<avatars>
|
33
|
+
<square70>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square70.jpg</square70>
|
34
|
+
<square140>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square140.jpg</square140>
|
35
|
+
<square45>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square45.jpg</square45>
|
36
|
+
<square16>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square16.jpg</square16>
|
37
|
+
<square30>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square30.jpg</square30>
|
38
|
+
</avatars>
|
39
|
+
</user>
|
40
|
+
<subscribed type="boolean">false</subscribed>
|
41
|
+
<rating nil="true"></rating>
|
42
|
+
<category-id nil="true"></category-id>
|
43
|
+
<external-resources type="array"/>
|
44
|
+
<comments-count type="integer">0</comments-count>
|
45
|
+
<updated-at>2011-10-24T14:37:34-07:00</updated-at>
|
46
|
+
<title>getting coffee...</title>
|
47
|
+
<new-group-id nil="true"></new-group-id>
|
48
|
+
<watch nil="true"></watch>
|
49
|
+
<external-url nil="true"></external-url>
|
50
|
+
<body></body>
|
51
|
+
<hidden type="boolean">false</hidden>
|
52
|
+
<ratings-average nil="true"></ratings-average>
|
53
|
+
<recipients type="array"/>
|
54
|
+
<group>
|
55
|
+
</group>
|
56
|
+
<contains-url-only nil="true"></contains-url-only>
|
57
|
+
<extensions type="array"/>
|
58
|
+
<groups type="array"/>
|
59
|
+
<target-user nil="true"></target-user>
|
60
|
+
<attachments type="array"/>
|
61
|
+
<likes-count type="integer">0</likes-count>
|
62
|
+
<verb nil="true"></verb>
|
63
|
+
<poll nil="true"></poll>
|
64
|
+
<flag nil="true"></flag>
|
65
|
+
<thumbnail-url nil="true"></thumbnail-url>
|
66
|
+
<created-at>2011-10-24T14:12:35-07:00</created-at>
|
67
|
+
<id type="integer">234</id>
|
68
|
+
<watchable type="boolean">false</watchable>
|
69
|
+
<ratable type="boolean">false</ratable>
|
70
|
+
<action></action>
|
71
|
+
</status-message>
|
72
|
+
<terminated type="boolean">false</terminated>
|
73
|
+
<followers-count type="integer">14</followers-count>
|
74
|
+
<username>EmilyJames</username>
|
75
|
+
<kudos-points type="integer">0</kudos-points>
|
76
|
+
<url>https://demo.socialcast.com/users/emilyjames</url>
|
77
|
+
<kudos-sent-count type="integer">0</kudos-sent-count>
|
78
|
+
<title>Marketing Assistant</title>
|
79
|
+
<role>member</role>
|
80
|
+
<manager>
|
81
|
+
<type>User</type>
|
82
|
+
<terminated type="boolean">false</terminated>
|
83
|
+
<username>StaceyLynch</username>
|
84
|
+
<url>https://demo.socialcast.com/users/staceylynch</url>
|
85
|
+
<role>member</role>
|
86
|
+
<title>Director of Sales</title>
|
87
|
+
<inactive type="boolean">false</inactive>
|
88
|
+
<name>Stacey Lynch</name>
|
89
|
+
<id type="integer">30</id>
|
90
|
+
<avatars>
|
91
|
+
<square140>https://ne.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/78/iStock_000005807416XSmall_square140.jpg</square140>
|
92
|
+
<square70>https://ne.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/78/iStock_000005807416XSmall_square70.jpg</square70>
|
93
|
+
<square45>https://ne.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/78/iStock_000005807416XSmall_square45.jpg</square45>
|
94
|
+
<square16>https://ne.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/78/iStock_000005807416XSmall_square16.jpg</square16>
|
95
|
+
<square30>https://ne.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/78/iStock_000005807416XSmall_square30.jpg</square30>
|
96
|
+
</avatars>
|
97
|
+
</manager>
|
98
|
+
<inactive type="boolean">false</inactive>
|
99
|
+
<contact-info>
|
100
|
+
<aim>emilytime</aim>
|
101
|
+
<yahoo>emilytimes12</yahoo>
|
102
|
+
<msn>emily@msn.com</msn>
|
103
|
+
<jabber>emily@socialcast.jabber.com</jabber>
|
104
|
+
<email>emily@socialcast.com</email>
|
105
|
+
<google-talk>emily@demo.socialcast.com</google-talk>
|
106
|
+
<cell-phone>949 555 6686</cell-phone>
|
107
|
+
<skype>emily_james</skype>
|
108
|
+
<location>Tustin, CA</location>
|
109
|
+
<office-phone>949 555 6685</office-phone>
|
110
|
+
</contact-info>
|
111
|
+
<name>Emily James</name>
|
112
|
+
<custom-fields type="array">
|
113
|
+
<custom-field>
|
114
|
+
<value>I currently assist the VP of Marketing in making sure that all marketing related activites are rolled out properly in the Americas market.</value>
|
115
|
+
<label>Job Description</label>
|
116
|
+
<id type="symbol">resume</id>
|
117
|
+
</custom-field>
|
118
|
+
<custom-field>
|
119
|
+
<value>Event planning, attending conferences, social media, international marketing , working out, reading, soccer, skiing, Europe, redecorating</value>
|
120
|
+
<label>Passions</label>
|
121
|
+
<id type="symbol">passions</id>
|
122
|
+
</custom-field>
|
123
|
+
<custom-field>
|
124
|
+
<value>Headquarters</value>
|
125
|
+
<label>Business Unit</label>
|
126
|
+
<id type="symbol">business_unit</id>
|
127
|
+
</custom-field>
|
128
|
+
<custom-field>
|
129
|
+
<value>Marketing</value>
|
130
|
+
<label>Department</label>
|
131
|
+
<id type="symbol">department</id>
|
132
|
+
</custom-field>
|
133
|
+
<custom-field>
|
134
|
+
<value>Marketing Assistant</value>
|
135
|
+
<label>Title</label>
|
136
|
+
<id type="symbol">title</id>
|
137
|
+
</custom-field>
|
138
|
+
</custom-fields>
|
139
|
+
<id type="integer">25</id>
|
140
|
+
<followable type="boolean">false</followable>
|
141
|
+
<avatars>
|
142
|
+
<square140>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square140.jpg</square140>
|
143
|
+
<square70>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square70.jpg</square70>
|
144
|
+
<square45>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square45.jpg</square45>
|
145
|
+
<square16>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square16.jpg</square16>
|
146
|
+
<square30>https://gp1.wac.edgecastcdn.net/801245/socialcast-demo.s3.amazonaws.com/tenants/5/profile_photos/50/iStock_000002766836XSmall_square30.jpg</square30>
|
147
|
+
</avatars>
|
148
|
+
<contact-id nil="true"></contact-id>
|
149
|
+
<following-count type="integer">13</following-count>
|
150
|
+
</user>
|
151
|
+
|
data/spec/spec_helper.rb
CHANGED
@@ -41,6 +41,8 @@ def fake_socialcast_api_for(type, &block)
|
|
41
41
|
responsefile = "message.xml"
|
42
42
|
when :messages
|
43
43
|
responsefile = "messages.xml"
|
44
|
+
when :user
|
45
|
+
responsefile = "user.xml"
|
44
46
|
end
|
45
47
|
response = File.read(File.join(File.dirname(__FILE__), 'fixtures', responsefile))
|
46
48
|
endpoint = generate_fake_endpoint(response)
|
data/spec/user_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Socialcastr::User do
|
4
|
+
describe '.search' do
|
5
|
+
context 'when passed a valid email' do
|
6
|
+
before :each do
|
7
|
+
fake_socialcast_api_for(:user)
|
8
|
+
end
|
9
|
+
it "should return a user object" do
|
10
|
+
Socialcastr::User.search("emily@socialcast.com").class.should == Socialcastr::User
|
11
|
+
end
|
12
|
+
it "should return a well parsed user " do
|
13
|
+
Socialcastr::User.search("emily@socialcast.com").name.should == "Emily James"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcastr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-25 00:00:00.000000000 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
17
|
-
requirement: &
|
17
|
+
requirement: &2152829280 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0.8'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2152829280
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
-
requirement: &
|
28
|
+
requirement: &2152965860 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '2.5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2152965860
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: yard
|
39
|
-
requirement: &
|
39
|
+
requirement: &2153016820 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2153016820
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: artifice
|
50
|
-
requirement: &
|
50
|
+
requirement: &2153159100 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2153159100
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: nokogiri
|
61
|
-
requirement: &
|
61
|
+
requirement: &2153190600 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
version: 1.4.4
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2153190600
|
70
70
|
description: A Ruby wrapper for the Socialcast REST API
|
71
71
|
email:
|
72
72
|
- bru@codewitch.org
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- lib/socialcastr/like.rb
|
93
93
|
- lib/socialcastr/message.rb
|
94
94
|
- lib/socialcastr/sax/active_resource.rb
|
95
|
+
- lib/socialcastr/user.rb
|
95
96
|
- lib/socialcastr/version.rb
|
96
97
|
- socialcastr.gemspec
|
97
98
|
- spec/api_spec.rb
|
@@ -101,10 +102,12 @@ files:
|
|
101
102
|
- spec/fixtures/demo_config.yml
|
102
103
|
- spec/fixtures/message.xml
|
103
104
|
- spec/fixtures/messages.xml
|
105
|
+
- spec/fixtures/user.xml
|
104
106
|
- spec/message_spec.rb
|
105
107
|
- spec/sax/active_resource_spec.rb
|
106
108
|
- spec/socialcastr_spec.rb
|
107
109
|
- spec/spec_helper.rb
|
110
|
+
- spec/user_spec.rb
|
108
111
|
has_rdoc: true
|
109
112
|
homepage: https://github.com/bru/socialcastr
|
110
113
|
licenses: []
|
@@ -140,7 +143,9 @@ test_files:
|
|
140
143
|
- spec/fixtures/demo_config.yml
|
141
144
|
- spec/fixtures/message.xml
|
142
145
|
- spec/fixtures/messages.xml
|
146
|
+
- spec/fixtures/user.xml
|
143
147
|
- spec/message_spec.rb
|
144
148
|
- spec/sax/active_resource_spec.rb
|
145
149
|
- spec/socialcastr_spec.rb
|
146
150
|
- spec/spec_helper.rb
|
151
|
+
- spec/user_spec.rb
|