icomoon2sass 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76a022fa1734a2a2327fdcf8be6196a8086dd7ce
4
- data.tar.gz: 726612498b2e206c2765165bc54272598d741015
3
+ metadata.gz: 56ff044351d9ed7ed4aaa1403a4ea48b2398d0e6
4
+ data.tar.gz: 0806fcd26439a1ddb59c21dcd57209193f0892e7
5
5
  SHA512:
6
- metadata.gz: 51ed00395230f2a3df1291d0bcd6725c4a1f525f57e96c752d2fa9a77d0a79f4fde2b4014006f34b4faf4f4958c19c15d6a41138f6d63a0057a0717f8c21731f
7
- data.tar.gz: f762faacccbdf3bb5b2a539c1f5226266081d60545bd3231343719db1dd03daf110616cfd1b969350a8669ce3ebc1586ff62797accd94333a9ac4e0cb544673c
6
+ metadata.gz: 02416f5020d3bcd27901fe5d3d163c685375e45641c8bc8b08f3987ea149149eee25c79cc9fda2ccac66a33b60806dee712e1e5e7d4266557b273a10d8f473ae
7
+ data.tar.gz: 65450105b14cbe6ea3773cd8590b59b392cec0430c83630c80e151249bb663a4844f4124dc5ec096c979181fc3a4bdf38b01ad6664d9c1c507ebea293663bb7e
@@ -1,7 +1,7 @@
1
1
  class Icomoon2Sass::Archive
2
2
  attr_reader :files
3
3
 
4
- EXTRACTABLE_PATTERN = /(fonts\/.*|selection\.js|style\.css)/
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
 
@@ -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
 
@@ -1,3 +1,6 @@
1
+ // This file was generated with icomoon2sass. (https://github.com/jedfoster/icomoon2sass)
2
+ // You may lose edits if you run icomoon2sass again.
3
+
1
4
  <% icons.each do |icon, content|
2
5
  %>$<%= "#{icon}-icon: \'#{content[:codepoint]}\'" %>
3
6
  <% end %>
@@ -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
@@ -1,3 +1,6 @@
1
+ // This file was generated with icomoon2sass. (https://github.com/jedfoster/icomoon2sass)
2
+ // You may lose edits if you run icomoon2sass again.
3
+
1
4
  <% icons.each do |icon, content| %>
2
5
  <%= ".#{icon}-icon" %>:before
3
6
  @extend %<%= "#{icon}-icon" %>
@@ -1,3 +1,6 @@
1
+ // This file was generated with icomoon2sass. (https://github.com/jedfoster/icomoon2sass)
2
+ // You may lose edits if you run icomoon2sass again.
3
+
1
4
  @each $placeholder, $content in $icons
2
5
  .#{$placeholder}-icon:before
3
6
  @extend %#{$placeholder}-icon
@@ -1,4 +1,4 @@
1
1
  module Icomoon2Sass
2
- VERSION = "1.0.3"
2
+ VERSION = '1.0.4'
3
3
  end
4
4
 
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 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
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.3
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-08-15 00:00:00.000000000 Z
11
+ date: 2014-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor