middleman-fontcustom 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +10 -0
- data/LICENSE.md +7 -0
- data/README.md +1 -0
- data/Rakefile +4 -0
- data/lib/middleman-fontcustom/extension.rb +59 -0
- data/lib/middleman-fontcustom/version.rb +5 -0
- data/lib/middleman-fontcustom.rb +7 -0
- data/lib/middleman_extension.rb +1 -0
- data/middleman-fontcustom.gemspec +24 -0
- metadata +83 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6b3ac39052b57ad1ddd2351429375de8b358d099
|
4
|
+
data.tar.gz: b269fc145af167b598f38e3b26563e49d63765c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4e7a0f8ea33f0675ec008f04ecb0585ba4202fe24cb21a7d3772ea5a3c335d505bdc15a7cdb5c75c545b1de3c0132e3effa99bee42cf839a998d839d78790e0e
|
7
|
+
data.tar.gz: 93a9c4c9b8ada3ac03cc5d83639eb5e75406e08387a17efd49534d1c0e289016ccba285fb935c8b1cbeaf0d1148a3710da34286dfa52947d01fb5aa99c7ffdbe
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2014 Ryo Ameya http://randompaper.co
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# middleman-fontcustom
|
data/Rakefile
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'fontcustom'
|
2
|
+
|
3
|
+
module Middleman
|
4
|
+
class FontcustomExtension < Extension
|
5
|
+
option :font_name, 'fontcustom', 'Output font name'
|
6
|
+
option :source_dir, 'assets/icons', 'Folder contains icon files'
|
7
|
+
option :fonts_dir, 'source/fonts', 'Folder to output fonts'
|
8
|
+
option :css_dir, 'source/stylesheets', 'Folder to output css'
|
9
|
+
option :templates, 'scss', 'Output templates'
|
10
|
+
option :no_hash, true, 'Create hash for no cache policy'
|
11
|
+
|
12
|
+
def initialize(app, options_hash={}, &block)
|
13
|
+
super
|
14
|
+
|
15
|
+
return unless app.environment == :development
|
16
|
+
|
17
|
+
options_hash = options.to_h
|
18
|
+
|
19
|
+
compile = ->(config){
|
20
|
+
::Fontcustom::Base.new({
|
21
|
+
:font_name => config[:font_name],
|
22
|
+
:input => config[:source_dir],
|
23
|
+
:output => {
|
24
|
+
:fonts => config[:fonts_dir],
|
25
|
+
:css => config[:css_dir]
|
26
|
+
},
|
27
|
+
:templates => config[:templates].split(/\s/),
|
28
|
+
:no_hash => config[:no_hash]
|
29
|
+
}).compile
|
30
|
+
}
|
31
|
+
|
32
|
+
app.ready do
|
33
|
+
|
34
|
+
files.changed do |file|
|
35
|
+
next if files.send(:ignored?, file)
|
36
|
+
next if options_hash[:source_dir] != File.dirname(file)
|
37
|
+
|
38
|
+
begin
|
39
|
+
compile.call(options_hash)
|
40
|
+
rescue => e
|
41
|
+
logger.info e.message
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
files.deleted do |file|
|
46
|
+
next if files.send(:ignored?, file)
|
47
|
+
next if options_hash[:source_dir] != File.dirname(file)
|
48
|
+
|
49
|
+
begin
|
50
|
+
compile.call(options_hash)
|
51
|
+
rescue => e
|
52
|
+
logger.info e.message
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "middleman-fontcustom"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "middleman-fontcustom/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "middleman-fontcustom"
|
7
|
+
s.version = Middleman::Fontcustom::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Ryo Ameya"]
|
10
|
+
s.email = ["oame@oameya.com"]
|
11
|
+
s.homepage = "https://github.com/oame/middleman-fontcustom"
|
12
|
+
s.summary = %q{Generate web-fonts in your Middleman project}
|
13
|
+
s.description = %q{Generate web-fonts in your Middleman project}
|
14
|
+
s.license = "MIT"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
s.required_ruby_version = '>= 1.9.3'
|
21
|
+
|
22
|
+
s.add_runtime_dependency("middleman-core", ["~> 3.2"])
|
23
|
+
s.add_runtime_dependency("fontcustom", ["~> 1.3.3"])
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: middleman-fontcustom
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryo Ameya
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: middleman-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fontcustom
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.3.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.3.3
|
41
|
+
description: Generate web-fonts in your Middleman project
|
42
|
+
email:
|
43
|
+
- oame@oameya.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- CHANGELOG.md
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.md
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- lib/middleman-fontcustom.rb
|
55
|
+
- lib/middleman-fontcustom/extension.rb
|
56
|
+
- lib/middleman-fontcustom/version.rb
|
57
|
+
- lib/middleman_extension.rb
|
58
|
+
- middleman-fontcustom.gemspec
|
59
|
+
homepage: https://github.com/oame/middleman-fontcustom
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata: {}
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 1.9.3
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.2.2
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: Generate web-fonts in your Middleman project
|
83
|
+
test_files: []
|