refinerycms-vimeo-videos 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -41
- data/README.markdown +2 -2
- data/app/controllers/admin/vimeo_account_controller.rb +4 -4
- data/app/controllers/admin/vimeo_videos_controller.rb +1 -1
- data/app/models/vimeo_meta_cache.rb +2 -2
- data/config/routes.rb +4 -6
- data/lib/refinerycms-vimeo-videos.rb +2 -1
- data/lib/refinerycms_vimeo_videos/account.rb +24 -22
- data/lib/refinerycms_vimeo_videos/active_record_extension.rb +26 -24
- data/lib/refinerycms_vimeo_videos/url_tempfile.rb +13 -11
- data/lib/refinerycms_vimeo_videos/version.rb +4 -2
- data/refinerycms-vimeo-videos.gemspec +8 -223
- data/spec/controllers/admin/vimeo_account_controller_spec.rb +11 -2
- metadata +127 -23
- data/TODO +0 -3
- data/features/manage_vimeo_videos.feature +0 -63
- data/features/step_definitions/vimeo_video_steps.rb +0 -14
- data/features/support/factories.rb +0 -18
- data/features/support/paths.rb +0 -17
data/.gitignore
CHANGED
@@ -1,45 +1,5 @@
|
|
1
1
|
*.gem
|
2
2
|
TODO
|
3
|
-
|
4
|
-
# rcov generated
|
5
|
-
coverage
|
6
|
-
|
7
|
-
# rdoc generated
|
8
|
-
rdoc
|
9
|
-
|
10
|
-
# yard generated
|
11
|
-
doc
|
12
|
-
.yardoc
|
13
|
-
|
14
|
-
# bundler
|
15
3
|
.bundle
|
16
|
-
|
17
|
-
# jeweler generated
|
18
4
|
pkg
|
19
|
-
|
20
|
-
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
21
|
-
#
|
22
|
-
# * Create a file at ~/.gitignore
|
23
|
-
# * Include files you want ignored
|
24
|
-
# * Run: git config --global core.excludesfile ~/.gitignore
|
25
|
-
#
|
26
|
-
# After doing this, these files will be ignored in all your git projects,
|
27
|
-
# saving you from having to 'pollute' every project you touch with them
|
28
|
-
#
|
29
|
-
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
30
|
-
#
|
31
|
-
# For MacOS:
|
32
|
-
#
|
33
|
-
.DS_Store
|
34
|
-
#
|
35
|
-
# For TextMate
|
36
|
-
*.tmproj
|
37
|
-
tmtags
|
38
|
-
#
|
39
|
-
# For emacs:
|
40
|
-
#*~
|
41
|
-
#\#*
|
42
|
-
#.\#*
|
43
|
-
#
|
44
|
-
# For vim:
|
45
|
-
#*.swp
|
5
|
+
Gemfile.lock
|
data/README.markdown
CHANGED
@@ -17,11 +17,11 @@ Run the generator and migrate your database
|
|
17
17
|
|
18
18
|
Create an api-application for your vimeo account under http://vimeo.com/api/applications with a callback url of
|
19
19
|
|
20
|
-
http://yourapp.com/
|
20
|
+
http://yourapp.com/refinery/vimeo_videos/callback
|
21
21
|
|
22
22
|
Copy/paste the consumer\_key and consumer\_secret of your vimeo api-application to the related Refinery Settings (:vimeo\_consumer\_key and :vimeo\_consumer\_secret). Then access the following url:
|
23
23
|
|
24
|
-
http://yourapp.com/
|
24
|
+
http://yourapp.com/refinery/vimeo_videos/authorization
|
25
25
|
|
26
26
|
After this, your app should be setup to use your vimeo account.
|
27
27
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Admin
|
2
2
|
class VimeoAccountController < Admin::BaseController
|
3
3
|
|
4
|
-
include ::
|
4
|
+
include ::Refinery::VimeoVideos::Account
|
5
5
|
|
6
6
|
def authorization
|
7
7
|
|
@@ -20,13 +20,13 @@ module Admin
|
|
20
20
|
|
21
21
|
# already authorized
|
22
22
|
flash.notice = "You have already authorized your account."
|
23
|
-
redirect_to
|
23
|
+
redirect_to refinery_root_path
|
24
24
|
|
25
25
|
else
|
26
26
|
|
27
27
|
# not ready to authorize
|
28
28
|
flash.alert = "You are not ready to authorize. Type in consumer_key and consumer_secret."
|
29
|
-
redirect_to
|
29
|
+
redirect_to refinery_root_path
|
30
30
|
|
31
31
|
end
|
32
32
|
end
|
@@ -41,7 +41,7 @@ module Admin
|
|
41
41
|
RefinerySetting.find_by_name('vimeo_token').update_attribute(:value, access_token.token)
|
42
42
|
RefinerySetting.find_by_name('vimeo_secret').update_attribute(:value, access_token.secret)
|
43
43
|
flash.notice = "You successfully authorized your vimeo account for integration in your backend. You can now start using it."
|
44
|
-
redirect_to
|
44
|
+
redirect_to refinery_root_path
|
45
45
|
|
46
46
|
end
|
47
47
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class VimeoMetaCache < ActiveRecord::Base
|
2
2
|
|
3
|
-
include ::
|
3
|
+
include ::Refinery::VimeoVideos::Account
|
4
4
|
|
5
5
|
set_table_name "vimeo_meta_cache"
|
6
6
|
|
@@ -45,7 +45,7 @@ class VimeoMetaCache < ActiveRecord::Base
|
|
45
45
|
if images or !image_id?
|
46
46
|
# Save fetched image url
|
47
47
|
vimeo_thumb_url = video_info["thumbnails"]["thumbnail"].last["_content"]
|
48
|
-
self.create_image(:image =>
|
48
|
+
self.create_image(:image => ::Refinery::VimeoVideos::URLTempfile.new(vimeo_thumb_url))
|
49
49
|
end
|
50
50
|
|
51
51
|
# Save fetched title
|
data/config/routes.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
Refinery::Application.routes.draw do
|
2
|
-
scope(:path => '
|
2
|
+
scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
|
3
|
+
get 'vimeo_videos/authorization', :to => 'vimeo_account#authorization'
|
4
|
+
get 'vimeo_videos/callback', :to => 'vimeo_account#callback'
|
5
|
+
|
3
6
|
resources :vimeo_videos, :except => :show do
|
4
7
|
collection do
|
5
8
|
get :insert
|
6
9
|
end
|
7
10
|
end
|
8
11
|
end
|
9
|
-
|
10
|
-
namespace :admin do
|
11
|
-
get 'vimeo_videos/authorization', :to => 'vimeo_account#authorization'
|
12
|
-
get 'vimeo_videos/callback', :to => 'vimeo_account#callback'
|
13
|
-
end
|
14
12
|
end
|
@@ -1,31 +1,33 @@
|
|
1
|
-
module
|
2
|
-
module
|
1
|
+
module Refinery
|
2
|
+
module VimeoVideos
|
3
|
+
module Account
|
3
4
|
|
4
|
-
|
5
|
+
# This will extend controllers and models to centralize account setup logic
|
5
6
|
|
6
|
-
|
7
|
+
protected
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
CONSUMER_KEY_FORMAT = /^\w{32}$/
|
10
|
+
CONSUMER_SECRET_FORMAT = /^\w{16}$/
|
11
|
+
TOKEN_FORMAT = /^\w{32}$/
|
12
|
+
SECRET_FORMAT = /^\w{40}$/
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def ready_to_authorize?
|
15
|
+
account[:consumer_key] =~ CONSUMER_KEY_FORMAT and account[:consumer_secret] =~ CONSUMER_SECRET_FORMAT
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
def authorized?
|
19
|
+
account[:token] =~ TOKEN_FORMAT and account[:secret] =~ SECRET_FORMAT
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
def account
|
23
|
+
@account ||= {
|
24
|
+
:username => RefinerySetting.find_or_set(:vimeo_username, :value => "Username"),
|
25
|
+
:consumer_key => RefinerySetting.find_or_set(:vimeo_consumer_key, :value => "Consumer Key"),
|
26
|
+
:consumer_secret => RefinerySetting.find_or_set(:vimeo_consumer_secret, :value => "Consumer Secret"),
|
27
|
+
:token => RefinerySetting.find_or_set(:vimeo_token, :value => 'Token'),
|
28
|
+
:secret => RefinerySetting.find_or_set(:vimeo_secret, :value => 'Secret')}
|
29
|
+
end
|
29
30
|
|
31
|
+
end
|
30
32
|
end
|
31
33
|
end
|
@@ -1,38 +1,40 @@
|
|
1
|
-
module
|
2
|
-
module
|
1
|
+
module Refinery
|
2
|
+
module VimeoVideos
|
3
|
+
module ActiveRecordExtension
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
def self.included(base)
|
6
|
+
base.extend(ClassMethods)
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
+
module ClassMethods
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
def vimeo_video field
|
12
|
+
class_eval <<-EOV
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def #{field}
|
15
|
+
if self.new_record?
|
16
|
+
self.#{field}_id
|
17
|
+
else
|
18
|
+
self.#{field}_id? ? VimeoMetaCache.find_or_create_by_vid(self.#{field}_id) : nil
|
19
|
+
end
|
18
20
|
end
|
19
|
-
end
|
20
21
|
|
21
|
-
|
22
|
+
before_save :cache_vimeo_meta_for_#{field}
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
def cache_vimeo_meta_for_#{field}
|
25
|
+
if self.#{field}_id? and self.#{field}_id_changed?
|
26
|
+
VimeoMetaCache.find_or_create_by_vid(self.#{field}_id)
|
27
|
+
end
|
26
28
|
end
|
27
|
-
|
28
|
-
protected :cache_vimeo_meta_for_#{field}
|
29
|
+
protected :cache_vimeo_meta_for_#{field}
|
29
30
|
|
30
|
-
|
31
|
-
|
31
|
+
EOV
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
+
end
|
34
35
|
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
38
|
-
ActiveRecord::Base.class_eval { include
|
40
|
+
ActiveRecord::Base.class_eval { include Refinery::VimeoVideos::ActiveRecordExtension }
|
@@ -1,19 +1,21 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module Refinery
|
2
|
+
module VimeoVideos
|
3
|
+
class URLTempfile < Tempfile
|
3
4
|
|
4
|
-
|
5
|
-
|
5
|
+
def initialize(url)
|
6
|
+
@url = URI.parse(url)
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
begin
|
9
|
+
super('url', Dir.tmpdir, :encoding => 'ascii-8bit')
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
Net::HTTP.start(@url.host) do |http|
|
12
|
+
resp = http.get(@url.path)
|
13
|
+
self.write resp.body
|
14
|
+
end
|
15
|
+
ensure
|
13
16
|
end
|
14
|
-
ensure
|
15
17
|
end
|
16
|
-
end
|
17
18
|
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
@@ -1,237 +1,22 @@
|
|
1
|
-
# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
|
2
1
|
$:.push File.expand_path("../lib", __FILE__)
|
3
2
|
require "refinerycms_vimeo_videos/version"
|
4
3
|
|
5
4
|
Gem::Specification.new do |s|
|
6
5
|
s.name = %q{refinerycms-vimeo-videos}
|
7
|
-
s.version =
|
6
|
+
s.version = Refinery::VimeoVideos::VERSION
|
8
7
|
s.description = 'Ruby on Rails Vimeo Videos engine for Refinery CMS'
|
9
|
-
s.date = %q{2011-04-25}
|
10
8
|
s.summary = 'Vimeo Videos engine for Refinery CMS'
|
11
9
|
s.email = %q{mail@bitflut.com}
|
12
10
|
s.homepage = %q{http://bitflut.com}
|
13
11
|
s.authors = ['Marian Andre']
|
14
12
|
s.license = %q{MIT}
|
15
|
-
|
16
|
-
s.files
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib", "config", "app", "public"]
|
17
18
|
|
18
19
|
s.add_dependency 'vimeo', '~> 1.3.0'
|
19
|
-
s.
|
20
|
-
s.add_dependency 'fakeweb', '~> 1.2.6'
|
20
|
+
s.add_development_dependency 'fakeweb', '~> 1.2.6'
|
21
21
|
|
22
|
-
|
23
|
-
'.gitignore',
|
24
|
-
'Gemfile',
|
25
|
-
'Gemfile',
|
26
|
-
'Gemfile.lock',
|
27
|
-
'README.markdown',
|
28
|
-
'Rakefile',
|
29
|
-
'TODO',
|
30
|
-
'app',
|
31
|
-
'app/controllers',
|
32
|
-
'app/controllers/admin',
|
33
|
-
'app/controllers/admin/vimeo_account_controller.rb',
|
34
|
-
'app/controllers/admin/vimeo_videos_controller.rb',
|
35
|
-
'app/models',
|
36
|
-
'app/models/vimeo_embed_cache.rb',
|
37
|
-
'app/models/vimeo_meta_cache.rb',
|
38
|
-
'app/models/vimeo_video.rb',
|
39
|
-
'app/views',
|
40
|
-
'app/views/admin',
|
41
|
-
'app/views/admin/vimeo_videos',
|
42
|
-
'app/views/admin/vimeo_videos/_existing_vimeo_video.html.erb',
|
43
|
-
'app/views/admin/vimeo_videos/_form.html.erb',
|
44
|
-
'app/views/admin/vimeo_videos/_vimeo_video.html.haml',
|
45
|
-
'app/views/admin/vimeo_videos/index.js.erb',
|
46
|
-
'app/views/admin/vimeo_videos/insert.html.erb',
|
47
|
-
'app/views/shared',
|
48
|
-
'app/views/shared/admin',
|
49
|
-
'app/views/shared/admin/_vimeo_picker.html.erb',
|
50
|
-
'config',
|
51
|
-
'config/locales',
|
52
|
-
'config/locales/en.yml',
|
53
|
-
'config/locales/lolcat.yml',
|
54
|
-
'config/locales/nb.yml',
|
55
|
-
'config/locales/nl.yml',
|
56
|
-
'config/routes.rb',
|
57
|
-
'db',
|
58
|
-
'db/migrate',
|
59
|
-
'db/migrate/create_vimeo_embed_cache.rb',
|
60
|
-
'db/migrate/create_vimeo_meta_cache.rb',
|
61
|
-
'db/migrate/create_vimeo_videos.rb',
|
62
|
-
'db/seeds',
|
63
|
-
'db/seeds/vimeo_videos.rb',
|
64
|
-
'features',
|
65
|
-
'features/manage_vimeo_videos.feature',
|
66
|
-
'features/step_definitions',
|
67
|
-
'features/step_definitions/vimeo_video_steps.rb',
|
68
|
-
'features/support',
|
69
|
-
'features/support/factories.rb',
|
70
|
-
'features/support/paths.rb',
|
71
|
-
'lib',
|
72
|
-
'lib/generators',
|
73
|
-
'lib/generators/refinerycms_vimeo_videos_generator.rb',
|
74
|
-
'lib/refinerycms-vimeo-videos.rb',
|
75
|
-
'lib/refinerycms_vimeo_videos',
|
76
|
-
'lib/refinerycms_vimeo_videos/account.rb',
|
77
|
-
'lib/refinerycms_vimeo_videos/active_record_extension.rb',
|
78
|
-
'lib/refinerycms_vimeo_videos/url_tempfile.rb',
|
79
|
-
'lib/refinerycms_vimeo_videos/version.rb',
|
80
|
-
'lib/tasks',
|
81
|
-
'lib/tasks/vimeo_videos.rake',
|
82
|
-
'pkg',
|
83
|
-
'public',
|
84
|
-
'public/javascripts',
|
85
|
-
'public/javascripts/refinery',
|
86
|
-
'public/javascripts/refinery/vimeo_videos.js',
|
87
|
-
'public/stylesheets',
|
88
|
-
'public/stylesheets/admin',
|
89
|
-
'public/stylesheets/admin/vimeo_videos.css',
|
90
|
-
'refinerycms-vimeo-videos.gemspec',
|
91
|
-
'spec',
|
92
|
-
'spec/controllers',
|
93
|
-
'spec/controllers/admin',
|
94
|
-
'spec/controllers/admin/vimeo_account_controller_spec.rb',
|
95
|
-
'spec/fixtures',
|
96
|
-
'spec/fixtures/advanced',
|
97
|
-
'spec/fixtures/advanced/album',
|
98
|
-
'spec/fixtures/advanced/album/add_video.json',
|
99
|
-
'spec/fixtures/advanced/album/create.json',
|
100
|
-
'spec/fixtures/advanced/album/delete.json',
|
101
|
-
'spec/fixtures/advanced/album/get_all.json',
|
102
|
-
'spec/fixtures/advanced/album/get_videos.json',
|
103
|
-
'spec/fixtures/advanced/album/remove_video.json',
|
104
|
-
'spec/fixtures/advanced/album/set_description.json',
|
105
|
-
'spec/fixtures/advanced/album/set_password.json',
|
106
|
-
'spec/fixtures/advanced/album/set_title.json',
|
107
|
-
'spec/fixtures/advanced/auth',
|
108
|
-
'spec/fixtures/advanced/auth/access_token.txt',
|
109
|
-
'spec/fixtures/advanced/auth/check_access_token.json',
|
110
|
-
'spec/fixtures/advanced/auth/check_token.json',
|
111
|
-
'spec/fixtures/advanced/auth/get_frob.json',
|
112
|
-
'spec/fixtures/advanced/auth/get_token.json',
|
113
|
-
'spec/fixtures/advanced/auth/request_token.txt',
|
114
|
-
'spec/fixtures/advanced/channel',
|
115
|
-
'spec/fixtures/advanced/channel/add_video.json',
|
116
|
-
'spec/fixtures/advanced/channel/get_all.json',
|
117
|
-
'spec/fixtures/advanced/channel/get_info.json',
|
118
|
-
'spec/fixtures/advanced/channel/get_moderators.json',
|
119
|
-
'spec/fixtures/advanced/channel/get_subscribers.json',
|
120
|
-
'spec/fixtures/advanced/channel/get_videos.json',
|
121
|
-
'spec/fixtures/advanced/channel/remove_video.json',
|
122
|
-
'spec/fixtures/advanced/channel/subscribe.json',
|
123
|
-
'spec/fixtures/advanced/channel/unsubscribe.json',
|
124
|
-
'spec/fixtures/advanced/contact',
|
125
|
-
'spec/fixtures/advanced/contact/get_all.json',
|
126
|
-
'spec/fixtures/advanced/contact/get_mutual.json',
|
127
|
-
'spec/fixtures/advanced/contact/get_online.json',
|
128
|
-
'spec/fixtures/advanced/contact/get_who_added.json',
|
129
|
-
'spec/fixtures/advanced/group',
|
130
|
-
'spec/fixtures/advanced/group/add_video.json',
|
131
|
-
'spec/fixtures/advanced/group/get_all.json',
|
132
|
-
'spec/fixtures/advanced/group/get_files.json',
|
133
|
-
'spec/fixtures/advanced/group/get_info.json',
|
134
|
-
'spec/fixtures/advanced/group/get_members.json',
|
135
|
-
'spec/fixtures/advanced/group/get_moderators.json',
|
136
|
-
'spec/fixtures/advanced/group/get_video_comments.json',
|
137
|
-
'spec/fixtures/advanced/group/get_videos.json',
|
138
|
-
'spec/fixtures/advanced/group/join.json',
|
139
|
-
'spec/fixtures/advanced/group/leave.json',
|
140
|
-
'spec/fixtures/advanced/group_events',
|
141
|
-
'spec/fixtures/advanced/group_events/get_month.json',
|
142
|
-
'spec/fixtures/advanced/group_events/get_past.json',
|
143
|
-
'spec/fixtures/advanced/group_events/get_upcoming.json',
|
144
|
-
'spec/fixtures/advanced/group_forums',
|
145
|
-
'spec/fixtures/advanced/group_forums/get_topic_comments.json',
|
146
|
-
'spec/fixtures/advanced/group_forums/get_topics.json',
|
147
|
-
'spec/fixtures/advanced/person',
|
148
|
-
'spec/fixtures/advanced/person/add_contact.json',
|
149
|
-
'spec/fixtures/advanced/person/add_subscription.json',
|
150
|
-
'spec/fixtures/advanced/person/find_by_email.json',
|
151
|
-
'spec/fixtures/advanced/person/get_hd_embeds.json',
|
152
|
-
'spec/fixtures/advanced/person/get_info.json',
|
153
|
-
'spec/fixtures/advanced/person/get_portrait_urls.json',
|
154
|
-
'spec/fixtures/advanced/person/remove_contact.json',
|
155
|
-
'spec/fixtures/advanced/person/remove_subscription.json',
|
156
|
-
'spec/fixtures/advanced/test',
|
157
|
-
'spec/fixtures/advanced/test/echo.json',
|
158
|
-
'spec/fixtures/advanced/test/login.json',
|
159
|
-
'spec/fixtures/advanced/test/null.json',
|
160
|
-
'spec/fixtures/advanced/upload',
|
161
|
-
'spec/fixtures/advanced/upload/get_quota.json',
|
162
|
-
'spec/fixtures/advanced/upload/get_ticket.json',
|
163
|
-
'spec/fixtures/advanced/upload/sample_iTunes.mov',
|
164
|
-
'spec/fixtures/advanced/video',
|
165
|
-
'spec/fixtures/advanced/video/add_cast.json',
|
166
|
-
'spec/fixtures/advanced/video/add_comment.json',
|
167
|
-
'spec/fixtures/advanced/video/add_photos.json',
|
168
|
-
'spec/fixtures/advanced/video/add_tags.json',
|
169
|
-
'spec/fixtures/advanced/video/clear_tags.json',
|
170
|
-
'spec/fixtures/advanced/video/delete.json',
|
171
|
-
'spec/fixtures/advanced/video/delete_comment.json',
|
172
|
-
'spec/fixtures/advanced/video/edit_comment.json',
|
173
|
-
'spec/fixtures/advanced/video/get_all.json',
|
174
|
-
'spec/fixtures/advanced/video/get_appears_in.json',
|
175
|
-
'spec/fixtures/advanced/video/get_by_tag.json',
|
176
|
-
'spec/fixtures/advanced/video/get_cast.json',
|
177
|
-
'spec/fixtures/advanced/video/get_comments_list.json',
|
178
|
-
'spec/fixtures/advanced/video/get_contacts_liked.json',
|
179
|
-
'spec/fixtures/advanced/video/get_contacts_uploaded.json',
|
180
|
-
'spec/fixtures/advanced/video/get_info.json',
|
181
|
-
'spec/fixtures/advanced/video/get_likes.json',
|
182
|
-
'spec/fixtures/advanced/video/get_subscriptions.json',
|
183
|
-
'spec/fixtures/advanced/video/get_thumbnail_urls.json',
|
184
|
-
'spec/fixtures/advanced/video/get_uploaded.json',
|
185
|
-
'spec/fixtures/advanced/video/remove_cast.json',
|
186
|
-
'spec/fixtures/advanced/video/remove_tag.json',
|
187
|
-
'spec/fixtures/advanced/video/search.json',
|
188
|
-
'spec/fixtures/advanced/video/set_description.json',
|
189
|
-
'spec/fixtures/advanced/video/set_like.json',
|
190
|
-
'spec/fixtures/advanced/video/set_privacy.json',
|
191
|
-
'spec/fixtures/advanced/video/set_title.json',
|
192
|
-
'spec/fixtures/advanced/video_embed',
|
193
|
-
'spec/fixtures/advanced/video_embed/get_presets.json',
|
194
|
-
'spec/fixtures/advanced/video_embed/set_preset.json',
|
195
|
-
'spec/fixtures/oembed',
|
196
|
-
'spec/fixtures/oembed/oembed.json.erb',
|
197
|
-
'spec/fixtures/simple',
|
198
|
-
'spec/fixtures/simple/activity',
|
199
|
-
'spec/fixtures/simple/activity/contacts_did.json',
|
200
|
-
'spec/fixtures/simple/activity/everyone_did.json',
|
201
|
-
'spec/fixtures/simple/activity/happened_to_contacts.json',
|
202
|
-
'spec/fixtures/simple/activity/happened_to_user.json',
|
203
|
-
'spec/fixtures/simple/activity/user_did.json',
|
204
|
-
'spec/fixtures/simple/album',
|
205
|
-
'spec/fixtures/simple/album/info.json',
|
206
|
-
'spec/fixtures/simple/album/videos.json',
|
207
|
-
'spec/fixtures/simple/channel',
|
208
|
-
'spec/fixtures/simple/channel/info.json',
|
209
|
-
'spec/fixtures/simple/channel/videos.json',
|
210
|
-
'spec/fixtures/simple/group',
|
211
|
-
'spec/fixtures/simple/group/info.json',
|
212
|
-
'spec/fixtures/simple/group/users.json',
|
213
|
-
'spec/fixtures/simple/group/videos.json',
|
214
|
-
'spec/fixtures/simple/user',
|
215
|
-
'spec/fixtures/simple/user/albums.json',
|
216
|
-
'spec/fixtures/simple/user/all_videos.json',
|
217
|
-
'spec/fixtures/simple/user/appears_in.json',
|
218
|
-
'spec/fixtures/simple/user/channels.json',
|
219
|
-
'spec/fixtures/simple/user/contacts_like.json',
|
220
|
-
'spec/fixtures/simple/user/contacts_videos.json',
|
221
|
-
'spec/fixtures/simple/user/groups.json',
|
222
|
-
'spec/fixtures/simple/user/info.json',
|
223
|
-
'spec/fixtures/simple/user/likes.json',
|
224
|
-
'spec/fixtures/simple/user/subscriptions.json',
|
225
|
-
'spec/fixtures/simple/user/videos.json',
|
226
|
-
'spec/fixtures/simple/video',
|
227
|
-
'spec/fixtures/simple/video/info.json',
|
228
|
-
'spec/models',
|
229
|
-
'spec/models/active_record_extension_spec.rb',
|
230
|
-
'spec/models/vimeo_embed_cache_spec.rb',
|
231
|
-
'spec/models/vimeo_meta_cache_spec.rb',
|
232
|
-
'spec/models/vimeo_video_spec.rb',
|
233
|
-
'spec/samples',
|
234
|
-
'spec/samples/taj.jpg',
|
235
|
-
'spec/vimeo_helper.rb'
|
236
|
-
]
|
237
|
-
end
|
22
|
+
end
|
@@ -41,7 +41,7 @@ describe Admin::VimeoAccountController do
|
|
41
41
|
response.should redirect_to('http://vimeo.com/oauth/authorize?permission=delete&oauth_token=12345')
|
42
42
|
end
|
43
43
|
|
44
|
-
it "should redirect to /
|
44
|
+
it "should redirect to /refinery if already authorized" do
|
45
45
|
RefinerySetting.set(:vimeo_consumer_key, '0fdb4f200cc52ae06cd3dfa74e680feb')
|
46
46
|
RefinerySetting.set(:vimeo_consumer_secret, 'e6cdebf36a8cdd6b')
|
47
47
|
RefinerySetting.set(:vimeo_token, '0ea53d3415ce2c60625ddc649730e1b9')
|
@@ -49,8 +49,17 @@ describe Admin::VimeoAccountController do
|
|
49
49
|
|
50
50
|
get :authorization
|
51
51
|
|
52
|
-
response.should redirect_to(
|
52
|
+
response.should redirect_to(refinery_root_path)
|
53
53
|
flash[:notice].should_not == nil
|
54
54
|
end
|
55
55
|
|
56
|
+
#it "should successfully authorize on callback" do
|
57
|
+
# RefinerySetting.set(:vimeo_consumer_key, '0fdb4f200cc52ae06cd3dfa74e680feb')
|
58
|
+
# RefinerySetting.set(:vimeo_consumer_secret, 'e6cdebf36a8cdd6b')
|
59
|
+
#
|
60
|
+
# #stub_custom_get("/oauth/access_token", "advanced/auth/access_token.txt")
|
61
|
+
#
|
62
|
+
# get :callback, {:oauth_token => "12345", :oauth_token_secret => "secret", :oauth_verifier => "asdf"}
|
63
|
+
#end
|
64
|
+
|
56
65
|
end
|
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.
|
5
|
+
version: 0.1.8
|
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-
|
13
|
+
date: 2011-04-28 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -24,28 +24,17 @@ dependencies:
|
|
24
24
|
version: 1.3.0
|
25
25
|
type: :runtime
|
26
26
|
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: httparty
|
29
|
-
prerelease: false
|
30
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
-
none: false
|
32
|
-
requirements:
|
33
|
-
- - ~>
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: 0.6.1
|
36
|
-
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
27
|
- !ruby/object:Gem::Dependency
|
39
28
|
name: fakeweb
|
40
29
|
prerelease: false
|
41
|
-
requirement: &
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
31
|
none: false
|
43
32
|
requirements:
|
44
33
|
- - ~>
|
45
34
|
- !ruby/object:Gem::Version
|
46
35
|
version: 1.2.6
|
47
|
-
type: :
|
48
|
-
version_requirements: *
|
36
|
+
type: :development
|
37
|
+
version_requirements: *id002
|
49
38
|
description: Ruby on Rails Vimeo Videos engine for Refinery CMS
|
50
39
|
email: mail@bitflut.com
|
51
40
|
executables: []
|
@@ -60,7 +49,6 @@ files:
|
|
60
49
|
- Gemfile.lock
|
61
50
|
- README.markdown
|
62
51
|
- Rakefile
|
63
|
-
- TODO
|
64
52
|
- app/controllers/admin/vimeo_account_controller.rb
|
65
53
|
- app/controllers/admin/vimeo_videos_controller.rb
|
66
54
|
- app/models/vimeo_embed_cache.rb
|
@@ -81,10 +69,6 @@ files:
|
|
81
69
|
- db/migrate/create_vimeo_meta_cache.rb
|
82
70
|
- db/migrate/create_vimeo_videos.rb
|
83
71
|
- db/seeds/vimeo_videos.rb
|
84
|
-
- features/manage_vimeo_videos.feature
|
85
|
-
- features/step_definitions/vimeo_video_steps.rb
|
86
|
-
- features/support/factories.rb
|
87
|
-
- features/support/paths.rb
|
88
72
|
- lib/generators/refinerycms_vimeo_videos_generator.rb
|
89
73
|
- lib/refinerycms-vimeo-videos.rb
|
90
74
|
- lib/refinerycms_vimeo_videos/account.rb
|
@@ -222,6 +206,9 @@ rdoc_options: []
|
|
222
206
|
|
223
207
|
require_paths:
|
224
208
|
- lib
|
209
|
+
- config
|
210
|
+
- app
|
211
|
+
- public
|
225
212
|
required_ruby_version: !ruby/object:Gem::Requirement
|
226
213
|
none: false
|
227
214
|
requirements:
|
@@ -241,5 +228,122 @@ rubygems_version: 1.5.2
|
|
241
228
|
signing_key:
|
242
229
|
specification_version: 3
|
243
230
|
summary: Vimeo Videos engine for Refinery CMS
|
244
|
-
test_files:
|
245
|
-
|
231
|
+
test_files:
|
232
|
+
- spec/controllers/admin/vimeo_account_controller_spec.rb
|
233
|
+
- spec/fixtures/advanced/album/add_video.json
|
234
|
+
- spec/fixtures/advanced/album/create.json
|
235
|
+
- spec/fixtures/advanced/album/delete.json
|
236
|
+
- spec/fixtures/advanced/album/get_all.json
|
237
|
+
- spec/fixtures/advanced/album/get_videos.json
|
238
|
+
- spec/fixtures/advanced/album/remove_video.json
|
239
|
+
- spec/fixtures/advanced/album/set_description.json
|
240
|
+
- spec/fixtures/advanced/album/set_password.json
|
241
|
+
- spec/fixtures/advanced/album/set_title.json
|
242
|
+
- spec/fixtures/advanced/auth/access_token.txt
|
243
|
+
- spec/fixtures/advanced/auth/check_access_token.json
|
244
|
+
- spec/fixtures/advanced/auth/check_token.json
|
245
|
+
- spec/fixtures/advanced/auth/get_frob.json
|
246
|
+
- spec/fixtures/advanced/auth/get_token.json
|
247
|
+
- spec/fixtures/advanced/auth/request_token.txt
|
248
|
+
- spec/fixtures/advanced/channel/add_video.json
|
249
|
+
- spec/fixtures/advanced/channel/get_all.json
|
250
|
+
- spec/fixtures/advanced/channel/get_info.json
|
251
|
+
- spec/fixtures/advanced/channel/get_moderators.json
|
252
|
+
- spec/fixtures/advanced/channel/get_subscribers.json
|
253
|
+
- spec/fixtures/advanced/channel/get_videos.json
|
254
|
+
- spec/fixtures/advanced/channel/remove_video.json
|
255
|
+
- spec/fixtures/advanced/channel/subscribe.json
|
256
|
+
- spec/fixtures/advanced/channel/unsubscribe.json
|
257
|
+
- spec/fixtures/advanced/contact/get_all.json
|
258
|
+
- spec/fixtures/advanced/contact/get_mutual.json
|
259
|
+
- spec/fixtures/advanced/contact/get_online.json
|
260
|
+
- spec/fixtures/advanced/contact/get_who_added.json
|
261
|
+
- spec/fixtures/advanced/group/add_video.json
|
262
|
+
- spec/fixtures/advanced/group/get_all.json
|
263
|
+
- spec/fixtures/advanced/group/get_files.json
|
264
|
+
- spec/fixtures/advanced/group/get_info.json
|
265
|
+
- spec/fixtures/advanced/group/get_members.json
|
266
|
+
- spec/fixtures/advanced/group/get_moderators.json
|
267
|
+
- spec/fixtures/advanced/group/get_video_comments.json
|
268
|
+
- spec/fixtures/advanced/group/get_videos.json
|
269
|
+
- spec/fixtures/advanced/group/join.json
|
270
|
+
- spec/fixtures/advanced/group/leave.json
|
271
|
+
- spec/fixtures/advanced/group_events/get_month.json
|
272
|
+
- spec/fixtures/advanced/group_events/get_past.json
|
273
|
+
- spec/fixtures/advanced/group_events/get_upcoming.json
|
274
|
+
- spec/fixtures/advanced/group_forums/get_topic_comments.json
|
275
|
+
- spec/fixtures/advanced/group_forums/get_topics.json
|
276
|
+
- spec/fixtures/advanced/person/add_contact.json
|
277
|
+
- spec/fixtures/advanced/person/add_subscription.json
|
278
|
+
- spec/fixtures/advanced/person/find_by_email.json
|
279
|
+
- spec/fixtures/advanced/person/get_hd_embeds.json
|
280
|
+
- spec/fixtures/advanced/person/get_info.json
|
281
|
+
- spec/fixtures/advanced/person/get_portrait_urls.json
|
282
|
+
- spec/fixtures/advanced/person/remove_contact.json
|
283
|
+
- spec/fixtures/advanced/person/remove_subscription.json
|
284
|
+
- spec/fixtures/advanced/test/echo.json
|
285
|
+
- spec/fixtures/advanced/test/login.json
|
286
|
+
- spec/fixtures/advanced/test/null.json
|
287
|
+
- spec/fixtures/advanced/upload/get_quota.json
|
288
|
+
- spec/fixtures/advanced/upload/get_ticket.json
|
289
|
+
- spec/fixtures/advanced/upload/sample_iTunes.mov
|
290
|
+
- spec/fixtures/advanced/video/add_cast.json
|
291
|
+
- spec/fixtures/advanced/video/add_comment.json
|
292
|
+
- spec/fixtures/advanced/video/add_photos.json
|
293
|
+
- spec/fixtures/advanced/video/add_tags.json
|
294
|
+
- spec/fixtures/advanced/video/clear_tags.json
|
295
|
+
- spec/fixtures/advanced/video/delete.json
|
296
|
+
- spec/fixtures/advanced/video/delete_comment.json
|
297
|
+
- spec/fixtures/advanced/video/edit_comment.json
|
298
|
+
- spec/fixtures/advanced/video/get_all.json
|
299
|
+
- spec/fixtures/advanced/video/get_appears_in.json
|
300
|
+
- spec/fixtures/advanced/video/get_by_tag.json
|
301
|
+
- spec/fixtures/advanced/video/get_cast.json
|
302
|
+
- spec/fixtures/advanced/video/get_comments_list.json
|
303
|
+
- spec/fixtures/advanced/video/get_contacts_liked.json
|
304
|
+
- spec/fixtures/advanced/video/get_contacts_uploaded.json
|
305
|
+
- spec/fixtures/advanced/video/get_info.json
|
306
|
+
- spec/fixtures/advanced/video/get_likes.json
|
307
|
+
- spec/fixtures/advanced/video/get_subscriptions.json
|
308
|
+
- spec/fixtures/advanced/video/get_thumbnail_urls.json
|
309
|
+
- spec/fixtures/advanced/video/get_uploaded.json
|
310
|
+
- spec/fixtures/advanced/video/remove_cast.json
|
311
|
+
- spec/fixtures/advanced/video/remove_tag.json
|
312
|
+
- spec/fixtures/advanced/video/search.json
|
313
|
+
- spec/fixtures/advanced/video/set_description.json
|
314
|
+
- spec/fixtures/advanced/video/set_like.json
|
315
|
+
- spec/fixtures/advanced/video/set_privacy.json
|
316
|
+
- spec/fixtures/advanced/video/set_title.json
|
317
|
+
- spec/fixtures/advanced/video_embed/get_presets.json
|
318
|
+
- spec/fixtures/advanced/video_embed/set_preset.json
|
319
|
+
- spec/fixtures/oembed/oembed.json.erb
|
320
|
+
- spec/fixtures/simple/activity/contacts_did.json
|
321
|
+
- spec/fixtures/simple/activity/everyone_did.json
|
322
|
+
- spec/fixtures/simple/activity/happened_to_contacts.json
|
323
|
+
- spec/fixtures/simple/activity/happened_to_user.json
|
324
|
+
- spec/fixtures/simple/activity/user_did.json
|
325
|
+
- spec/fixtures/simple/album/info.json
|
326
|
+
- spec/fixtures/simple/album/videos.json
|
327
|
+
- spec/fixtures/simple/channel/info.json
|
328
|
+
- spec/fixtures/simple/channel/videos.json
|
329
|
+
- spec/fixtures/simple/group/info.json
|
330
|
+
- spec/fixtures/simple/group/users.json
|
331
|
+
- spec/fixtures/simple/group/videos.json
|
332
|
+
- spec/fixtures/simple/user/albums.json
|
333
|
+
- spec/fixtures/simple/user/all_videos.json
|
334
|
+
- spec/fixtures/simple/user/appears_in.json
|
335
|
+
- spec/fixtures/simple/user/channels.json
|
336
|
+
- spec/fixtures/simple/user/contacts_like.json
|
337
|
+
- spec/fixtures/simple/user/contacts_videos.json
|
338
|
+
- spec/fixtures/simple/user/groups.json
|
339
|
+
- spec/fixtures/simple/user/info.json
|
340
|
+
- spec/fixtures/simple/user/likes.json
|
341
|
+
- spec/fixtures/simple/user/subscriptions.json
|
342
|
+
- spec/fixtures/simple/user/videos.json
|
343
|
+
- spec/fixtures/simple/video/info.json
|
344
|
+
- spec/models/active_record_extension_spec.rb
|
345
|
+
- spec/models/vimeo_embed_cache_spec.rb
|
346
|
+
- spec/models/vimeo_meta_cache_spec.rb
|
347
|
+
- spec/models/vimeo_video_spec.rb
|
348
|
+
- spec/samples/taj.jpg
|
349
|
+
- spec/vimeo_helper.rb
|
data/TODO
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
@vimeo_videos
|
2
|
-
Feature: Vimeo Videos
|
3
|
-
In order to have vimeo_videos on my website
|
4
|
-
As an administrator
|
5
|
-
I want to manage vimeo_videos
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given I am a logged in refinery user
|
9
|
-
And I have no vimeo_videos
|
10
|
-
|
11
|
-
@vimeo_videos-list @list
|
12
|
-
Scenario: Vimeo Videos List
|
13
|
-
Given I have vimeo_videos titled UniqueTitleOne, UniqueTitleTwo
|
14
|
-
When I go to the list of vimeo_videos
|
15
|
-
Then I should see "UniqueTitleOne"
|
16
|
-
And I should see "UniqueTitleTwo"
|
17
|
-
|
18
|
-
@vimeo_videos-valid @valid
|
19
|
-
Scenario: Create Valid Vimeo Video
|
20
|
-
When I go to the list of vimeo_videos
|
21
|
-
And I follow "Add New Vimeo Video"
|
22
|
-
And I fill in "Title" with "This is a test of the first string field"
|
23
|
-
And I press "Save"
|
24
|
-
Then I should see "'This is a test of the first string field' was successfully added."
|
25
|
-
And I should have 1 vimeo_video
|
26
|
-
|
27
|
-
@vimeo_videos-invalid @invalid
|
28
|
-
Scenario: Create Invalid Vimeo Video (without title)
|
29
|
-
When I go to the list of vimeo_videos
|
30
|
-
And I follow "Add New Vimeo Video"
|
31
|
-
And I press "Save"
|
32
|
-
Then I should see "Title can't be blank"
|
33
|
-
And I should have 0 vimeo_videos
|
34
|
-
|
35
|
-
@vimeo_videos-edit @edit
|
36
|
-
Scenario: Edit Existing Vimeo Video
|
37
|
-
Given I have vimeo_videos titled "A title"
|
38
|
-
When I go to the list of vimeo_videos
|
39
|
-
And I follow "Edit this vimeo_video" within ".actions"
|
40
|
-
Then I fill in "Title" with "A different title"
|
41
|
-
And I press "Save"
|
42
|
-
Then I should see "'A different title' was successfully updated."
|
43
|
-
And I should be on the list of vimeo_videos
|
44
|
-
And I should not see "A title"
|
45
|
-
|
46
|
-
@vimeo_videos-duplicate @duplicate
|
47
|
-
Scenario: Create Duplicate Vimeo Video
|
48
|
-
Given I only have vimeo_videos titled UniqueTitleOne, UniqueTitleTwo
|
49
|
-
When I go to the list of vimeo_videos
|
50
|
-
And I follow "Add New Vimeo Video"
|
51
|
-
And I fill in "Title" with "UniqueTitleTwo"
|
52
|
-
And I press "Save"
|
53
|
-
Then I should see "There were problems"
|
54
|
-
And I should have 2 vimeo_videos
|
55
|
-
|
56
|
-
@vimeo_videos-delete @delete
|
57
|
-
Scenario: Delete Vimeo Video
|
58
|
-
Given I only have vimeo_videos titled UniqueTitleOne
|
59
|
-
When I go to the list of vimeo_videos
|
60
|
-
And I follow "Remove this vimeo video forever"
|
61
|
-
Then I should see "'UniqueTitleOne' was successfully removed."
|
62
|
-
And I should have 0 vimeo_videos
|
63
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
Given /^I have no vimeo_videos$/ do
|
2
|
-
VimeoVideo.delete_all
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^I (only )?have vimeo_videos titled "?([^\"]*)"?$/ do |only, titles|
|
6
|
-
VimeoVideo.delete_all if only
|
7
|
-
titles.split(', ').each do |title|
|
8
|
-
VimeoVideo.create(:title => title)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
Then /^I should have ([0-9]+) vimeo_videos?$/ do |count|
|
13
|
-
VimeoVideo.count.should == count.to_i
|
14
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'factory_girl'
|
2
|
-
|
3
|
-
Factory.define :user do |u|
|
4
|
-
u.sequence(:username) { |n| "person#{n}" }
|
5
|
-
u.sequence(:email) { |n| "person#{n}@cucumber.com" }
|
6
|
-
u.password "greenandjuicy"
|
7
|
-
u.password_confirmation "greenandjuicy"
|
8
|
-
end
|
9
|
-
|
10
|
-
Factory.define :refinery_user, :parent => :user do |u|
|
11
|
-
u.roles { [ Role[:refinery] ] }
|
12
|
-
|
13
|
-
u.after_create do |user|
|
14
|
-
Refinery::Plugins.registered.each_with_index do |plugin, index|
|
15
|
-
user.plugins.create(:name => plugin.name, :position => index)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/features/support/paths.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module NavigationHelpers
|
2
|
-
module Refinery
|
3
|
-
module VimeoVideos
|
4
|
-
def path_to(page_name)
|
5
|
-
case page_name
|
6
|
-
when /the list of vimeo_videos/
|
7
|
-
admin_vimeo_videos_path
|
8
|
-
|
9
|
-
when /the new vimeo_video form/
|
10
|
-
new_admin_vimeo_video_path
|
11
|
-
else
|
12
|
-
nil
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|