chriseppstein-compass 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown CHANGED
@@ -1,6 +1,51 @@
1
1
  COMPASS CHANGELOG
2
2
  =================
3
3
 
4
+ 0.6.3
5
+ -----
6
+
7
+ ### Rails
8
+
9
+ Bug fix: The http_images_path configuration default should be "/images" instead of "/public/images".
10
+
11
+ ### Command Line
12
+
13
+ These changes, coupled with upcoming changes to Sass result in significantly reduced time spent on compilation for large projects.
14
+
15
+ * The compass command line will no longer recompile sass files that haven't changed (taking import dependencies into account).
16
+ * The compass command line will now respect the -q (quiet) option during compilation. Additionally, the quiet option will be set by default when watching a project for changes.
17
+
18
+ 0.6.2
19
+ -----
20
+
21
+ ### Blueprint
22
+
23
+ Split the push and pull mixins into sub-mixins that separate the common styles from the ones that vary. The generated css when using presentational class names will be smaller as a result. The existing <code>+push</code> and <code>+pull</code> mixins continue to work as expected. The following mixins were added:
24
+
25
+ +push-base
26
+ +push-margins
27
+ +pull-base
28
+ +pull-margins
29
+
30
+ Additonally, the liquid plugin was updated to have a span mixin that matches elsewhere.
31
+
32
+ ### YUI
33
+
34
+ Added Yahoo's version of the css reset. To use it, mix into the top level of your project:
35
+
36
+ @import yui/modules/reset.sass
37
+ +reset
38
+
39
+ ### Rails
40
+
41
+ * Conditionally defining #blank? on String/NilClass (Erik Bryn <erik.bryn@gmail.com>)
42
+ * Set compass environment in plugin based on RAILS_ENV (Lee Nussbaum <wln@scrunch.org>)
43
+
44
+ 0.6.1
45
+ -----
46
+
47
+ Maintenance release that fixes several bugs in the handling of configuration files.
48
+
4
49
  0.6.0
5
50
  -----
6
51
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
data/compass.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{compass}
3
- s.version = "0.6.2"
3
+ s.version = "0.6.3"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Chris Eppstein"]
7
- s.date = %q{2009-04-19}
7
+ s.date = %q{2009-04-22}
8
8
  s.default_executable = %q{compass}
9
9
  s.description = %q{Sass-Based CSS Meta-Framework. Semantic, Maintainable CSS.}
10
10
  s.email = %q{chris@eppsteins.net}
@@ -18,7 +18,7 @@ module Compass
18
18
  def directory(dir, options = nil)
19
19
  options ||= self.options if self.respond_to?(:options)
20
20
  if File.exists?(dir) && File.directory?(dir)
21
- logger.record :exists, basename(dir)
21
+ logger.record :exists, basename(dir) unless options[:quiet]
22
22
  elsif File.exists?(dir)
23
23
  msg = "#{basename(dir)} already exists and is not a directory."
24
24
  raise Compass::FilesystemConflict.new(msg)
@@ -46,22 +46,30 @@ module Compass
46
46
  else
47
47
  logger.record :create, basename(file_name)
48
48
  end
49
- open(file_name,'w') do |file|
50
- file.write(contents)
51
- end unless skip_write
49
+ if skip_write
50
+ FileUtils.touch file_name
51
+ else
52
+ open(file_name,'w') do |file|
53
+ file.write(contents)
54
+ end
55
+ end
52
56
  end
53
57
 
54
58
  # Compile one Sass file
55
59
  def compile(sass_filename, css_filename, options)
