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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1251f4223fba52393994afd37464bd4871ca7d50
4
- data.tar.gz: 8d08a396a69afd7444ed606b680f62455b9ca772
3
+ metadata.gz: ecd245b860952c9a28eb5447bc161ac33faf88c7
4
+ data.tar.gz: 22c1a7591f80bc67dad9b9b496de3351b167958c
5
5
  SHA512:
6
- metadata.gz: 45b4ac31ab8c0d9d8f27e4b2a05ac356e03138631ddf3a357fa1a38ada58ff9178ea07b8893ac364beb2206331d6b5a8d53cba19f69531a7bb0e6284f6e0ff0e
7
- data.tar.gz: 9161833850d7f2ef5434866c13900203f8d91efc3b62f93988e852184d1a265f4171bac87ba466a77fc324bcd3b26db056f18de5162dbf925314e2e81f518e9b
6
+ metadata.gz: 7007497474adad17ad08fefe10c19dfe3a1a5c785b2dfe6de0d34895ef7788b71cfa5d8b31510f4201ba07ace156c7496accf17c14ffea36a0cd2b00385a7a2b
7
+ data.tar.gz: 29b0731949d0efdd0285d15b8e920df917725a022f64c2245dbbde689bc70b5ed3fbbe278091d990423f0f220decf33174a8198ee85e2cda613de92cb09266bb
@@ -63,7 +63,7 @@ module Onebox
63
63
  if raw.html?
64
64
  raw.css(".avatar")[2]["src"]
65
65
  else
66
- access(:user, :profile_image_url)
66
+ access(:user, :profile_image_url_https)
67
67
  end
68
68
  end
69
69
 
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}")
@@ -0,0 +1,11 @@
1
+ module Onebox
2
+ module TemplateSupport
3
+ def load_paths
4
+ Onebox.options.load_paths.select(&method(:template?))
5
+ end
6
+
7
+ def template?(path)
8
+ File.exist?(File.join(path, "#{template_name}.#{template_extension}"))
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.19"
2
+ VERSION = "1.5.20"
3
3
  end
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
- attr_reader :record
5
+ include TemplateSupport
4
6
 
5
- self.template_path = Onebox.options.load_paths.last
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.19
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-05-26 00:00:00.000000000 Z
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: