useful_helpers 0.0.26 → 0.0.27
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.
@@ -8,6 +8,7 @@ require "useful_helpers/helpers/paginate_helper"
|
|
8
8
|
require "useful_helpers/helpers/seo_helper"
|
9
9
|
require "useful_helpers/helpers/url_helper"
|
10
10
|
require "useful_helpers/helpers/text_helper"
|
11
|
+
require "useful_helpers/helpers/videos_helper"
|
11
12
|
|
12
13
|
module UsefulHelpers
|
13
14
|
class Engine < ::Rails::Engine
|
@@ -24,6 +25,7 @@ module UsefulHelpers
|
|
24
25
|
ActionView::Base.send :include, UsefulHelpers::Helpers::SeoHelper
|
25
26
|
ActionView::Base.send :include, UsefulHelpers::Helpers::UrlHelper
|
26
27
|
ActionView::Base.send :include, UsefulHelpers::Helpers::TextHelper
|
28
|
+
ActionView::Base.send :include, UsefulHelpers::Helpers::VideosHelper
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
module UsefulHelpers
|
3
|
+
module Helpers
|
4
|
+
module VideosHelper
|
5
|
+
def url_for_video(source_path)
|
6
|
+
"http://" + request.url.split("/")[2] + source_path
|
7
|
+
end
|
8
|
+
|
9
|
+
def url_for_video_thumbnail(video, style=:small)
|
10
|
+
video.data.url(style)
|
11
|
+
end
|
12
|
+
|
13
|
+
def video_thumbnail(video, style=:small)
|
14
|
+
raw "<img src=\"#{video.data.url(style)}\" alt=\"#{video.title}\" />"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useful_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.27
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/useful_helpers/helpers/seo_helper.rb
|
89
89
|
- lib/useful_helpers/helpers/text_helper.rb
|
90
90
|
- lib/useful_helpers/helpers/url_helper.rb
|
91
|
+
- lib/useful_helpers/helpers/videos_helper.rb
|
91
92
|
- lib/useful_helpers/version.rb
|
92
93
|
- useful_helpers.gemspec
|
93
94
|
homepage: https://github.com/st-granat/useful_helpers
|