sass-import_once 0.1.2 → 0.1.3
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 +8 -8
- data/{CHANGELOG.markdown → CHANGELOG.md} +5 -0
- data/LICENSE +20 -0
- data/{README.markdown → README.md} +6 -3
- data/lib/sass/import_once/importer.rb +15 -15
- data/lib/sass/import_once/version.rb +1 -1
- data/sass-import_once.gemspec +4 -8
- metadata +12 -13
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmUxMjk3OGU5Mjg3YTdlMDJjY2YxMjNiYzdiNzFjOTU1ZjgzMmQ4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTRhMTkxMTUwNDgyY2ZmOWI2OTVjMmE5OWU0NmE4MDg0NjNiMzNhZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzhkMmIxMjUwZjM1ODFjNGY5YjYzODJiOTYwNGQ1MTFhN2ExNTZlZDllMGQw
|
10
|
+
OGE5MTNhYWI0MmEwNmNkZWIwZjc5M2Y3ZDI2OGY5MzZmNDQzZjA4YWQwYmI2
|
11
|
+
ODQ5OGI5YzE2NjQ1Y2JiNmNhMDdlNzNmYzE0M2FlYmYwNGIyZmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmI5NzgxZjJiODRmZTU1YTU1MzgyNWIxMzM3Yjc0YTFiY2UwMjA0Y2Q2NmIy
|
14
|
+
YmI4ZTcxZWRhMTFlM2IyYjFhNTc2MjhhNzAzZTQyOWM4ZDU1YTc2ZTJlZWZm
|
15
|
+
NDYzYTliMjhhNDIzZmNmNTMzODA5OWRmZGM4ZTI4OTRmNTAzNDI=
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 The Blacksmith (a.k.a. Saulo Vallory)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Sass Import Once Plugin
|
2
2
|
|
3
|
-
Sass import_once changes the
|
3
|
+
Sass import_once changes the behavior of the sass @import directive making it never require the same file twice.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -12,11 +12,14 @@ Sass import_once changes the behaviour of the sass @import directive making neve
|
|
12
12
|
|
13
13
|
## Use with compass
|
14
14
|
|
15
|
-
|
15
|
+
Install the [compass-import_once](https://www.github.com/theblacksmith/compass-import_once)
|
16
16
|
|
17
17
|
$ gem install 'compass-import_once'
|
18
|
+
|
19
|
+
Add the following to your compass configuration:
|
20
|
+
|
18
21
|
require 'compass-import_once'
|
19
22
|
|
20
23
|
## Stylesheet Syntax
|
21
24
|
|
22
|
-
The same as always :)
|
25
|
+
The same as always :)
|
@@ -14,19 +14,6 @@ class Sass::ImportOnce::Importer < ::Sass::Importers::Filesystem
|
|
14
14
|
@imported = []
|
15
15
|
super(root)
|
16
16
|
end
|
17
|
-
|
18
|
-
# Same as Sass
|
19
|
-
COLORS = { :red => 31, :green => 32, :yellow => 33 }
|
20
|
-
|
21
|
-
def color(color, str)
|
22
|
-
raise "[BUG] Unrecognized color #{color}" unless COLORS[color]
|
23
|
-
|
24
|
-
# Almost any real Unix terminal will support color,
|
25
|
-
# so we just filter for Windows terms (which don't set TERM)
|
26
|
-
# and not-real terminals, which aren't ttys.
|
27
|
-
return str if ENV["TERM"].nil? || ENV["TERM"].empty? || !STDOUT.tty?
|
28
|
-
return "\e[#{COLORS[color]}m#{str}\e[0m"
|
29
|
-
end
|
30
17
|
|
31
18
|
def self.DEBUG=(value)
|
32
19
|
@@DEBUG = value
|
@@ -71,7 +58,7 @@ class Sass::ImportOnce::Importer < ::Sass::Importers::Filesystem
|
|
71
58
|
real_file, syntax = Sass::Util.destructure(find_real_file(File.dirname(base), name, options))
|
72
59
|
|
73
60
|
if !real_file
|
74
|
-
|
61
|
+
debug color(:red, "Could not find a RELATIVE file '#{name}'. Imported at #{options[:original_filename]}:#{options[:_line]}")
|
75
62
|
return nil
|
76
63
|
end
|
77
64
|
|
@@ -108,7 +95,7 @@ class Sass::ImportOnce::Importer < ::Sass::Importers::Filesystem
|
|
108
95
|
real_file, syntax = Sass::Util.destructure(find_real_file(@root, name, options))
|
109
96
|
|
110
97
|
if !real_file
|
111
|
-
|
98
|
+
debug color(:red, "Could not find file '#{name}'. Imported at #{options[:original_filename]}:#{options[:_line]}")
|
112
99
|
return nil
|
113
100
|
end
|
114
101
|
|
@@ -136,6 +123,19 @@ class Sass::ImportOnce::Importer < ::Sass::Importers::Filesystem
|
|
136
123
|
end
|
137
124
|
|
138
125
|
protected
|
126
|
+
|
127
|
+
# Same as Sass
|
128
|
+
COLORS = { :red => 31, :green => 32, :yellow => 33 }
|
129
|
+
|
130
|
+
def color(color, str)
|
131
|
+
raise "[BUG] Unrecognized color #{color}" unless COLORS[color]
|
132
|
+
|
133
|
+
# Almost any real Unix terminal will support color,
|
134
|
+
# so we just filter for Windows terms (which don't set TERM)
|
135
|
+
# and not-real terminals, which aren't ttys.
|
136
|
+
return str if ENV["TERM"].nil? || ENV["TERM"].empty? || !STDOUT.tty?
|
137
|
+
return "\e[#{COLORS[color]}m#{str}\e[0m"
|
138
|
+
end
|
139
139
|
|
140
140
|
def empty(options)
|
141
141
|
return Sass::Engine.new("", options)
|
data/sass-import_once.gemspec
CHANGED
@@ -3,20 +3,16 @@ require File.expand_path("../lib/sass/import_once/version", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "sass-import_once"
|
6
|
+
s.license = "MIT"
|
6
7
|
s.version = Sass::ImportOnce::VERSION
|
7
8
|
s.platform = Gem::Platform::RUBY
|
8
9
|
s.authors = ["The Blacksmith (a.k.a. Saulo Vallory)"]
|
9
10
|
s.email = ["me@saulovallory.com"]
|
10
11
|
s.homepage = "https://github.com/theblacksmith/sass-import_once"
|
11
|
-
s.summary = %q{Makes Sass @import directives
|
12
|
+
s.summary = %q{Makes Sass @import directives never import a file more than once.}
|
12
13
|
s.description = %q{
|
13
|
-
The Sass ImportOnce Importer MODIFIES the default
|
14
|
-
|
15
|
-
this has been default behaviour, as far as I know, from the beginning of
|
16
|
-
Sass's life. But sometimes, or most of the time, this behaviour isn't
|
17
|
-
desireable. When working with modularized sass styles and sass frameworks
|
18
|
-
out there we usually want a file to be imported only once.
|
19
|
-
|
14
|
+
The Sass ImportOnce Importer MODIFIES the default behavior of Sass @import directive.
|
15
|
+
It REPLACES the default importer to assure any @import'ed file is only include once.
|
20
16
|
For more information check the readme at github.
|
21
17
|
}
|
22
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-import_once
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Blacksmith (a.k.a. Saulo Vallory)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -24,13 +24,10 @@ dependencies:
|
|
24
24
|
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.1'
|
27
|
-
description: ! "\n The Sass ImportOnce Importer MODIFIES the default
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
When working with modularized sass styles and sass frameworks\n out there we
|
32
|
-
usually want a file to be imported only once.\n\n For more information check
|
33
|
-
the readme at github.\n "
|
27
|
+
description: ! "\n The Sass ImportOnce Importer MODIFIES the default behavior of
|
28
|
+
Sass @import directive.\n It REPLACES the default importer to assure any @import'ed
|
29
|
+
file is only include once.\n For more information check the readme at github.\n
|
30
|
+
\ "
|
34
31
|
email:
|
35
32
|
- me@saulovallory.com
|
36
33
|
executables: []
|
@@ -38,9 +35,10 @@ extensions: []
|
|
38
35
|
extra_rdoc_files: []
|
39
36
|
files:
|
40
37
|
- .gitignore
|
41
|
-
- CHANGELOG.
|
38
|
+
- CHANGELOG.md
|
42
39
|
- Gemfile
|
43
|
-
-
|
40
|
+
- LICENSE
|
41
|
+
- README.md
|
44
42
|
- Rakefile
|
45
43
|
- lib/sass-import_once.rb
|
46
44
|
- lib/sass/import_once.rb
|
@@ -52,7 +50,8 @@ files:
|
|
52
50
|
- test/fixtures/test.scss
|
53
51
|
- test/sass_import_once_test.rb
|
54
52
|
homepage: https://github.com/theblacksmith/sass-import_once
|
55
|
-
licenses:
|
53
|
+
licenses:
|
54
|
+
- MIT
|
56
55
|
metadata: {}
|
57
56
|
post_install_message:
|
58
57
|
rdoc_options: []
|
@@ -73,7 +72,7 @@ rubyforge_project:
|
|
73
72
|
rubygems_version: 2.1.10
|
74
73
|
signing_key:
|
75
74
|
specification_version: 4
|
76
|
-
summary: Makes Sass @import directives
|
75
|
+
summary: Makes Sass @import directives never import a file more than once.
|
77
76
|
test_files:
|
78
77
|
- test/fixtures/partials/_imported.scss
|
79
78
|
- test/fixtures/test.scss
|