refinerycms-vimeo-videos 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/.gitignore +0 -1
  2. data/Gemfile.lock +33 -0
  3. data/README.markdown +8 -0
  4. data/TODO +2 -1
  5. data/app/controllers/admin/vimeo_account_controller.rb +30 -7
  6. data/app/controllers/admin/vimeo_videos_controller.rb +10 -9
  7. data/app/models/vimeo_embed_cache.rb +6 -1
  8. data/app/models/vimeo_meta_cache.rb +25 -24
  9. data/lib/refinerycms-vimeo-videos.rb +4 -1
  10. data/lib/refinerycms_vimeo_videos/account.rb +31 -0
  11. data/lib/refinerycms_vimeo_videos/version.rb +1 -1
  12. data/refinerycms-vimeo-videos.gemspec +146 -4
  13. data/spec/controllers/admin/vimeo_account_controller_spec.rb +0 -0
  14. data/spec/fixtures/advanced/album/add_video.json +4 -0
  15. data/spec/fixtures/advanced/album/create.json +7 -0
  16. data/spec/fixtures/advanced/album/delete.json +4 -0
  17. data/spec/fixtures/advanced/album/get_all.json +111 -0
  18. data/spec/fixtures/advanced/album/get_videos.json +30 -0
  19. data/spec/fixtures/advanced/album/remove_video.json +4 -0
  20. data/spec/fixtures/advanced/album/set_description.json +4 -0
  21. data/spec/fixtures/advanced/album/set_password.json +4 -0
  22. data/spec/fixtures/advanced/album/set_title.json +4 -0
  23. data/spec/fixtures/advanced/auth/access_token.txt +1 -0
  24. data/spec/fixtures/advanced/auth/check_access_token.json +9 -0
  25. data/spec/fixtures/advanced/auth/check_token.json +13 -0
  26. data/spec/fixtures/advanced/auth/get_frob.json +5 -0
  27. data/spec/fixtures/advanced/auth/get_token.json +13 -0
  28. data/spec/fixtures/advanced/auth/request_token.txt +1 -0
  29. data/spec/fixtures/advanced/channel/add_video.json +4 -0
  30. data/spec/fixtures/advanced/channel/get_all.json +1357 -0
  31. data/spec/fixtures/advanced/channel/get_info.json +55 -0
  32. data/spec/fixtures/advanced/channel/get_moderators.json +45 -0
  33. data/spec/fixtures/advanced/channel/get_subscribers.json +44 -0
  34. data/spec/fixtures/advanced/channel/get_videos.json +19 -0
  35. data/spec/fixtures/advanced/channel/remove_video.json +4 -0
  36. data/spec/fixtures/advanced/channel/subscribe.json +4 -0
  37. data/spec/fixtures/advanced/channel/unsubscribe.json +4 -0
  38. data/spec/fixtures/advanced/contact/get_all.json +117 -0
  39. data/spec/fixtures/advanced/contact/get_mutual.json +80 -0
  40. data/spec/fixtures/advanced/contact/get_online.json +47 -0
  41. data/spec/fixtures/advanced/contact/get_who_added.json +117 -0
  42. data/spec/fixtures/advanced/group/add_video.json +4 -0
  43. data/spec/fixtures/advanced/group/get_all.json +1532 -0
  44. data/spec/fixtures/advanced/group/get_files.json +255 -0
  45. data/spec/fixtures/advanced/group/get_info.json +72 -0
  46. data/spec/fixtures/advanced/group/get_members.json +862 -0
  47. data/spec/fixtures/advanced/group/get_moderators.json +44 -0
  48. data/spec/fixtures/advanced/group/get_video_comments.json +96 -0
  49. data/spec/fixtures/advanced/group/get_videos.json +102 -0
  50. data/spec/fixtures/advanced/group/join.json +4 -0
  51. data/spec/fixtures/advanced/group/leave.json +4 -0
  52. data/spec/fixtures/advanced/group_events/get_month.json +141 -0
  53. data/spec/fixtures/advanced/group_events/get_past.json +141 -0
  54. data/spec/fixtures/advanced/group_events/get_upcoming.json +141 -0
  55. data/spec/fixtures/advanced/group_forums/get_topic_comments.json +222 -0
  56. data/spec/fixtures/advanced/group_forums/get_topics.json +504 -0
  57. data/spec/fixtures/advanced/person/add_contact.json +4 -0
  58. data/spec/fixtures/advanced/person/add_subscription.json +4 -0
  59. data/spec/fixtures/advanced/person/find_by_email.json +9 -0
  60. data/spec/fixtures/advanced/person/get_hd_embeds.json +8 -0
  61. data/spec/fixtures/advanced/person/get_info.json +20 -0
  62. data/spec/fixtures/advanced/person/get_portrait_urls.json +28 -0
  63. data/spec/fixtures/advanced/person/remove_contact.json +4 -0
  64. data/spec/fixtures/advanced/person/remove_subscription.json +4 -0
  65. data/spec/fixtures/advanced/test/echo.json +8 -0
  66. data/spec/fixtures/advanced/test/login.json +8 -0
  67. data/spec/fixtures/advanced/test/null.json +4 -0
  68. data/spec/fixtures/advanced/upload/get_quota.json +16 -0
  69. data/spec/fixtures/advanced/upload/get_ticket.json +8 -0
  70. data/spec/fixtures/advanced/upload/sample_iTunes.mov +0 -0
  71. data/spec/fixtures/advanced/video/add_cast.json +4 -0
  72. data/spec/fixtures/advanced/video/add_comment.json +7 -0
  73. data/spec/fixtures/advanced/video/add_photos.json +4 -0
  74. data/spec/fixtures/advanced/video/add_tags.json +4 -0
  75. data/spec/fixtures/advanced/video/clear_tags.json +4 -0
  76. data/spec/fixtures/advanced/video/delete.json +4 -0
  77. data/spec/fixtures/advanced/video/delete_comment.json +4 -0
  78. data/spec/fixtures/advanced/video/edit_comment.json +4 -0
  79. data/spec/fixtures/advanced/video/get_all.json +30 -0
  80. data/spec/fixtures/advanced/video/get_appears_in.json +10 -0
  81. data/spec/fixtures/advanced/video/get_by_tag.json +237 -0
  82. data/spec/fixtures/advanced/video/get_cast.json +42 -0
  83. data/spec/fixtures/advanced/video/get_comments_list.json +52 -0
  84. data/spec/fixtures/advanced/video/get_contacts_liked.json +48 -0
  85. data/spec/fixtures/advanced/video/get_contacts_uploaded.json +237 -0
  86. data/spec/fixtures/advanced/video/get_info.json +246 -0
  87. data/spec/fixtures/advanced/video/get_likes.json +32 -0
  88. data/spec/fixtures/advanced/video/get_subscriptions.json +237 -0
  89. data/spec/fixtures/advanced/video/get_thumbnail_urls.json +28 -0
  90. data/spec/fixtures/advanced/video/get_uploaded.json +30 -0
  91. data/spec/fixtures/advanced/video/remove_cast.json +4 -0
  92. data/spec/fixtures/advanced/video/remove_tag.json +4 -0
  93. data/spec/fixtures/advanced/video/search.json +237 -0
  94. data/spec/fixtures/advanced/video/set_description.json +4 -0
  95. data/spec/fixtures/advanced/video/set_like.json +4 -0
  96. data/spec/fixtures/advanced/video/set_privacy.json +4 -0
  97. data/spec/fixtures/advanced/video/set_title.json +4 -0
  98. data/spec/fixtures/advanced/video_embed/get_presets.json +8 -0
  99. data/spec/fixtures/advanced/video_embed/set_preset.json +4 -0
  100. data/spec/fixtures/oembed/oembed.json +5 -0
  101. data/spec/fixtures/simple/activity/contacts_did.json +1 -0
  102. data/spec/fixtures/simple/activity/everyone_did.json +1 -0
  103. data/spec/fixtures/simple/activity/happened_to_contacts.json +1 -0
  104. data/spec/fixtures/simple/activity/happened_to_user.json +1 -0
  105. data/spec/fixtures/simple/activity/user_did.json +1 -0
  106. data/spec/fixtures/simple/album/info.json +1 -0
  107. data/spec/fixtures/simple/album/videos.json +1 -0
  108. data/spec/fixtures/simple/channel/info.json +1 -0
  109. data/spec/fixtures/simple/channel/videos.json +1 -0
  110. data/spec/fixtures/simple/group/info.json +1 -0
  111. data/spec/fixtures/simple/group/users.json +1 -0
  112. data/spec/fixtures/simple/group/videos.json +1 -0
  113. data/spec/fixtures/simple/user/albums.json +1 -0
  114. data/spec/fixtures/simple/user/all_videos.json +1 -0
  115. data/spec/fixtures/simple/user/appears_in.json +1 -0
  116. data/spec/fixtures/simple/user/channels.json +1 -0
  117. data/spec/fixtures/simple/user/contacts_like.json +1 -0
  118. data/spec/fixtures/simple/user/contacts_videos.json +1 -0
  119. data/spec/fixtures/simple/user/groups.json +1 -0
  120. data/spec/fixtures/simple/user/info.json +1 -0
  121. data/spec/fixtures/simple/user/likes.json +1 -0
  122. data/spec/fixtures/simple/user/subscriptions.json +1 -0
  123. data/spec/fixtures/simple/user/videos.json +1 -0
  124. data/spec/fixtures/simple/video/info.json +1 -0
  125. data/spec/models/vimeo_embed_cache_spec.rb +65 -0
  126. data/spec/models/vimeo_meta_cache_spec.rb +24 -0
  127. data/spec/models/vimeo_video_spec.rb +0 -8
  128. data/spec/vimeo_helper.rb +54 -0
  129. metadata +131 -3
  130. data/app/controllers/admin/vimeo_base_controller.rb +0 -40
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-vimeo-videos
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.4
5
+ version: 0.1.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marian Andre
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-21 00:00:00 +02:00
13
+ date: 2011-04-25 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -35,6 +35,17 @@ dependencies:
35
35
  version: 0.6.1
