onebox 1.4.2 → 1.4.3

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: dfb22dedea89c381450ccf63ae9da171c23bc440
4
- data.tar.gz: 28a8cd2f86a5cf877d47a816e22c641362004135
3
+ metadata.gz: 361d952da51eeaae06dd188e243d16d04fcd8691
4
+ data.tar.gz: dae28e5bddf77ee0b3f5651205b3da7dfe214f91
5
5
  SHA512:
6
- metadata.gz: ce5fb80ea6b2d3caea0b19c56b843ff5fb393c83b86ca9d7df0861f74d6cddf510962716d6bd0c75ca5ecf63205d7cebb07b09e0d43799ac15e1053873b9ff0d
7
- data.tar.gz: a737ad7b4b6dbe1a9042d762de097cdef05cc2453e92b3477474b4184f327d06782dfe21ff4efc99a8153094e7f12a42c6e889a9ff5569707d512c972a7f2d3b
6
+ metadata.gz: 38eaeb38d1b11789fb6f77baab8e81fe335ceaa149e24db6d96223b5e38efa497e18b814d3ba3ee6514a7b62940d481d1bbe7445674e83c59311302385edf5b6
7
+ data.tar.gz: 4c3b62dde2e770a222565663d3fa0bada07c306091ffc48eb418a241c101ccc3f6328a767a1de028b379ad37e33bf68c0a6f5dc72c15544ef61d407dbf15e4db
@@ -9,7 +9,7 @@ module Onebox
9
9
  private
10
10
 
11
11
  def get_xml
12
- doc = Nokogiri::XML(open(@url + "?report=xml&format=text"))
12
+ doc = Nokogiri::XML(open(URI.join(@url, "?report=xml&format=text")))
13
13
  pre = doc.xpath("//pre")
14
14
  Nokogiri::XML("<root>" + pre.text + "</root>")
15
15
  end
@@ -41,9 +41,13 @@ module Onebox
41
41
 
42
42
  def timestamp
43
43
  if raw.html?
44
- raw.css(".metadata span").inner_text
44
+ raw.css(".metadata span")[0].inner_text
45
45
  else
46
- access(:created_at)
46
+ created_at = access(:created_at)
47
+ date = DateTime.strptime(created_at, "%a %b %d %H:%M:%S %z %Y")
48
+ user_offset = access(:user, :utc_offset).to_i
49
+ offset = (user_offset >= 0 ? "+" : "-") + Time.at(user_offset.abs).gmtime.strftime("%H%M")
50
+ date.new_offset(offset).strftime("%l:%M %p - %e %b %Y")
47
51
  end
48
52
  end
49
53
 
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
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.4.2
4
+ version: 1.4.3
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: 2014-07-28 00:00:00.000000000 Z
13
+ date: 2014-08-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  version: '0'
342
342
  requirements: []
343
343
  rubyforge_project:
344
- rubygems_version: 2.1.11
344
+ rubygems_version: 2.2.2
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: A gem for turning URLs into previews.