convert 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286893621976fa621ce3f805b50cd9415503d37f
4
- data.tar.gz: e654728de45ba0ec4db9d26d1726eb352792aca9
3
+ metadata.gz: efbe8933520a3df3df19a696860fdfa36e46bbb3
4
+ data.tar.gz: f5d4f69d27866528472b01e88c355c0bc8c04880
5
5
  SHA512:
6
- metadata.gz: a1007c444a7249bcc1ac1dc7d3f4cf03c5d80298beccf7e4b6176cf87cb00e8f4f93212d59eb1d9d5ecf4acebc3e7206ccc0e0293671c2f3a950c5e03dcec8cf
7
- data.tar.gz: c65f03b352274ee6d887021d05a848d507ee0cd636488ce23acaf79e3a9164d2d97d17fe7f8a4869cfabe4d71744a33a7cb98ef512fa7656bb92f1f912da5d7a
6
+ metadata.gz: 2e6cf0cfef2c2554a3bdc7f618ddd4694409cfcdb0fe15aca56eaf53c874a009bb9cf9be9840046c897ae480ac9d3caafb33bccfc2c268f82261465a23058fbc
7
+ data.tar.gz: 8ce2123522d35f2e8c801b20ba9a2e150dad511e90cadc119c2936628fda80a9464ee18c72be47881b2efa0c0a72860d111b5989afcf00acee9f45a4476f8abf
data/CHANGELOG.md CHANGED
@@ -1,8 +1,13 @@
1
- **Version 0.1.5** - *2016-28-01*
1
+ **Version 0.1.6** - *2017-26-04*
2
+
3
+ - Added Facebook embed
4
+ - Fixed an issue with vimeo_embed merge options
5
+
6
+ **Version 0.1.5** - *2017-28-01*
2
7
 
3
8
  - Added CSS styles to full and custom configs
4
9
 
5
- **Version 0.1.4** - *2016-15-01*
10
+ **Version 0.1.4** - *2017-15-01*
6
11
 
7
12
  - Added simpleidn support with to_ascii and to_unicode
8
13
  - Fixed nil exception when converter list for scan is empty
data/convert.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'convert'
3
- s.version = '0.1.5'
4
- s.date = '2017-01-28'
3
+ s.version = '0.1.6'
4
+ s.date = '2017-04-26'
5
5
  s.summary = "Convert strings and HTML to links and embedded content"
6
6
  s.description = "Easily convert any string and replace with links and embedded content from a long list of providers and libraries."
7
7
  s.authors = ["Fugroup Limited"]
data/lib/convert.rb CHANGED
@@ -25,7 +25,7 @@ module Convert
25
25
 
26
26
  # Some of the matchers are taken from https://github.com/dejan/auto_html
27
27
 
28
- CONVERTERS = [:iframe_embed, :dailymotion, :email_escape, :flickr, :gist, :google_maps, :hashtag, :escape_html, :image_tag, :instagram, :liveleak, :markdown, :metacafe, :redcarpet, :soundcloud, :ted, :twitter, :video_embed, :vimeo, :vimeo_embed, :worldstar, :youtube, :youtube_embed, :youtube_js_api, :auto_link, :encode, :decode, :strip_params, :sanitize, :scan, :to_ascii, :to_unicode]
28
+ CONVERTERS = [:iframe_embed, :dailymotion, :email_escape, :facebook_embed, :flickr, :gist, :google_maps, :hashtag, :escape_html, :image_tag, :instagram, :liveleak, :markdown, :metacafe, :redcarpet, :soundcloud, :ted, :twitter, :video_embed, :vimeo, :vimeo_embed, :worldstar, :youtube, :youtube_embed, :youtube_js_api, :auto_link, :encode, :decode, :strip_params, :sanitize, :scan, :to_ascii, :to_unicode]
29
29
 
30
30
  DEFAULT = [:dailymotion, :flickr, :gist, :google_maps, :instagram, :liveleak, :metacafe, :soundcloud, :ted, :twitter, :vimeo, :worldstar, :youtube, :auto_link]
31
31
 
@@ -0,0 +1,12 @@
1
+ module Convert
2
+ module Converters
3
+
4
+ # Embed vimeo by id
5
+ def facebook_embed(string, options = {})
6
+ options = {:width => 590, :height => 335}.merge(options)
7
+
8
+ %{<iframe src="https://www.facebook.com/plugins/video.php?href=https://www.facebook.com/facebook/videos/#{string}/&width=#{options[:width]}&show_text=false&height=#{options[:height]}" width="#{options[:width]}" height="#{options[:height]}" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>}
9
+ end
10
+
11
+ end
12
+ end
@@ -4,7 +4,7 @@ module Convert
4
4
  def flickr(string, options = {})
5
5
  # https://www.flickr.com/photos/fotokunstsusanne/23160248869
6
6
 
7
- {:maxwidth => nil, :maxheight => nil, :link_options => {}}.merge(options)
7
+ options = {:maxwidth => nil, :maxheight => nil, :link_options => {}}.merge(options)
8
8
  @regex = %r{https?://(www\.)?flickr\.com/photos/[^\s<]*}
9
9
 
10
10
  string.gsub(@regex) do |match|
@@ -15,7 +15,7 @@ module Convert
15
15
  http.use_ssl = true
16
16
 
17
17
  response = JSON.parse(http.get(uri.request_uri).body)
18
- response["html"]
18
+ response['html']
19
19
  end
20
20
  end
21
21
 
@@ -3,7 +3,7 @@ module Convert
3
3
 
4
4
  # Embed vimeo by id
5
5
  def vimeo_embed(string, options = {})
6
- {:width => 590, :height => 335}.merge(options)
6
+ options = {:width => 590, :height => 335}.merge(options)
7
7
 
8
8
  %{<iframe src="https://player.vimeo.com/video/#{string}?title=0&byline=0&portrait=0" width="#{options[:width]}" height="#{options[:height]}"></iframe>}
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fugroup Limited
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-28 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet
@@ -142,6 +142,7 @@ files:
142
142
  - lib/converters/decode.rb
143
143
  - lib/converters/email_escape.rb
144
144
  - lib/converters/encode.rb
145
+ - lib/converters/facebook_embed.rb
145
146
  - lib/converters/flickr.rb
146
147
  - lib/converters/gist.rb
147
148
  - lib/converters/google_maps.rb
@@ -196,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
197
  version: '0'
197
198
  requirements: []
198
199
  rubyforge_project:
199
- rubygems_version: 2.6.8
200
+ rubygems_version: 2.6.10
200
201
  signing_key:
201
202
  specification_version: 4
202
203
  summary: Convert strings and HTML to links and embedded content