framey 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -5
- data/lib/rails/generators/framey/framey_generator.rb +19 -7
- data/{app/views/layouts → lib/rails/generators/framey/templates}/framey.html.erb +0 -0
- data/{app/views/framey/videos → lib/rails/generators/framey/templates}/index.html.erb +0 -1
- data/lib/rails/generators/framey/templates/initializer.rb +3 -8
- data/{public → lib/rails/generators/framey/templates}/javascripts/swfobject.js +0 -0
- data/{app/views/framey/videos → lib/rails/generators/framey/templates}/new.html.erb +0 -0
- data/{app/views/framey/videos → lib/rails/generators/framey/templates}/show.html.erb +0 -0
- data/{public → lib/rails/generators/framey/templates}/stylesheets/framey.css +0 -0
- data/{app/models/framey → lib/rails/generators/framey/templates}/video.rb +0 -0
- data/{app/controllers/framey → lib/rails/generators/framey/templates}/videos_controller.rb +1 -3
- data/lib/view_helpers.rb +2 -2
- metadata +16 -28
- data/app/helpers/application_helper.rb +0 -2
- data/app/helpers/framey/videos_helper.rb +0 -4
- data/config/routes.rb +0 -13
- data/lib/acts_as_video/base.rb +0 -28
- data/lib/application_controller.rb +0 -12
- data/lib/application_helper.rb +0 -3
- data/lib/engine.rb +0 -30
- data/lib/framey.rb +0 -9
- data/lib/rails/railties/tasks.rake +0 -4
- data/public/images/cheese.jpg +0 -0
- data/public/player.swf +0 -0
- data/public/recorder.swf +0 -0
data/README.md
CHANGED
@@ -5,7 +5,7 @@ This gem can be used for easy Rails integration with the Framey video recording
|
|
5
5
|
# Dependencies:
|
6
6
|
|
7
7
|
* httparty (ruby gem)
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
# Installation
|
11
11
|
|
@@ -51,16 +51,16 @@ Edit the default configuration options in config/framey.rb:
|
|
51
51
|
|
52
52
|
Create a framey initializer at config/framey.rb and modify the following code to use your API keys
|
53
53
|
|
54
|
-
module Framey
|
54
|
+
module Framey
|
55
55
|
API_HOST = "http://framey.com"
|
56
56
|
RUN_ENV = "production"
|
57
57
|
API_KEY = "API_KEY_VALUE"
|
58
58
|
SECRET = "API_SECRET_VALUE"
|
59
59
|
API_TIMEOUT = 15
|
60
60
|
MAX_TIME = 30
|
61
|
+
FLASH_RECORDER_URL = 'http://framey.com/recorder.swf'
|
62
|
+
FLASH_PLAYER_URL = 'http://framey.com/player.swf'
|
61
63
|
end
|
62
|
-
|
63
|
-
|
64
64
|
|
65
65
|
# User / Development Flow
|
66
66
|
|
@@ -123,7 +123,7 @@ To get updated stats information about a given video, do:
|
|
123
123
|
|
124
124
|
This returns a simple Framey::Video object, like so:
|
125
125
|
|
126
|
-
#<Framey::Video:0x1037b4450 @state="uploaded", @filesize=123456, @name="c96323e0-54b1-012e-9d34-7c6d628c53d4",
|
126
|
+
#<Framey::Video:0x1037b4450 @state="uploaded", @filesize=123456, @name="c96323e0-54b1-012e-9d34-7c6d628c53d4", @large_thumbnail_url="http://framey.com/thumbnails/c96323e0-54b1-012e-9d34-7c6d628c53d4.jpg", @medium_thumbnail_url="http://framey.com/thumbnails/c96323e0-54b1-012e-9d34-7c6d628c53d4.jpg", @small_thumbnail_url="http://framey.com/thumbnails/c96323e0-54b1-012e-9d34-7c6d628c53d4.jpg", @data={"user_id" => 1}, @flv_url="http://framey.com/videos/source/c96323e0-54b1-012e-9d34-7c6d628c53d4/source.flv", @mp4_url="http://framey.com/videos/source/c96323e0-54b1-012e-9d34-7c6d628c53d4/source.mp4", @views=12, @duration=15.62>
|
127
127
|
|
128
128
|
To delete a video on Framey, do:
|
129
129
|
|
@@ -9,7 +9,6 @@ class FrameyGenerator < Rails::Generators::Base
|
|
9
9
|
|
10
10
|
def self.source_root
|
11
11
|
sources = File.join(File.dirname(__FILE__), 'templates')
|
12
|
-
|
13
12
|
end
|
14
13
|
|
15
14
|
def self.next_migration_number(dirname) #:nodoc:
|
@@ -66,22 +65,35 @@ class FrameyGenerator < Rails::Generators::Base
|
|
66
65
|
end
|
67
66
|
|
68
67
|
def copy_views
|
69
|
-
copy_file '
|
70
|
-
copy_file '
|
71
|
-
copy_file '
|
72
|
-
copy_file '
|
68
|
+
copy_file 'index.html.erb', 'app/views/framey/videos/index.html.erb'
|
69
|
+
copy_file 'new.html.erb', 'app/views/framey/videos/new.html.erb'
|
70
|
+
copy_file 'show.html.erb', 'app/views/framey/videos/show.html.erb'
|
71
|
+
copy_file 'framey.html.erb', 'app/views/layouts/framey.html.erb'
|
73
72
|
end
|
74
73
|
|
75
74
|
def copy_controllers
|
76
|
-
copy_file '
|
75
|
+
copy_file 'videos_controller.rb', 'app/controllers/framey/videos_controller.rb'
|
77
76
|
end
|
78
77
|
|
79
78
|
def copy_models
|
80
|
-
copy_file '
|
79
|
+
copy_file 'video.rb', 'app/models/framey/video.rb'
|
81
80
|
end
|
82
81
|
|
82
|
+
def copy_public_files
|
83
|
+
copy_file 'javascripts/swfobject.js', 'public/javascripts/swfobject.js'
|
84
|
+
copy_file 'stylesheets/framey.css', 'public/stylesheets/framey.css'
|
85
|
+
end
|
83
86
|
|
84
87
|
|
88
|
+
def add_route
|
89
|
+
|
90
|
+
videos_text = 'namespace :framey do resources :videos, :only => [ :index, :show, :new], :controller => "videos" end'
|
91
|
+
callback_test = 'post "/framey/callback" => "framey/videos#callback"'
|
92
|
+
|
93
|
+
route(videos_text)
|
94
|
+
route(callback_test)
|
95
|
+
|
96
|
+
end
|
85
97
|
|
86
98
|
|
87
99
|
end
|
File without changes
|
@@ -1,16 +1,11 @@
|
|
1
|
-
module Framey
|
2
|
-
class Engine < Rails::Engine
|
3
|
-
|
4
|
-
config.mount_at = '/framey'
|
5
|
-
config.video_factory_name = 'Framey Factory'
|
6
|
-
|
7
|
-
end
|
8
|
-
|
1
|
+
module Framey
|
9
2
|
API_HOST = "http://framey.com"
|
10
3
|
RUN_ENV = "production"
|
11
4
|
API_KEY = "API_KEY_VALUE"
|
12
5
|
SECRET = "API_SECRET_VALUE"
|
13
6
|
API_TIMEOUT = 15
|
14
7
|
MAX_TIME = 30
|
8
|
+
FLASH_RECORDER_URL = 'http://framey.com/recorder.swf'
|
9
|
+
FLASH_PLAYER_URL = 'http://framey.com/player.swf'
|
15
10
|
end
|
16
11
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module Framey
|
2
2
|
class VideosController < ApplicationController
|
3
|
-
|
4
|
-
unloadable
|
5
3
|
|
6
4
|
layout 'framey' # this allows you to have a gem-wide layout
|
7
5
|
|
@@ -30,7 +28,7 @@ module Framey
|
|
30
28
|
end
|
31
29
|
|
32
30
|
def index
|
33
|
-
@videos = Framey::Video.
|
31
|
+
@videos = Framey::Video.all
|
34
32
|
|
35
33
|
end
|
36
34
|
|
data/lib/view_helpers.rb
CHANGED
@@ -39,7 +39,7 @@ raw <<END_RECORDER
|
|
39
39
|
'id': "#{objid}",
|
40
40
|
'name': "#{objid}"
|
41
41
|
};
|
42
|
-
swfobject.embedSWF(
|
42
|
+
swfobject.embedSWF('#{Framey::FLASH_RECORDER_URL}', "#{divid}", "340", "340", "8", "", flashvars, params, attributes);
|
43
43
|
</script>
|
44
44
|
END_RECORDER
|
45
45
|
end
|
@@ -87,7 +87,7 @@ raw <<END_PLAYER
|
|
87
87
|
'name': "#{objid}"
|
88
88
|
};
|
89
89
|
|
90
|
-
swfobject.embedSWF(
|
90
|
+
swfobject.embedSWF('#{Framey::FLASH_PLAYER_URL}', "#{divid}", '340', '290', '9', 'false', flashvars, params, attributes);
|
91
91
|
</script>
|
92
92
|
END_PLAYER
|
93
93
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: framey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-
|
12
|
+
date: 2011-09-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156334060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156334060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: will_paginate
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156332800 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156332800
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156330860 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2156330860
|
47
47
|
description: A gem for easy Rails integration with the Framey video recording service.
|
48
48
|
email: david@qlabs.com
|
49
49
|
executables: []
|
@@ -51,32 +51,20 @@ extensions: []
|
|
51
51
|
extra_rdoc_files:
|
52
52
|
- README.md
|
53
53
|
files:
|
54
|
-
- app/controllers/framey/videos_controller.rb
|
55
|
-
- app/helpers/application_helper.rb
|
56
|
-
- app/helpers/framey/videos_helper.rb
|
57
|
-
- app/models/framey/video.rb
|
58
|
-
- app/views/framey/videos/index.html.erb
|
59
|
-
- app/views/framey/videos/new.html.erb
|
60
|
-
- app/views/framey/videos/show.html.erb
|
61
|
-
- app/views/layouts/framey.html.erb
|
62
|
-
- config/routes.rb
|
63
|
-
- lib/acts_as_video/base.rb
|
64
54
|
- lib/api.rb
|
65
|
-
- lib/application_controller.rb
|
66
|
-
- lib/application_helper.rb
|
67
|
-
- lib/engine.rb
|
68
|
-
- lib/framey.rb
|
69
55
|
- lib/rails/generators/framey/framey_generator.rb
|
56
|
+
- lib/rails/generators/framey/templates/framey.html.erb
|
57
|
+
- lib/rails/generators/framey/templates/index.html.erb
|
70
58
|
- lib/rails/generators/framey/templates/initializer.rb
|
59
|
+
- lib/rails/generators/framey/templates/javascripts/swfobject.js
|
71
60
|
- lib/rails/generators/framey/templates/migration.rb
|
61
|
+
- lib/rails/generators/framey/templates/new.html.erb
|
72
62
|
- lib/rails/generators/framey/templates/schema.rb
|
73
|
-
- lib/rails/
|
63
|
+
- lib/rails/generators/framey/templates/show.html.erb
|
64
|
+
- lib/rails/generators/framey/templates/stylesheets/framey.css
|
65
|
+
- lib/rails/generators/framey/templates/video.rb
|
66
|
+
- lib/rails/generators/framey/templates/videos_controller.rb
|
74
67
|
- lib/view_helpers.rb
|
75
|
-
- public/images/cheese.jpg
|
76
|
-
- public/javascripts/swfobject.js
|
77
|
-
- public/player.swf
|
78
|
-
- public/recorder.swf
|
79
|
-
- public/stylesheets/framey.css
|
80
68
|
- README.md
|
81
69
|
homepage: http://framey.com
|
82
70
|
licenses: []
|
data/config/routes.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Rails.application.routes.draw do |map|
|
2
|
-
|
3
|
-
mount_at = Framey::Engine.config.mount_at
|
4
|
-
|
5
|
-
match mount_at => 'framey/videos#index'
|
6
|
-
|
7
|
-
map.resources :videos, :only => [ :index, :show, :new],
|
8
|
-
:controller => "framey/videos",
|
9
|
-
:path_prefix => mount_at,
|
10
|
-
:name_prefix => "framey_"
|
11
|
-
post "/framey/callback" => "framey/videos#callback"
|
12
|
-
|
13
|
-
end
|
data/lib/acts_as_video/base.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
module Framey
|
2
|
-
module ActsAsVideo
|
3
|
-
|
4
|
-
## Define ModelMethods
|
5
|
-
module Base
|
6
|
-
def self.included(klass)
|
7
|
-
klass.class_eval do
|
8
|
-
extend Config
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
module Config
|
13
|
-
def acts_as_video
|
14
|
-
|
15
|
-
# This is where arbitrary code goes that you want to
|
16
|
-
# add to the class that declared "acts_as_widget"
|
17
|
-
|
18
|
-
has_many :videos, :class_name => 'Framey::Video'
|
19
|
-
|
20
|
-
include Framey::ActsAsVideo::Base::InstanceMethods
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
::ActiveRecord::Base.send :include, Framey::ActsAsVideo::Base
|
data/lib/application_helper.rb
DELETED
data/lib/engine.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'framey'
|
2
|
-
require 'rails'
|
3
|
-
require 'action_controller'
|
4
|
-
require 'application_helper'
|
5
|
-
|
6
|
-
module Framey
|
7
|
-
class Engine < Rails::Engine
|
8
|
-
|
9
|
-
# Config defaults
|
10
|
-
config.video_factory_name = "default factory name"
|
11
|
-
config.mount_at = '/framey'
|
12
|
-
|
13
|
-
# Load rake tasks
|
14
|
-
rake_tasks do
|
15
|
-
load File.join(File.dirname(__FILE__), 'rails/railties/tasks.rake')
|
16
|
-
end
|
17
|
-
|
18
|
-
# Check the gem config
|
19
|
-
initializer "check config" do |app|
|
20
|
-
|
21
|
-
# make sure mount_at ends with trailing slash
|
22
|
-
config.mount_at += '/' unless config.mount_at.last == '/'
|
23
|
-
end
|
24
|
-
|
25
|
-
initializer "static assets" do |app|
|
26
|
-
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
data/lib/framey.rb
DELETED
data/public/images/cheese.jpg
DELETED
Binary file
|
data/public/player.swf
DELETED
Binary file
|
data/public/recorder.swf
DELETED
Binary file
|