icomoon2sass 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/icomoon2sass/archive.rb +14 -1
- data/lib/icomoon2sass/cli.rb +2 -0
- data/lib/icomoon2sass/templates/list.sass.erb +3 -0
- data/lib/icomoon2sass/templates/map.sass.erb +3 -0
- data/lib/icomoon2sass/templates/oocss_list.sass.erb +3 -0
- data/lib/icomoon2sass/templates/oocss_map.sass.erb +3 -0
- data/lib/icomoon2sass/version.rb +1 -1
- data/lib/icomoon2sass.rb +15 -0
- data/lib/run.rb +9 -5
- 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: 56ff044351d9ed7ed4aaa1403a4ea48b2398d0e6
|
4
|
+
data.tar.gz: 0806fcd26439a1ddb59c21dcd57209193f0892e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02416f5020d3bcd27901fe5d3d163c685375e45641c8bc8b08f3987ea149149eee25c79cc9fda2ccac66a33b60806dee712e1e5e7d4266557b273a10d8f473ae
|
7
|
+
data.tar.gz: 65450105b14cbe6ea3773cd8590b59b392cec0430c83630c80e151249bb663a4844f4124dc5ec096c979181fc3a4bdf38b01ad6664d9c1c507ebea293663bb7e
|
data/lib/icomoon2sass/archive.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Icomoon2Sass::Archive
|
2
2
|
attr_reader :files
|
3
3
|
|
4
|
-
EXTRACTABLE_PATTERN = /(fonts\/.*|selection\.
|
4
|
+
EXTRACTABLE_PATTERN = /(fonts\/.*|selection\.json|style\.css|demo-files\/.*|demo\.html)/
|
5
5
|
|
6
6
|
def font_files
|
7
7
|
@_font_files ||= @files.reject {|key| !key.match(/fonts/) }
|
@@ -10,5 +10,18 @@ class Icomoon2Sass::Archive
|
|
10
10
|
def metadata_file
|
11
11
|
@_metadata_file ||= @files.reject {|key| !key.match(/\.json/) }.values.first
|
12
12
|
end
|
13
|
+
|
14
|
+
def demo_files
|
15
|
+
@_demo_files ||= begin
|
16
|
+
demo_files = @files.reject {|key| !key.match(/(\.html|\.css|demo-files)/) }
|
17
|
+
demo_files['demo-files/style.css'] = demo_files.delete('style.css')
|
18
|
+
demo_files
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def session_file
|
23
|
+
@_session_file ||= @files.reject {|key| !key.match(/\.json/) }.values.first
|
24
|
+
end
|
25
|
+
|
13
26
|
end
|
14
27
|
|
data/lib/icomoon2sass/cli.rb
CHANGED
@@ -12,6 +12,8 @@ class Icomoon2Sass::CLI < Thor::Group
|
|
12
12
|
class_option :scss, type: :boolean, default: false, desc: 'Use the SCSS syntax'
|
13
13
|
class_option :compatible, aliases: '-c', type: :boolean, default: false, desc: 'Generate code compatible with Sass 3.2'
|
14
14
|
class_option :oocss, type: :boolean, default: false, desc: 'Generate OOCSS-style classes'
|
15
|
+
class_option :'demo-path', type: :string, default: false, desc: 'Destination path for demo.html'
|
16
|
+
class_option :'session-path', type: :string, default: false, desc: 'Destination path for selection.json'
|
15
17
|
|
16
18
|
def start
|
17
19
|
|
@@ -24,6 +24,9 @@ $icons: ( <%=
|
|
24
24
|
@return map-get($icons, $name)
|
25
25
|
|
26
26
|
|
27
|
+
// This file was generated with icomoon2sass. (https://github.com/jedfoster/icomoon2sass)
|
28
|
+
// You may lose edits if you run icomoon2sass again.
|
29
|
+
|
27
30
|
%icon-pseudo-content
|
28
31
|
font-family: '<%= font_family %>'
|
29
32
|
speak: none
|
data/lib/icomoon2sass/version.rb
CHANGED
data/lib/icomoon2sass.rb
CHANGED
@@ -53,6 +53,21 @@ module Icomoon2Sass
|
|
53
53
|
utilities.create_file "#{font_path}/#{filename.sub('fonts/', '')}", content
|
54
54
|
end
|
55
55
|
|
56
|
+
if options[:"demo-path"]
|
57
|
+
files.demo_files.each do |filename, content|
|
58
|
+
utilities.create_file "#{options[:"demo-path"]}/#{filename}", content
|
59
|
+
end
|
60
|
+
|
61
|
+
files.font_files.each do |filename, content|
|
62
|
+
utilities.create_file "#{options[:"demo-path"]}/demo-files/fonts/#{filename.sub('fonts/', '')}", content
|
63
|
+
end
|
64
|
+
|
65
|
+
utilities.gsub_file "#{options[:"demo-path"]}/demo.html", /href="style.css">/, 'href="demo-files/style.css">'
|
66
|
+
end
|
67
|
+
|
68
|
+
if options[:"session-path"]
|
69
|
+
utilities.create_file "#{options[:"session-path"]}/session.json", files.session_file
|
70
|
+
end
|
56
71
|
end
|
57
72
|
|
58
73
|
end
|
data/lib/run.rb
CHANGED
@@ -11,11 +11,15 @@ You can also pass the path to an unzipped directory.
|
|
11
11
|
|
12
12
|
|
13
13
|
OPTIONS
|
14
|
-
--font-path PATH
|
15
|
-
--sass-path PATH
|
16
|
-
--scss
|
17
|
-
-c, --compatible
|
18
|
-
--oocss
|
14
|
+
--font-path PATH Destination path for font files, defaults to current directory
|
15
|
+
--sass-path PATH Destination path for Sass files, defaults to current directory
|
16
|
+
--scss Use the SCSS syntax
|
17
|
+
-c, --compatible Generate code compatible with Sass 3.2
|
18
|
+
--oocss Generate OOCSS-style classes
|
19
|
+
--demo-path PATH Copy demo.html from SOURCE to PATH/demo.html
|
20
|
+
If omitted, the demo file will be ignored
|
21
|
+
--session-path PATH Copy selection.json from SOURCE to PATH/selection.json
|
22
|
+
If omitted, the demo file will be ignored
|
19
23
|
|
20
24
|
|
21
25
|
OUTPUT
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icomoon2sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jed Foster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|