vjs_rails 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +39 -15
- data/lib/generators/vjs_rails/assets/USAGE +9 -0
- data/lib/generators/vjs_rails/assets/assets_generator.rb +21 -0
- data/lib/generators/vjs_rails/assets/templates/vjs.css.erb +955 -0
- data/lib/generators/vjs_rails/assets/templates/vjs.less.erb +1161 -0
- data/lib/vjs_rails/engine.rb +7 -0
- data/lib/vjs_rails/version.rb +1 -1
- data/lib/vjs_rails.rb +0 -1
- metadata +6 -4
- data/lib/tasks/vjs_rails_tasks.rake +0 -4
- data/lib/vjs_rails/railtie.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 848a92d1d2b8b3eb64302acf15ace739bb80f348
|
4
|
+
data.tar.gz: 5512cd6a33cd1b64636b230dd9f188d4c0a12ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3a9be167d0b5d9ddd296bab88901767c0920f5f6b7ebd599530783032efa3bbf8097139d67f6c61e54c40d6bd4da3ada68042d7133ad13eb43bb0c0caab9365
|
7
|
+
data.tar.gz: 6e6a31013c13ffb59eb029f86d9a6eaa34889b64c16d9402b3e4502f125d7d464ff6a5ae432f2a0643b1426b419d56ea045801137edb636c07aa876c01611a89
|
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
[](https://travis-ci.org/kouhei-fuji/vjs_rails) [](https://coveralls.io/r/kouhei-fuji/vjs_rails) [](http://badge.fury.io/rb/vjs_rails)
|
4
4
|
|
5
|
-
VjsRails is for using Video.js in Rails applications.
|
5
|
+
VjsRails is for using Video.js in Rails applications. It works in [Turbolinks](https://github.com/rails/turbolinks).
|
6
6
|
|
7
7
|
Video.js:
|
8
8
|
|
9
|
-
-
|
9
|
+
- Version 4.9.1
|
10
10
|
- http://www.videojs.com/
|
11
11
|
|
12
12
|
## Installation
|
@@ -44,22 +44,48 @@ In your `application.js`:
|
|
44
44
|
//= require vjs.flash
|
45
45
|
|
46
46
|
# if you want to use a Japanese version
|
47
|
-
# see more:
|
47
|
+
# see more: vendor/assets/langs/
|
48
48
|
//= require vjs.ja
|
49
49
|
```
|
50
50
|
In your `application.css`:
|
51
51
|
|
52
52
|
```css
|
53
|
-
|
54
|
-
*= require vjs
|
55
|
-
*
|
56
|
-
* If you want to customize it, see: http://designer.videojs.com/
|
57
|
-
* you can copy and add your customized css instead of `vjs`
|
58
|
-
*
|
59
|
-
*= require my_custom_css
|
60
|
-
*/
|
53
|
+
*= require vjs
|
61
54
|
```
|
62
55
|
|
56
|
+
If you want to customize css:
|
57
|
+
|
58
|
+
```
|
59
|
+
$ bin/rails g vjs_rails:assets --help
|
60
|
+
Usage:
|
61
|
+
rails generate vjs_rails:assets [FILE_NAME] [options]
|
62
|
+
|
63
|
+
Options:
|
64
|
+
-l, [--less], [--no-less] # Create LESS file instead of CSS
|
65
|
+
|
66
|
+
Runtime options:
|
67
|
+
-f, [--force] # Overwrite files that already exist
|
68
|
+
-p, [--pretend], [--no-pretend] # Run but do not make any changes
|
69
|
+
-q, [--quiet], [--no-quiet] # Suppress status output
|
70
|
+
-s, [--skip], [--no-skip] # Skip files that already exist
|
71
|
+
|
72
|
+
Description:
|
73
|
+
Creates the Video.js CSS file to your application.
|
74
|
+
|
75
|
+
Example:
|
76
|
+
rails g vjs_rails:assets [FILE_NAME]
|
77
|
+
|
78
|
+
This will create:
|
79
|
+
DEFAULT: app/assets/stylesheets/vjs.css.erb
|
80
|
+
FILE_NAME: app/assets/stylesheets/FILE_NAME.css.erb
|
81
|
+
|
82
|
+
$ bin/rails g vjs_rails:assets
|
83
|
+
create app/assets/stylesheets/vjs.css.erb
|
84
|
+
```
|
85
|
+
|
86
|
+
Or: You can create customized css in [VIDEO.JS PLAYER DESIGNER](http://designer.videojs.com/).
|
87
|
+
|
88
|
+
|
63
89
|
### Use VjsRails Helper
|
64
90
|
|
65
91
|
In your `xxx.html.haml`:
|
@@ -87,9 +113,7 @@ If you don't use haml, please replace it.
|
|
87
113
|
|
88
114
|
## Example
|
89
115
|
|
90
|
-
VjsRails provides an example rails application in spec/dummy directory.
|
91
|
-
|
92
|
-
https://github.com/kouhei-fuji/vjs_rails/tree/master/spec/dummy
|
116
|
+
VjsRails provides an example rails application in [spec/dummy directory](https://github.com/kouhei-fuji/vjs_rails/tree/master/spec/dummy).
|
93
117
|
|
94
118
|
```
|
95
119
|
$ git clone git@github.com:kouhei-fuji/vjs_rails.git
|
@@ -109,4 +133,4 @@ $ open http://localhost:3000
|
|
109
133
|
|
110
134
|
## License
|
111
135
|
|
112
|
-
VjsRails under the [MIT License](https://github.com/kouhei-fuji/vjs_rails/blob/master/MIT-LICENSE).
|
136
|
+
VjsRails is under the [MIT License](https://github.com/kouhei-fuji/vjs_rails/blob/master/MIT-LICENSE).
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rails/generators/base'
|
3
|
+
|
4
|
+
module VjsRails
|
5
|
+
module Generators
|
6
|
+
class AssetsGenerator < ::Rails::Generators::Base
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
desc File.read(File.expand_path('../USAGE', __FILE__))
|
9
|
+
argument :file_name, type: :string, default: 'vjs'
|
10
|
+
class_option :less, type: :boolean, default: false, desc: 'Create LESS file instead of CSS', aliases: '-l'
|
11
|
+
|
12
|
+
def copy_vjs_css
|
13
|
+
if options.less?
|
14
|
+
copy_file 'vjs.less.erb', "app/assets/stylesheets/#{file_name}.less.erb"
|
15
|
+
else
|
16
|
+
copy_file 'vjs.css.erb', "app/assets/stylesheets/#{file_name}.css.erb"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|