jekyll-fontello 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/jekyll-fontello.rb +22 -19
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6795d398b152a6e2ad4099fdd27e762e74ba8a0e
|
4
|
+
data.tar.gz: '09bc28467c623872ecc497a81a5f5bd144d9d720'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef136c6f38e35411fac415c23fd0f8a6d5109dbebfb71f93c4651fbd7437054578779618ae787e5c41283ffef5dc53a5b4917e7c1fe4543c27616b92a6302138
|
7
|
+
data.tar.gz: 683f8045e0e93a6bc896928ea8558a89676373efe64ec793d40cc0e1c7b380cefe5bbbba052589cc4de65cc64daa93c18e55eda647f75bc9504ca480d2ab6ee0
|
data/README.md
CHANGED
data/lib/jekyll-fontello.rb
CHANGED
@@ -4,29 +4,19 @@ require 'zip'
|
|
4
4
|
|
5
5
|
Zip.on_exists_proc = true
|
6
6
|
|
7
|
-
module
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
ZIP_FILE = "#{Dir.tmpdir}/jekyll_fontello.zip"
|
7
|
+
module JekyllFontello
|
8
|
+
FONTELLO_URL = 'http://fontello.com'
|
9
|
+
SESSION_FILE = "#{Dir.tmpdir}/jekyll_fontello_session"
|
10
|
+
ZIP_FILE = "#{Dir.tmpdir}/jekyll_fontello.zip"
|
12
11
|
|
12
|
+
class Generator < Jekyll::Generator
|
13
13
|
# Read the plugin configuration and generate the
|
14
14
|
# Fontello files based on that.
|
15
15
|
#
|
16
16
|
# required by Jekyll
|
17
17
|
def generate(site)
|
18
|
-
@download_tries = 0
|
19
|
-
|
20
|
-
# Load configuration from _config.yml
|
21
18
|
plugin_config = site.config['fontello'] || { }
|
22
|
-
|
23
|
-
@output_fonts = plugin_config['output_fonts']|| 'fontello/fonts'
|
24
|
-
@output_styles = plugin_config['output_styles'] || 'fontello/styles'
|
25
|
-
@fonts_path = plugin_config['fonts_path'] || relative_path_styles_to_fonts
|
26
|
-
@preprocessor = plugin_config['preprocessor'] || 'none'
|
27
|
-
|
28
|
-
# Read the configuration
|
29
|
-
@fontello_config = File.read(@config_file)
|
19
|
+
init(plugin_config)
|
30
20
|
|
31
21
|
# Main pipeline
|
32
22
|
download_zip()
|
@@ -35,6 +25,21 @@ module Fontello
|
|
35
25
|
clean_up()
|
36
26
|
end
|
37
27
|
|
28
|
+
# Initialize the Generator instance variables.
|
29
|
+
def init(config)
|
30
|
+
@download_tries = 0
|
31
|
+
|
32
|
+
# Load configuration from _config.yml
|
33
|
+
@config_file = config['config'] || 'fontello_config.json'
|
34
|
+
@output_fonts = config['output_fonts']|| 'fontello/fonts'
|
35
|
+
@output_styles = config['output_styles'] || 'fontello/styles'
|
36
|
+
@fonts_path = config['fonts_path'] || relative_path_styles_to_fonts
|
37
|
+
@preprocessor = config['preprocessor'] || 'none'
|
38
|
+
|
39
|
+
# Read the configuration
|
40
|
+
@fontello_config = File.read(@config_file)
|
41
|
+
end
|
42
|
+
|
38
43
|
# Downloads the zip file from Fontello based on
|
39
44
|
# the local configuration.
|
40
45
|
#
|
@@ -110,9 +115,7 @@ module Fontello
|
|
110
115
|
#
|
111
116
|
# see: https://github.com/fontello/fontello/#api-methods
|
112
117
|
def session_key
|
113
|
-
if File.
|
114
|
-
return File.read(SESSION_FILE)
|
115
|
-
end
|
118
|
+
return File.read(SESSION_FILE) if File.exist? SESSION_FILE
|
116
119
|
|
117
120
|
url = URI(FONTELLO_URL)
|
118
121
|
boundary = '----WebKitFormREQUEST_BOUNDARY7MA4YWxkTrZu0gW'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-fontello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Cornelissen
|
@@ -9,7 +9,35 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-02-08 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubyzip
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jekyll
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
description: Jekyll plugin that automatically downloads your webfont from Fontello.
|
14
42
|
email: ericornelissen@gmail.com
|
15
43
|
executables: []
|