onebox 1.5.19 → 1.5.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onebox/engine/twitter_status_onebox.rb +1 -1
- data/lib/onebox/layout.rb +4 -7
- data/lib/onebox/template_support.rb +11 -0
- data/lib/onebox/version.rb +1 -1
- data/lib/onebox/view.rb +5 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd245b860952c9a28eb5447bc161ac33faf88c7
|
4
|
+
data.tar.gz: 22c1a7591f80bc67dad9b9b496de3351b167958c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7007497474adad17ad08fefe10c19dfe3a1a5c785b2dfe6de0d34895ef7788b71cfa5d8b31510f4201ba07ace156c7496accf17c14ffea36a0cd2b00385a7a2b
|
7
|
+
data.tar.gz: 29b0731949d0efdd0285d15b8e920df917725a022f64c2245dbbde689bc70b5ed3fbbe278091d990423f0f220decf33174a8198ee85e2cda613de92cb09266bb
|
data/lib/onebox/layout.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
+
require_relative "template_support"
|
2
|
+
|
1
3
|
module Onebox
|
2
4
|
class Layout < Mustache
|
5
|
+
include TemplateSupport
|
6
|
+
|
3
7
|
VERSION = "1.0.0"
|
4
8
|
|
5
9
|
attr_reader :cache
|
@@ -33,13 +37,6 @@ module Onebox
|
|
33
37
|
@uri = URI(link)
|
34
38
|
end
|
35
39
|
|
36
|
-
def load_paths
|
37
|
-
Onebox.options.load_paths.select(&method(:template?))
|
38
|
-
end
|
39
|
-
|
40
|
-
def template?(path)
|
41
|
-
File.exist?(File.join(path, "#{template_name}.#{template_extension}"))
|
42
|
-
end
|
43
40
|
|
44
41
|
def checksum
|
45
42
|
@md5.hexdigest("#{VERSION}:#{link}")
|
data/lib/onebox/version.rb
CHANGED
data/lib/onebox/view.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
require_relative "template_support"
|
2
|
+
|
1
3
|
module Onebox
|
2
4
|
class View < Mustache
|
3
|
-
|
5
|
+
include TemplateSupport
|
4
6
|
|
5
|
-
|
7
|
+
attr_reader :record
|
6
8
|
|
7
9
|
def initialize(name, record)
|
8
10
|
@record = record
|
9
11
|
self.template_name = name
|
12
|
+
self.template_path = load_paths.last
|
10
13
|
end
|
11
14
|
|
12
15
|
def to_html
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joanna Zeta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -316,6 +316,7 @@ files:
|
|
316
316
|
- lib/onebox/layout_support.rb
|
317
317
|
- lib/onebox/matcher.rb
|
318
318
|
- lib/onebox/preview.rb
|
319
|
+
- lib/onebox/template_support.rb
|
319
320
|
- lib/onebox/version.rb
|
320
321
|
- lib/onebox/view.rb
|
321
322
|
- lib/onebox/web.rb
|
@@ -464,3 +465,4 @@ test_files:
|
|
464
465
|
- spec/lib/onebox_spec.rb
|
465
466
|
- spec/spec_helper.rb
|
466
467
|
- spec/support/html_spec_helper.rb
|
468
|
+
has_rdoc:
|