compass_sumo 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YWIyZjQ1ZDZjMjMwYzM4NTFmMWEwMzhjNWNmODUyN2UzYzdmZDcyYQ==
5
+ data.tar.gz: !binary |-
6
+ NTdlNWU1ZDIxOGEyZDIxOGZhZGFiODUyNTNmZDcyYTkwNzAyYjUyNw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NWJjY2Q2ZjRhYmEyYzNjZTcwOTA2NjU2MDhmMTMwYjM1Yzg3ZmZiNzE4NDE1
10
+ MGMxZTQ4MWQwOTNlZjBhNDVkNzc2ODVlMGM0M2QzYzQxYTNjZDA0OTE3ODkx
11
+ NjA2ZWNkMjdkNmUyMTQ3OTBhZGQzYzgwYTRkNDZlMTc5OTEwMDM=
12
+ data.tar.gz: !binary |-
13
+ MzFiOTg4MGU0OWNmYmEyZmUzNGFiMjFkYmJmNzNiNjliNGYyYjYxOGE4MGIz
14
+ MjQ3MzM2Zjk5Mzc4ZmNlODQzNDMwMmUxZmE2NTdiMzM2ZmE3ZGI4MWU2Nzc0
15
+ MWEzZDNhYmQxZjBhNzJiMGYzNWIzZjI1MmM0ZGVhNDVjNDlmNWQ=
checksums.yaml.gz.sig ADDED
Binary file
data/compass_sumo.gemspec CHANGED
@@ -18,5 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.version = CompassSumo::VERSION
19
19
 
20
20
  s.add_dependency "compass"
21
+ s.add_dependency "ttfunk"
21
22
  end
22
23
 
@@ -1,4 +1,4 @@
1
1
  module CompassSumo
2
- class Engine < Rails::Engin
2
+ class Engine < Rails::Engine
3
3
  end
4
4
  end
@@ -0,0 +1,6 @@
1
+ <% fonts.each do |font| %>
2
+ @include load-font("<%= font[:font_name] %>", "<%= font[:path]%>");
3
+
4
+ $<%= font[:font_name].downcase %>: <%= font[:font_name] %>;
5
+ <% end %>
6
+
@@ -0,0 +1,78 @@
1
+ require 'ttfunk'
2
+
3
+ # This importer adds a simple way to load fonts like you can import sprites
4
+ #
5
+ # In your .scss file, just add the following line to import all fonts in your font directory
6
+ # @import "fonts:*";
7
+ #
8
+ # You can also import your fonts more selectively by changing the glob:
9
+ # @import "fonts:Museo/*";
10
+ #
11
+ # This will read the name of the font from the TTF file, and make it available as a variable.
12
+ # It will also load the font. The variable name gets downcase.
13
+ #
14
+ # So if you have a font named MuseoSlab-500, the variable will be named $museoslab-500
15
+ #
16
+ # WARNING: This works by reading TTF files from your fonts folder.
17
+ # If you're not working with TTF, this won't work for you
18
+ class CompassSumo::SassExtensions::Importers::FontImporter < Sass::Importers::Base
19
+ SCHEME = /^fonts:/
20
+ CONTENT_TEMPLATE_FILE = File.join(File.expand_path('../', __FILE__), 'font_importer', 'template.erb')
21
+ CONTENT_TEMPLATE = ERB.new(File.read(CONTENT_TEMPLATE_FILE))
22
+
23
+ def find(uri, options)
24
+ if uri =~ SCHEME
25
+ options = {
26
+ :syntax => :scss,
27
+ :filename => uri,
28
+ :importer => self
29
+ }
30
+
31
+ # Abuse Compass's Sprites Binding
32
+ binder = Compass::Sprites::Binding.new(:fonts => font_information_for(uri, options))
33
+ content = CONTENT_TEMPLATE.result(binder.get_binding)
34
+
35
+ return Sass::Engine.new(content, options)
36
+ end
37
+
38
+ nil
39
+ end
40
+
41
+ def to_s
42
+ self.class.name
43
+ end
44
+
45
+ def hash
46
+ self.class.name.hash
47
+ end
48
+
49
+ def key(uri, options = {})
50
+ [self.class.name + ':font:' + uri, uri]
51
+ end
52
+
53
+ def mtime(uri, options)
54
+ font_files_for(uri).inject(Time.at(0)) do |max_time, file|
55
+ (t = File.mtime(file)) > max_time ? t : max_time
56
+ end
57
+ end
58
+
59
+ def font_information_for(uri, options = {})
60
+ font_files_for(uri, options).map do |file|
61
+ {
62
+ :font_name => TTFunk::File.open(file).name.postscript_name,
63
+ :path => file.gsub(Compass.configuration.fonts_dir + '/', '').gsub('.ttf', ''),
64
+ }
65
+ end
66
+ end
67
+
68
+ def font_files_for(uri, options = {})
69
+ glob = uri.gsub(SCHEME, '')
70
+ font_path = Compass.configuration.fonts_dir
71
+
72
+ fonts = Dir[File.join(font_path, "#{glob}.ttf")].sort
73
+
74
+ raise Compass::Error, "No TTF files were found in the load path matching '#{glob}' in #{font_path}" if fonts.empty?
75
+
76
+ fonts
77
+ end
78
+ end
@@ -0,0 +1,8 @@
1
+ module CompassSumo::SassExtensions
2
+ module Importers
3
+ end
4
+ end
5
+
6
+ require 'compass_sumo/sass_extensions/importers/font_importer'
7
+
8
+ Sass.load_paths << CompassSumo::SassExtensions::Importers::FontImporter.new
@@ -1,3 +1,3 @@
1
1
  module CompassSumo
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/compass_sumo.rb CHANGED
@@ -8,5 +8,6 @@ if defined?(::Rails) && ::Rails.version >= "3.1"
8
8
  end
