haml-edge 2.3.243 → 2.3.244

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.243
1
+ 2.3.244
data/Rakefile CHANGED
@@ -263,7 +263,8 @@ OPTS
263
263
 
264
264
  YARD::Rake::YardocTask.new do |t|
265
265
  t.files = FileList.new(scope('lib/**/*.rb')) do |list|
266
- list.exclude('lib/haml/template/*.rb')
266
+ list.exclude('lib/haml/template/patch.rb')
267
+ list.exclude('lib/haml/template/plugin.rb')
267
268
  list.exclude('lib/haml/railtie.rb')
268
269
  list.exclude('lib/haml/helpers/action_view_mods.rb')
269
270
  list.exclude('lib/haml/helpers/xss_mods.rb')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.243
1
+ 2.3.244
@@ -38,6 +38,11 @@ module Sass
38
38
  "#{' ' * tabs}@import \"#{@imported_filename}\";\n"
39
39
  end
40
40
 
41
+ # @see Node#cssize
42
+ def cssize(*args)
43
+ super.first
44
+ end
45
+
41
46
  protected
42
47
 
43
48
  # @see Node#_cssize
@@ -120,17 +120,6 @@ module Sass
120
120
  self.class == other.class && other.children == children
121
121
  end
122
122
 
123
- # Runs the dynamic Sass code *and* computes the CSS for the tree.
124
- #
125
- # @see #perform
126
- # @see #to_s
127
- def render
128
- extends = Haml::Util::SubsetMap.new
129
- result = perform(Environment.new).cssize(extends)
130
- result = result.do_extend(extends) unless extends.empty?
131
- result.to_s
132
- end
133
-
134
123
  # True if \{#to\_s} will return `nil`;
135
124
  # that is, if the node shouldn't be rendered.
136
125
  # Should only be called in a static tree.
@@ -21,6 +21,16 @@ module Sass
21
21
  raise e
22
22
  end
23
23
 
24
+ # Runs the dynamic Sass code *and* computes the CSS for the tree.
25
+ #
26
+ # @see #perform
27
+ # @see #to_s
28
+ def render
29
+ result, extends = perform(Environment.new).cssize
30
+ result = result.do_extend(extends) unless extends.empty?
31
+ result.to_s
32
+ end
33
+
24
34
  # @see Node#perform
25
35
  def perform(environment)
26
36
  environment.options = @options if environment.options.nil? || environment.options.empty?
@@ -30,9 +40,14 @@ module Sass
30
40
  raise e
31
41
  end
32
42
 
33
- # @see Node#cssize
34
- def cssize(*args)
35
- super
43
+ # Like {Node#cssize}, except that this method
44
+ # will create its own `extends` map if necessary,
45
+ # and it returns that map along with the cssized tree.
46
+ #
47
+ # @return [(Tree::Node, Haml::Util::SubsetMap)] The resulting tree of static nodes
48
+ # *and* the extensions defined for this tree
49
+ def cssize(extends = Haml::Util::SubsetMap.new, parent = nil)
50
+ return super(extends), extends
36
51
  rescue Sass::SyntaxError => e
37
52
  e.sass_template = @template
38
53
  raise e
@@ -37,8 +37,8 @@ LESS
37
37
  end
38
38
 
39
39
  def test_import
40
- path = File.dirname(__FILE__) + "/templates/importee.less"
41
- resolved_path = File.dirname(__FILE__) + "/templates/importee"
40
+ path = relative_path_to(File.dirname(__FILE__) + "/templates/importee.less")
41
+ resolved_path = relative_path_to(File.dirname(__FILE__) + "/templates/importee")
42
42
  assert_renders <<SCSS, <<LESS
43
43
  @import "#{resolved_path}";
44
44
  @import "#{resolved_path}";
@@ -57,8 +57,8 @@ LESS
57
57
  end
58
58
 
59
59
  def test_mixins_found_through_import
60
- path = File.dirname(__FILE__) + "/templates/importee.less"
61
- resolved_path = File.dirname(__FILE__) + "/templates/importee"
60
+ path = relative_path_to(File.dirname(__FILE__) + "/templates/importee.less")
61
+ resolved_path = relative_path_to(File.dirname(__FILE__) + "/templates/importee")
62
62
  assert_renders <<SCSS, <<LESS
63
63
  @import "#{resolved_path}";
64
64
 
@@ -618,6 +618,13 @@ LESS
618
618
  def assert_renders(scss, less)
619
619
  assert_equal(scss, Less::Engine.new(less).to_tree.to_sass_tree.to_scss)
620
620
  end
621
+
622
+ # Necessary because Less can't import absolute files
623
+ def relative_path_to(file)
624
+ file = Pathname.new(file)
625
+ pwd = file.absolute? ? Dir.pwd : "."
626
+ file.relative_path_from(Pathname.new(pwd))
627
+ end
621
628
  end
622
629
 
623
630
  rescue LoadError => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.243
4
+ version: 2.3.244
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-05-04 00:00:00 -04:00
13
+ date: 2010-05-05 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency