convert 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/convert.rb +56 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eefc419abd4caaa5de0f2b5bf89e7a57a3b01578
4
+ data.tar.gz: 7cff0bdb81b275bee194be33ce0bcc5d9b6f38b6
5
+ SHA512:
6
+ metadata.gz: d7dca0451caabeb8e094bc25d640fb00a72730e6634f68181f46a14ea5954281f01abd4215795c96913d4c459bb6b3a4d13981107254baf3faed1c6e4a9e6557
7
+ data.tar.gz: fc10fc1f89a5f7f1ef8c3ffcc81acc99fd548c7550e8c083ba0d0be0fc1dac634f591e95e23a72ef7d7af8d587dade883d95afe525ba5f9c9bc86b9afc9ca0b6
data/lib/convert.rb ADDED
@@ -0,0 +1,56 @@
1
+ module Convert
2
+
3
+ # # # # # #
4
+ # Convert strings and HTML from a long list of providers
5
+ # @homepage: https://github.com/fugroup/convert
6
+ # @author: Vidar <vidar@fugroup.net>, Fugroup Ltd.
7
+ # @license: MIT, contributions are welcome.
8
+ # # # # # #
9
+
10
+ class << self; attr_accessor :converters; end
11
+
12
+ # Set which converters to run: Convert.converters = [:markdown, :auto_html]
13
+ # Default is all
14
+
15
+ @converters = [
16
+ :auto_link,
17
+ :iframe_embed,
18
+ :dailymotion,
19
+ :email_escape,
20
+ :flickr,
21
+ :gist,
22
+ :google_maps,
23
+ :hashtag,
24
+ :html_escape,
25
+ :image_tag,
26
+ :instagram,
27
+ :kramdown,
28
+ :liveleak,
29
+ :markdown,
30
+ :metacafe,
31
+ :redcarpet,
32
+ :simple_format,
33
+ :soundcloud,
34
+ :ted,
35
+ :twitter,
36
+ :unescape_html,
37
+ :video_embed,
38
+ :vimeo,
39
+ :vimeo_embed,
40
+ :worldstar,
41
+ :youtube,
42
+ :youtube_embed,
43
+ :youtube_image,
44
+ :youtube_js_api
45
+ ]
46
+
47
+ # Only run the ones set in Convert.converters, see above.
48
+ Convert.converters.each do |c|
49
+
50
+ # Require
51
+ require_relative "converters/#{c}"
52
+
53
+ # Extend
54
+ extend Object.const_get("Convert::#{c.to_s.split('_').map(&:capitalize).join}")
55
+ end
56
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: convert
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Fugroup Limited
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-29 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Easily convert any string and replace with links and embedded content
14
+ from a long list of providers and libraries.
15
+ email: mail@fugroup.net
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/convert.rb
21
+ homepage: https://github.com/fugroup/convert
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.5.1
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Convert strings and HTML to links and embedded content
45
+ test_files: []