9
9
 
10
10
  require 'compass_sumo/sass_extensions/functions'
11
+ require 'compass_sumo/sass_extensions/importers'
11
12
 
12
13
  Compass::Frameworks.register("sumo", :path => "#{File.dirname(__FILE__)}/..")
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ ���dC���0���
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compass_sumo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jan De Poorter
@@ -10,25 +9,66 @@ authors:
10
9
  - Mathias Helin
11
10
  autorequire:
12
11
  bindir: bin
13
- cert_chain: []
14
- date: 2013-05-07 00:00:00.000000000 Z
12
+ cert_chain:
13
+ - !binary |-
14
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURWRENDQWp5Z0F3SUJB
15
+ Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREE0TVF3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XNUFaR1ZtCmRp
32
+ NWlaVEFOQmdrcWhraUc5dzBCQVFVRkFBT0NBUUVBZVJnbk1FQ21Ya3NvVjNT
33
+ OUhtdXBaRnNOWUV3dnlPOEUKem1HMVU0ajlybGVFV1JqS0xWalhkZmd5TG9l
34
+ MnVtUlpwakpGR3dxaHdqYnNLV3U5eWFoRzlWZXRjWWVkSDEyYQp0bVUwMzNL
35
+ SEdPei92UUtndTQ4Wnovckd6amZkSjU0a2FTRVB1MEFsMzV6c2RveFpIV21Q
36
+ K2Jod1k4RE4yOGFOCjNkclpjMHhBL0t2N0hpaUpsSmkxNDBjZVFySGd2RlIv
37
+ UzExR1hQVFBtQ1NWMFczQnhIc0p1Vm1hUDYxaEppa1AKSU4ybUZwRkw4ckFk
38
+ eklzc2g3ejFsU285QUgwMGs2cm5uSHEzOFRmdmorWndOSGw1RENCVzgxYmYy
39
+ UzZSM2QzWQpFdlVIWS9tcmZNY3NYUWJ3aVdXeFBzL2R6TDhSbFhFcGhZeDlz
40
+ N0VyUk11ck9GUm5ZZ3dDZ0E9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t
41
+ Cg==
42
+ date: 2013-07-02 00:00:00.000000000 Z
15
43
  dependencies:
16
44
  - !ruby/object:Gem::Dependency
17
45
  name: compass
18
46
  requirement: !ruby/object:Gem::Requirement
19
- none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ version_requirements: !ruby/object:Gem::Requirement
20
52
  requirements:
21
53
  - - ! '>='
22
54
  - !ruby/object:Gem::Version
23
55
  version: '0'
24
56
  type: :runtime
25
57
  prerelease: false
58
+ - !ruby/object:Gem::Dependency
59
+ name: ttfunk
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
26
65
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
66
  requirements:
29
67
  - - ! '>='
30
68
  - !ruby/object:Gem::Version
31
69
  version: '0'
70
+ type: :runtime
71
+ prerelease: false
32
72
  description: The SumoCoders CSS Framework
33
73
  email: compass@sumocoders.be
34
74
  executables: []
@@ -42,6 +82,9 @@ files:
42
82
  - lib/compass_sumo/engine.rb
43
83
  - lib/compass_sumo/sass_extensions/functions.rb
44
84
  - lib/compass_sumo/sass_extensions/functions/inline_svg.rb
85
+ - lib/compass_sumo/sass_extensions/importers.rb
86
+ - lib/compass_sumo/sass_extensions/importers/font_importer.rb
87
+ - lib/compass_sumo/sass_extensions/importers/font_importer/template.erb
45
88
  - lib/compass_sumo/version.rb
46
89
  - stylesheets/_compass_sumo.scss
47
90
  - stylesheets/compass_sumo/_mixins.scss
@@ -51,27 +94,25 @@ files:
51
94
  - stylesheets/compass_sumo/mixins/_retina_sprites.scss
52
95
  homepage:
53
96
  licenses: []
97
+ metadata: {}
54
98
  post_install_message:
55
99
  rdoc_options: []
56
100
  require_paths:
57
101
  - lib
58
102
  required_ruby_version: !ruby/object:Gem::Requirement
59
- none: false
60
103
  requirements:
61
104
  - - ! '>='
62
105
  - !ruby/object:Gem::Version
63
106
  version: '0'
64
107
  required_rubygems_version: !ruby/object:Gem::Requirement
65
- none: false
66
108
  requirements:
67
109
  - - ! '>='
68
110
  - !ruby/object:Gem::Version
69
111
  version: '0'
70
112
  requirements: []
71
113
  rubyforge_project:
72
- rubygems_version: 1.8.24
114
+ rubygems_version: 2.0.3
73
115
  signing_key:
74
- specification_version: 3
116
+ specification_version: 4
75
117
  summary: SumoCoders CSS Framework
76
118
  test_files: []
77
- has_rdoc:
metadata.gz.sig ADDED
Binary file