36
36
  type: :runtime
37
37
  version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: fakeweb
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 1.2.6
47
+ type: :runtime
48
+ version_requirements: *id003
38
49
  description: Ruby on Rails Vimeo Videos engine for Refinery CMS
39
50
  email: mail@bitflut.com
40
51
  executables: []
@@ -46,10 +57,11 @@ extra_rdoc_files: []
46
57
  files:
47
58
  - .gitignore
48
59
  - Gemfile
60
+ - Gemfile.lock
61
+ - README.markdown
49
62
  - Rakefile
50
63
  - TODO
51
64
  - app/controllers/admin/vimeo_account_controller.rb
52
- - app/controllers/admin/vimeo_base_controller.rb
53
65
  - app/controllers/admin/vimeo_videos_controller.rb
54
66
  - app/models/vimeo_embed_cache.rb
55
67
  - app/models/vimeo_meta_cache.rb
@@ -74,12 +86,128 @@ files:
74
86
  - features/support/paths.rb
75
87
  - lib/generators/refinerycms_vimeo_videos_generator.rb
76
88
  - lib/refinerycms-vimeo-videos.rb
89
+ - lib/refinerycms_vimeo_videos/account.rb
77
90
  - lib/refinerycms_vimeo_videos/version.rb
78
91
  - lib/tasks/vimeo_videos.rake
79
92
  - public/javascripts/refinery/vimeo_videos.js
80
93
  - public/stylesheets/admin/vimeo_videos.css
81
94
  - refinerycms-vimeo-videos.gemspec
95
+ - spec/controllers/admin/vimeo_account_controller_spec.rb
96
+ - spec/fixtures/advanced/album/add_video.json
97
+ - spec/fixtures/advanced/album/create.json
98
+ - spec/fixtures/advanced/album/delete.json
99
+ - spec/fixtures/advanced/album/get_all.json
100
+ - spec/fixtures/advanced/album/get_videos.json
101
+ - spec/fixtures/advanced/album/remove_video.json
102
+ - spec/fixtures/advanced/album/set_description.json
103
+ - spec/fixtures/advanced/album/set_password.json
104
+ - spec/fixtures/advanced/album/set_title.json
105
+ - spec/fixtures/advanced/auth/access_token.txt
106
+ - spec/fixtures/advanced/auth/check_access_token.json
107
+ - spec/fixtures/advanced/auth/check_token.json
108
+ - spec/fixtures/advanced/auth/get_frob.json
109
+ - spec/fixtures/advanced/auth/get_token.json
110
+ - spec/fixtures/advanced/auth/request_token.txt
111
+ - spec/fixtures/advanced/channel/add_video.json
112
+ - spec/fixtures/advanced/channel/get_all.json
113
+ - spec/fixtures/advanced/channel/get_info.json
114
+ - spec/fixtures/advanced/channel/get_moderators.json
115
+ - spec/fixtures/advanced/channel/get_subscribers.json
116
+ - spec/fixtures/advanced/channel/get_videos.json
117
+ - spec/fixtures/advanced/channel/remove_video.json
118
+ - spec/fixtures/advanced/channel/subscribe.json
119
+ - spec/fixtures/advanced/channel/unsubscribe.json
120
+ - spec/fixtures/advanced/contact/get_all.json
121
+ - spec/fixtures/advanced/contact/get_mutual.json
122
+ - spec/fixtures/advanced/contact/get_online.json
123
+ - spec/fixtures/advanced/contact/get_who_added.json
124
+ - spec/fixtures/advanced/group/add_video.json
125
+ - spec/fixtures/advanced/group/get_all.json
126
+ - spec/fixtures/advanced/group/get_files.json
127
+ - spec/fixtures/advanced/group/get_info.json
128
+ - spec/fixtures/advanced/group/get_members.json
129
+ - spec/fixtures/advanced/group/get_moderators.json
130
+ - spec/fixtures/advanced/group/get_video_comments.json
131
+ - spec/fixtures/advanced/group/get_videos.json
132
+ - spec/fixtures/advanced/group/join.json
133
+ - spec/fixtures/advanced/group/leave.json
134
+ - spec/fixtures/advanced/group_events/get_month.json
135
+ - spec/fixtures/advanced/group_events/get_past.json
136
+ - spec/fixtures/advanced/group_events/get_upcoming.json
137
+ - spec/fixtures/advanced/group_forums/get_topic_comments.json
138
+ - spec/fixtures/advanced/group_forums/get_topics.json
139
+ - spec/fixtures/advanced/person/add_contact.json
140
+ - spec/fixtures/advanced/person/add_subscription.json
141
+ - spec/fixtures/advanced/person/find_by_email.json
142
+ - spec/fixtures/advanced/person/get_hd_embeds.json
143
+ - spec/fixtures/advanced/person/get_info.json
144
+ - spec/fixtures/advanced/person/get_portrait_urls.json
145
+ - spec/fixtures/advanced/person/remove_contact.json
146
+ - spec/fixtures/advanced/person/remove_subscription.json
147
+ - spec/fixtures/advanced/test/echo.json
148
+ - spec/fixtures/advanced/test/login.json
149
+ - spec/fixtures/advanced/test/null.json
150
+ - spec/fixtures/advanced/upload/get_quota.json
151
+ - spec/fixtures/advanced/upload/get_ticket.json
152
+ - spec/fixtures/advanced/upload/sample_iTunes.mov
153
+ - spec/fixtures/advanced/video/add_cast.json
154
+ - spec/fixtures/advanced/video/add_comment.json
155
+ - spec/fixtures/advanced/video/add_photos.json
156
+ - spec/fixtures/advanced/video/add_tags.json
157
+ - spec/fixtures/advanced/video/clear_tags.json
158
+ - spec/fixtures/advanced/video/delete.json
159
+ - spec/fixtures/advanced/video/delete_comment.json
160
+ - spec/fixtures/advanced/video/edit_comment.json
161
+ - spec/fixtures/advanced/video/get_all.json
162
+ - spec/fixtures/advanced/video/get_appears_in.json
163
+ - spec/fixtures/advanced/video/get_by_tag.json
164
+ - spec/fixtures/advanced/video/get_cast.json
165
+ - spec/fixtures/advanced/video/get_comments_list.json
166
+ - spec/fixtures/advanced/video/get_contacts_liked.json
167
+ - spec/fixtures/advanced/video/get_contacts_uploaded.json
168
+ - spec/fixtures/advanced/video/get_info.json
169
+ - spec/fixtures/advanced/video/get_likes.json
170
+ - spec/fixtures/advanced/video/get_subscriptions.json
171
+ - spec/fixtures/advanced/video/get_thumbnail_urls.json
172
+ - spec/fixtures/advanced/video/get_uploaded.json
173
+ - spec/fixtures/advanced/video/remove_cast.json
174
+ - spec/fixtures/advanced/video/remove_tag.json
175
+ - spec/fixtures/advanced/video/search.json
176
+ - spec/fixtures/advanced/video/set_description.json
177
+ - spec/fixtures/advanced/video/set_like.json
178
+ - spec/fixtures/advanced/video/set_privacy.json
179
+ - spec/fixtures/advanced/video/set_title.json
180
+ - spec/fixtures/advanced/video_embed/get_presets.json
181
+ - spec/fixtures/advanced/video_embed/set_preset.json
182
+ - spec/fixtures/oembed/oembed.json
183
+ - spec/fixtures/simple/activity/contacts_did.json
184
+ - spec/fixtures/simple/activity/everyone_did.json
185
+ - spec/fixtures/simple/activity/happened_to_contacts.json
186
+ - spec/fixtures/simple/activity/happened_to_user.json
187
+ - spec/fixtures/simple/activity/user_did.json
188
+ - spec/fixtures/simple/album/info.json
189
+ - spec/fixtures/simple/album/videos.json
190
+ - spec/fixtures/simple/channel/info.json
191
+ - spec/fixtures/simple/channel/videos.json
192
+ - spec/fixtures/simple/group/info.json
193
+ - spec/fixtures/simple/group/users.json
194
+ - spec/fixtures/simple/group/videos.json
195
+ - spec/fixtures/simple/user/albums.json
196
+ - spec/fixtures/simple/user/all_videos.json
197
+ - spec/fixtures/simple/user/appears_in.json
198
+ - spec/fixtures/simple/user/channels.json
199
+ - spec/fixtures/simple/user/contacts_like.json
200
+ - spec/fixtures/simple/user/contacts_videos.json
201
+ - spec/fixtures/simple/user/groups.json
202
+ - spec/fixtures/simple/user/info.json
203
+ - spec/fixtures/simple/user/likes.json
204
+ - spec/fixtures/simple/user/subscriptions.json
205
+ - spec/fixtures/simple/user/videos.json
206
+ - spec/fixtures/simple/video/info.json
207
+ - spec/models/vimeo_embed_cache_spec.rb
208
+ - spec/models/vimeo_meta_cache_spec.rb
82
209
  - spec/models/vimeo_video_spec.rb
210
+ - spec/vimeo_helper.rb
83
211
  has_rdoc: true
84
212
  homepage: http://bitflut.com
85
213
  licenses:
@@ -1,40 +0,0 @@
1
- require 'vimeo'
2
- module Admin
3
- class VimeoBaseController < Admin::BaseController
4
-
5
- before_filter :get_account
6
-
7
- CONSUMER_KEY_FORMAT = /[a-z0-9]{32}/
8
- CONSUMER_SECRET_FORMAT = /[a-z0-9]{16}/
9
- TOKEN_FORMAT = /[a-z0-9]{32}/
10
- SECRET_FORMAT = /[a-z0-9]{40}/
11
-
12
- protected
13
-
14
- # Hack because I don't know how to turn off restriction otherwise
15
- def restrict_plugins
16
- end
17
-
18
- # Hack because I don't know how to turn off restriction otherwise
19
- def restrict_controller
20
- end
21
-
22
- def ready_to_authorize?
23
- @account[:consumer_key] =~ CONSUMER_KEY_FORMAT and @account[:consumer_secret] =~ CONSUMER_SECRET_FORMAT
24
- end
25
-
26
- def authorized?
27
- @account[:token] =~ TOKEN_FORMAT and @account[:secret] =~ SECRET_FORMAT
28
- end
29
-
30
- def get_account
31
- @account = {
32
- :username => RefinerySetting.find_or_set(:vimeo_username, :value => "Username"),
33
- :consumer_key => RefinerySetting.find_or_set(:vimeo_consumer_key, :value => "Consumer Key"),
34
- :consumer_secret => RefinerySetting.find_or_set(:vimeo_consumer_secret, :value => "Consumer Secret"),
35
- :token => RefinerySetting.find_or_set(:vimeo_token, :value => 'Token'),
36
- :secret => RefinerySetting.find_or_set(:vimeo_secret, :value => 'Secret')}
37
- end
38
-
39
- end
40
- end