56
- logger.record :compile, basename(sass_filename)
57
- engine = ::Sass::Engine.new(open(sass_filename).read,
58
- :filename => sass_filename,
59
- :line_comments => options[:line_comments],
60
- :style => options[:style],
61
- :css_filename => css_filename,
62
- :load_paths => options[:load_paths])
63
- css_content = engine.render
64
- write_file(css_filename, css_content, options.merge(:force => true))
60
+ if Sass::Plugin.exact_stylesheet_needs_update?(css_filename, sass_filename)
61
+ logger.record :compile, basename(sass_filename) unless options[:quiet]
62
+ engine = ::Sass::Engine.new(open(sass_filename).read,
63
+ :filename => sass_filename,
64
+ :line_comments => options[:line_comments],
65
+ :style => options[:style],
66
+ :css_filename => css_filename,
67
+ :load_paths => options[:load_paths])
68
+ css_content = engine.render
69
+ write_file(css_filename, css_content, options.merge(:force => true))
70
+ else
71
+ logger.record :unchanged, basename(sass_filename) unless options[:quiet]
72
+ end
65
73
  end
66
74
 
67
75
  def basename(file)
@@ -14,7 +14,7 @@ module Compass
14
14
  Compass::Compiler.new(working_path,
15
15
  projectize(Compass.configuration.sass_dir),
16
16
  projectize(Compass.configuration.css_dir),
17
- Compass.sass_engine_options).run
17
+ Compass.sass_engine_options.merge(:quiet => options[:quiet])).run
18
18
  end
19
19
 
20
20
  end
@@ -29,6 +29,7 @@ module Compass
29
29
  end
30
30
 
31
31
  def run
32
+ Compass.configure_sass_plugin!
32
33
  target_directories.each do |dir|
33
34
  directory dir
34
35
  end
data/lib/compass/exec.rb CHANGED
@@ -98,6 +98,7 @@ END
98
98
 
99
99
  opts.on('-w', '--watch', :NONE, 'Monitor the current project for changes and update') do
100
100
  self.options[:command] = :watch_project
101
+ self.options[:quiet] = true
101
102
  end
102
103
 
103
104
  opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir|
@@ -8,7 +8,8 @@ module Compass
8
8
  :sass_dir => (sass_dir || prompt_sass_dir),
9
9
  :css_dir => (css_dir || prompt_css_dir),
10
10
  :images_dir => default_images_dir,
11
- :javascripts_dir => default_javascripts_dir
11
+ :javascripts_dir => default_javascripts_dir,
12
+ :http_images_path => default_http_images_path
12
13
  }
13
14
  end
14
15
 
@@ -49,6 +50,10 @@ NEXTSTEPS
49
50
  separate("public/javascripts")
50
51
  end
51
52
 
53
+ def default_http_images_path
54
+ "/images"
55
+ end
56
+
52
57
  def prompt_sass_dir
53
58
  recommended_location = separate('app/stylesheets')
54
59
  default_location = separate('public/stylesheets/sass')
@@ -1,4 +1,5 @@
1
1
  require 'sass'
2
+ require 'sass/plugin'
2
3
 
3
4
  module Sass::Script::Functions
4
5
  COMMA_SEPARATOR = /\s*,\s*/
@@ -34,4 +35,26 @@ module Sass::Script::Functions
34
35
  end
35
36
  Sass::Script::String.new("url(#{path})")
36
37
  end
38
+ end
39
+
40
+ # XXX: We can remove this check and monkeypatch once Sass 2.2 is released.
41
+ module Sass::Plugin
42
+ class << self
43
+ unless method_defined?(:exact_stylesheet_needs_update?)
44
+ def stylesheet_needs_update?(name, template_path, css_path)
45
+ css_file = css_filename(name, css_path)
46
+ template_file = template_filename(name, template_path)
47
+ exact_stylesheet_needs_update?(css_file, template_file)
48
+ end
49
+ def exact_stylesheet_needs_update?(css_file, template_file)
50
+ if !File.exists?(css_file)
51
+ return true
52
+ else
53
+ css_mtime = File.mtime(css_file)
54
+ File.mtime(template_file) > css_mtime ||
55
+ dependencies(template_file).any?(&dependency_updated?(css_mtime))
56
+ end
57
+ end
58
+ end
59
+ end
37
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chriseppstein-compass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Eppstein
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-19 00:00:00 -07:00
12
+ date: 2009-04-22 00:00:00 -07:00
13
13
  default_executable: compass
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency