compass 1.0.0.rc.0 → 1.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compass.rb +1 -2
- data/lib/compass/commands/update_project.rb +1 -1
- data/lib/compass/generated_version.rb +1 -1
- data/lib/compass/logger.rb +22 -0
- data/lib/compass/sass_compiler.rb +12 -4
- data/lib/compass/sass_extensions/sprites/image_methods.rb +1 -1
- data/lib/compass/version.rb +1 -1
- data/test/units/configuration_test.rb +0 -4
- metadata +6 -7
- data/lib/compass/configuration/adapters.rb +0 -109
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ba40664c33ba36cfbe915fc363e6cc6a8d37d6e
|
4
|
+
data.tar.gz: 294f5d5a77d9cfa5e0a9bdeddedc412fbf4b05b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c6b495cc53ff748913bb2c1bac81a533df5fe7279e35c1422191e47f76db3c139077f3188e8edf6c556f9e2cc3973d42c05fc5cc2a3ff0e58ca952a1aaa3d1b
|
7
|
+
data.tar.gz: 14b1abf7ad122a618f2885928007470fc66699cdeef1aa9d5546fbe5fd0a893d6f023f4b52426d214be627459bc9885e3834f7924e23d4949679cd606003dd15
|
data/lib/compass.rb
CHANGED
@@ -94,7 +94,7 @@ module Compass
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def compiler_options
|
97
|
-
transfer_options(options, {}, :time, :debug_info, :only_sass_files, :force)
|
97
|
+
transfer_options(options, {}, :time, :debug_info, :only_sass_files, :force, :quiet)
|
98
98
|
end
|
99
99
|
|
100
100
|
def transfer_options(from, to, *keys)
|
data/lib/compass/logger.rb
CHANGED
@@ -27,6 +27,27 @@ module Compass
|
|
27
27
|
|
28
28
|
DEFAULT_ACTIONS = ACTION_COLORS.keys
|
29
29
|
|
30
|
+
ACTION_CAN_BE_QUIET = {
|
31
|
+
:error => false,
|
32
|
+
:warning => true,
|
33
|
+
:info => true,
|
34
|
+
:compile => true,
|
35
|
+
:overwrite => true,
|
36
|
+
:modified => true,
|
37
|
+
:clean => true,
|
38
|
+
:write => true,
|
39
|
+
:create => true,
|
40
|
+
:remove => true,
|
41
|
+
:delete => true,
|
42
|
+
:deleted => true,
|
43
|
+
:created => true,
|
44
|
+
:exists => true,
|
45
|
+
:directory => true,
|
46
|
+
:identical => true,
|
47
|
+
:convert => true,
|
48
|
+
:unchanged => true
|
49
|
+
}
|
50
|
+
|
30
51
|
attr_accessor :actions, :options, :time
|
31
52
|
|
32
53
|
def initialize(*actions)
|
@@ -37,6 +58,7 @@ module Compass
|
|
37
58
|
|
38
59
|
# Record an action that has occurred
|
39
60
|
def record(action, *arguments)
|
61
|
+
return if options[:quiet] && ACTION_CAN_BE_QUIET[action]
|
40
62
|
msg = ""
|
41
63
|
if time
|
42
64
|
msg << Time.now.strftime("%I:%M:%S.%3N %p")
|
@@ -5,6 +5,7 @@ class Compass::SassCompiler
|
|
5
5
|
include Compass::Actions
|
6
6
|
|
7
7
|
attr_writer :logger
|
8
|
+
attr_reader :quiet
|
8
9
|
attr_reader :error_count
|
9
10
|
attr_accessor :config
|
10
11
|
attr_accessor :display_compilation_times
|
@@ -17,12 +18,15 @@ class Compass::SassCompiler
|
|
17
18
|
self.display_compilation_times = options.delete(:time)
|
18
19
|
self.working_path = options.delete(:working_path) || Dir.pwd
|
19
20
|
self.only_sass_files = options.delete(:only_sass_files) || []
|
21
|
+
@quiet = options[:quiet]
|
20
22
|
plugin_options = config.to_sass_plugin_options.merge(options)
|
21
23
|
if only_sass_files.any?
|
22
24
|
plugin_options[:template_location] = []
|
23
25
|
plugin_options[:load_paths] = config.sass_load_paths
|
24
26
|
end
|
25
27
|
plugin_options[:always_update] = true if options.delete(:force)
|
28
|
+
plugin_options[:compass] ||= {}
|
29
|
+
plugin_options[:compass][:logger] = logger
|
26
30
|
@compiler = Sass::Plugin::Compiler.new(plugin_options)
|
27
31
|
@start_times = {}
|
28
32
|
@error_count = 0
|
@@ -108,16 +112,20 @@ class Compass::SassCompiler
|
|
108
112
|
|
109
113
|
def when_compilation_error(error, sass_file, css_file, sourcemap_file)
|
110
114
|
@error_count += 1
|
111
|
-
if
|
112
|
-
|
115
|
+
if error.respond_to?(:sass_filename)
|
116
|
+
if relativize(error.sass_filename) == relativize(sass_file)
|
117
|
+
logger.record :error, "#{relativize(error.sass_filename)} (Line #{error.sass_line}: #{error.message})"
|
118
|
+
else
|
119
|
+
logger.record :error, "#{relativize(sass_file)} (Line #{error.sass_line} of #{relativize(error.sass_filename)}: #{error.message})"
|
120
|
+
end
|
113
121
|
else
|
114
|
-
logger.record :error, "#{relativize(sass_file)} (
|
122
|
+
logger.record :error, "#{relativize(sass_file)} (#{error.backtrace.first}: #{error.message})"
|
115
123
|
end
|
116
124
|
config.run_stylesheet_error(sass_file, error.message)
|
117
125
|
end
|
118
126
|
|
119
127
|
def logger
|
120
|
-
@logger ||= Compass::Logger.new
|
128
|
+
@logger ||= Compass::Logger.new(:quiet => quiet)
|
121
129
|
end
|
122
130
|
|
123
131
|
def corresponding_css_file(sass_file)
|
data/lib/compass/version.rb
CHANGED
@@ -360,8 +360,6 @@ CONFIG
|
|
360
360
|
|
361
361
|
assert load_paths.include?("/home/chris/foo"), "Expected to find /home/chris/foo in #{load_paths.inspect}"
|
362
362
|
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
363
|
-
assert_equal "/home/chris/my_compass_project/css/framework", plugin_opts[:template_location].find{|s,c| s == "/path/to/my/framework"}[1]
|
364
|
-
assert_equal "/home/chris/my_compass_project/css/foo", plugin_opts[:template_location].find{|s,c| s == "/home/chris/my_compass_project/../foo"}[1]
|
365
363
|
|
366
364
|
expected_serialization = <<EXPECTED
|
367
365
|
require 'compass/import-once/activate'
|
@@ -423,8 +421,6 @@ EXPECTED
|
|
423
421
|
|
424
422
|
assert load_paths.include?("/home/chris/foo"), "Expected to find /home/chris/foo in #{load_paths.inspect}"
|
425
423
|
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
426
|
-
assert_equal "/home/chris/my_compass_project/css/framework", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/path/to/my/framework"}[1]
|
427
|
-
assert_equal "/home/chris/my_compass_project/css/foo", Compass.configuration.to_sass_plugin_options[:template_location].find{|s,c| s == "/home/chris/my_compass_project/../foo"}[1]
|
428
424
|
|
429
425
|
expected_serialization = <<EXPECTED
|
430
426
|
require 'compass/import-once/activate'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.rc.
|
4
|
+
version: 1.0.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Eppstein
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-08-
|
15
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: sass
|
@@ -40,28 +40,28 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.0.0.rc.
|
43
|
+
version: 1.0.0.rc.1
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - ~>
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 1.0.0.rc.
|
50
|
+
version: 1.0.0.rc.1
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: compass-import-once
|
53
53
|
requirement: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 1.0.
|
57
|
+
version: 1.0.5
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
60
|
version_requirements: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - ~>
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.0.
|
64
|
+
version: 1.0.5
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
name: chunky_png
|
67
67
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,7 +144,6 @@ files:
|
|
144
144
|
- lib/compass/commands/write_configuration.rb
|
145
145
|
- lib/compass/commands.rb
|
146
146
|
- lib/compass/compiler.rb
|
147
|
-
- lib/compass/configuration/adapters.rb
|
148
147
|
- lib/compass/configuration/comments.rb
|
149
148
|
- lib/compass/configuration/file_data.rb
|
150
149
|
- lib/compass/configuration/helpers.rb
|
@@ -1,109 +0,0 @@
|
|
1
|
-
module Compass
|
2
|
-
module Configuration
|
3
|
-
# The adapters module provides methods that make configuration data from a compass project
|
4
|
-
# adapt to various consumers of configuration data
|
5
|
-
module Adapters
|
6
|
-
def to_compiler_arguments(additional_options = {})
|
7
|
-
engine_opts = to_sass_engine_options.merge(additional_options)
|
8
|
-
# we have to pass the quiet option in the nested :sass hash to disambiguate it from the compass compiler's own quiet option.
|
9
|
-
if engine_opts.has_key?(:quiet)
|
10
|
-
engine_opts[:sass] ||= {}
|
11
|
-
engine_opts[:sass][:quiet] = engine_opts.delete(:quiet)
|
12
|
-
end
|
13
|
-
[project_path, sass_path, css_path, engine_opts]
|
14
|
-
end
|
15
|
-
|
16
|
-
def to_sass_plugin_options
|
17
|
-
locations = []
|
18
|
-
locations << [sass_path, css_path] if sass_path && css_path
|
19
|
-
Compass::Frameworks::ALL.each do |framework|
|
20
|
-
locations << [framework.stylesheets_directory, File.join(css_path || css_dir || ".", framework.name)]
|
21
|
-
end
|
22
|
-
load_paths = []
|
23
|
-
resolve_additional_import_paths.each do |additional_path|
|
24
|
-
if additional_path.is_a?(String)
|
25
|
-
locations << [additional_path, File.join(css_path || css_dir || ".", File.basename(additional_path))]
|
26
|
-
else
|
27
|
-
load_paths << additional_path
|
28
|
-
end
|
29
|
-
end
|
30
|
-
plugin_opts = {:template_location => locations}
|
31
|
-
plugin_opts[:style] = output_style if output_style
|
32
|
-
plugin_opts[:line_comments] = line_comments
|
33
|
-
if sass_3_4?
|
34
|
-
plugin_opts[:sourcemap] = sourcemap ? :auto : :none
|
35
|
-
else
|
36
|
-
plugin_opts[:sourcemap] = sourcemap
|
37
|
-
end
|
38
|
-
plugin_opts[:cache] = cache unless cache.nil?
|
39
|
-
plugin_opts[:cache_location] = cache_path unless cache_path.nil?
|
40
|
-
plugin_opts[:quiet] = disable_warnings if disable_warnings
|
41
|
-
plugin_opts[:compass] = {}
|
42
|
-
plugin_opts[:compass][:environment] = environment
|
43
|
-
plugin_opts.merge!(sass_options || {})
|
44
|
-
plugin_opts[:load_paths] ||= []
|
45
|
-
plugin_opts[:load_paths] += load_paths
|
46
|
-
plugin_opts[:load_paths] << Compass::SpriteImporter.new
|
47
|
-
plugin_opts[:full_exception] = (environment == :development)
|
48
|
-
plugin_opts
|
49
|
-
end
|
50
|
-
|
51
|
-
def resolve_additional_import_paths
|
52
|
-
(additional_import_paths || []).map do |path|
|
53
|
-
if path.is_a?(String) && project_path && !absolute_path?(path)
|
54
|
-
File.join(project_path, path)
|
55
|
-
else
|
56
|
-
path
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def absolute_path?(path)
|
62
|
-
# Pretty basic implementation
|
63
|
-
path.index(File::SEPARATOR) == 0 || path.index(':') == 1
|
64
|
-
end
|
65
|
-
|
66
|
-
def to_sass_engine_options
|
67
|
-
engine_opts = {:load_paths => sass_load_paths}
|
68
|
-
engine_opts[:style] = output_style if output_style
|
69
|
-
engine_opts[:line_comments] = line_comments
|
70
|
-
if sass_3_4?
|
71
|
-
engine_opts[:sourcemap] = sourcemap ? :auto : :none
|
72
|
-
else
|
73
|
-
engine_opts[:sourcemap] = sourcemap
|
74
|
-
end
|
75
|
-
engine_opts[:cache] = cache
|
76
|
-
engine_opts[:cache_location] = cache_path
|
77
|
-
engine_opts[:quiet] = disable_warnings if disable_warnings
|
78
|
-
engine_opts[:compass] = {}
|
79
|
-
engine_opts[:compass][:environment] = environment
|
80
|
-
engine_opts[:full_exception] = (environment == :development)
|
81
|
-
engine_opts.merge!(sass_options || {})
|
82
|
-
end
|
83
|
-
|
84
|
-
def sass_load_paths
|
85
|
-
load_paths = []
|
86
|
-
load_paths << sass_path if sass_path
|
87
|
-
Compass::Frameworks::ALL.each do |f|
|
88
|
-
load_paths << f.stylesheets_directory if File.directory?(f.stylesheets_directory)
|
89
|
-
end
|
90
|
-
importer = sass_options[:filesystem_importer] if sass_options && sass_options[:filesystem_importer]
|
91
|
-
importer ||= Sass::Importers::Filesystem
|
92
|
-
load_paths += resolve_additional_import_paths
|
93
|
-
load_paths.map! do |p|
|
94
|
-
next p if p.respond_to?(:find_relative)
|
95
|
-
importer.new(p.to_s)
|
96
|
-
end
|
97
|
-
load_paths << Compass::SpriteImporter.new
|
98
|
-
load_paths
|
99
|
-
end
|
100
|
-
|
101
|
-
def sass_3_4?
|
102
|
-
Sass.version[:major] == 3 && Sass.version[:minor] == 4
|
103
|
-
end
|
104
|
-
end
|
105
|
-
class Data
|
106
|
-
include Adapters
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|