webify_ruby 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -11
- data/lib/webify_ruby/convert.rb +22 -14
- data/lib/webify_ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f94685633063500b756c61864f275b2fdbf51a37
|
4
|
+
data.tar.gz: 6a41e8167b22cb480b06840c922a93256c08e225
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 148f1815c8e1e7c1d76ba9768ed7f74384cf008547b8e40afd05b7fd76f5140c24d6168fadbd5e1ea3a3da1ab0d25c9974ca364ce1051050e0c4f935c47cbc7c
|
7
|
+
data.tar.gz: 552e56e1f427ae08dabde4423dbfd0ef4a0147af5e049f6b72f7a0baf76a9a663708d0be73bc061f3cec6988a4a57b724ff8d8548aa8d9a6db99dbdba9d5ce88
|
data/README.rdoc
CHANGED
@@ -7,16 +7,7 @@
|
|
7
7
|
|
8
8
|
= WebifyRuby - Haskell Webify bindings gem for Ruby and Rails Applications
|
9
9
|
|
10
|
-
|
11
|
-
Version 0.0.2 :: Gali
|
12
|
-
Version 0.0.3 :: Vani
|
13
|
-
Version 0.0.4 :: Kolxi
|
14
|
-
Version 0.0.5 :: Racha
|
15
|
-
Version 0.0.6 :: Gagra
|
16
|
-
Version 0.0.7 :: Sochi
|
17
|
-
Version 0.0.8 :: Poti
|
18
|
-
Version 0.1.0 :: Kaspi
|
19
|
-
Version 0.1.1 :: Sarpi
|
10
|
+
Latest version: 0.1.2
|
20
11
|
|
21
12
|
== Generated HTML preview
|
22
13
|
|
@@ -35,7 +26,7 @@ https://github.com/dachi-gh/webify/tree/executables
|
|
35
26
|
https://github.com/dachi-gh/webify
|
36
27
|
|
37
28
|
==== Add to your Gemfile
|
38
|
-
gem 'webify_ruby', '~> 0.1.
|
29
|
+
gem 'webify_ruby', '~> 0.1.2'
|
39
30
|
or git for development version
|
40
31
|
gem 'webify_ruby', :git => 'git://github.com/dachi-gh/webify_ruby.git'
|
41
32
|
|
data/lib/webify_ruby/convert.rb
CHANGED
@@ -35,32 +35,38 @@ module WebifyRuby
|
|
35
35
|
attr_reader :styles
|
36
36
|
# Public: Returns the filepath of CSS file created if applicable.
|
37
37
|
attr_reader :css_file
|
38
|
+
# Public: Returns the html_file that bas been createde
|
39
|
+
attr_reader :html_file
|
40
|
+
# Public: Returns the value of custom css file link
|
41
|
+
attr_reader :link_to_css
|
38
42
|
|
39
43
|
# Public: Initialize a Convertion of font-file.
|
40
44
|
#
|
41
|
-
# file
|
42
|
-
# :dir
|
43
|
-
# :css
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
# :link_to
|
48
|
-
# :unique_id
|
49
|
-
# :html
|
50
|
-
#
|
45
|
+
# file - A String containing relative or full path of file to convert.
|
46
|
+
# :dir - A String indicating to the desired to save converted files (optional).
|
47
|
+
# :css - A String or Boolean value indicating a desired CSS behavior.
|
48
|
+
# If present, it can be either directory path in String or Boolean.
|
49
|
+
# If value is set to true, then a stylesheet file won't be created,
|
50
|
+
# but code will become accessible as :styles attribute (optional).
|
51
|
+
# :link_to - A String notation indicating how to prefix a font url in CSS (optional).
|
52
|
+
# :unique_id - A custom identifier which will separate different fonts (optional).
|
53
|
+
# :html - If present, it will create an HTML file in the given directory.
|
54
|
+
# Note: CSS has to be set to generate a file too. (optional).
|
55
|
+
# :link_to_css - Css file to link to. (optional).
|
51
56
|
#
|
52
57
|
# Returns nothing.
|
53
58
|
# Raises Errno::ENOENT if the inputted file cannot be found.
|
54
59
|
# Raises Error if the inputted font file is not withing valid extensions.
|
55
60
|
# Raises Error::ENOENT if the directory of inputted file is not accessible.
|
56
|
-
def initialize(file, dir: nil, css: nil, link_to: nil, unique_id: nil, html: nil)
|
57
|
-
[file, dir, css, link_to, unique_id, html]
|
61
|
+
def initialize(file, dir: nil, css: nil, link_to: nil, unique_id: nil, html: nil, link_to_css: nil)
|
62
|
+
[file, dir, css, link_to, unique_id, html, link_to_css]
|
58
63
|
|
59
64
|
@desired_dir = dir
|
60
65
|
@css = css
|
61
66
|
@link_to = link_to
|
62
67
|
@unique_id = unique_id
|
63
68
|
@html = html
|
69
|
+
@link_to_css = link_to_css
|
64
70
|
|
65
71
|
raise Errno::ENOENT, "The font file '#{file}' does not exist" unless File.exists?(file)
|
66
72
|
@original_file = file
|
@@ -141,8 +147,10 @@ module WebifyRuby
|
|
141
147
|
def generate_html
|
142
148
|
return false if @css_file.nil? or @html.nil?
|
143
149
|
|
144
|
-
|
145
|
-
|
150
|
+
css_link = @link_to_css.nil? ? @css_file : @link_to_css
|
151
|
+
|
152
|
+
html = WebifyRuby::Html.new(css_link, @html)
|
153
|
+
@html_file = html.html_file
|
146
154
|
end
|
147
155
|
|
148
156
|
protected
|
data/lib/webify_ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webify_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dachi Natsvlishvili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|