Skip to content
This repository
Browse code

Merge branch 'stable'

Conflicts:
	lib/sass/selector/sequence.rb
	test/sass/scss/scss_test.rb
  • Loading branch information...
commit daf44b6e5e3a25e1fadb77a4161ffe27edea74ab 2 parents 4b0ad09 + 2798d48
Nathan Weizenbaum authored August 03, 2012
13  Rakefile
@@ -24,7 +24,7 @@ end
24 24
 # Don't use Rake::GemPackageTast because we want prerequisites to run
25 25
 # before we load the gemspec.
26 26
 desc "Build all the packages."
27  
-task :package => [:revision_file, :submodules, :permissions] do
  27
+task :package => [:revision_file, :date_file, :submodules, :permissions] do
28 28
   version = get_version
29 29
   File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
30 30
   load scope('sass.gemspec')
@@ -63,8 +63,17 @@ task :revision_file do
63 63
   end
64 64
 end
65 65
 
  66
+task :date_file do
  67
+  File.open(scope('VERSION_DATE'), 'w') do |f|
  68
+    f.puts Time.now.utc.strftime('%d %B %Y %T %Z')
  69
+  end
  70
+end
  71
+
66 72
 # We also need to get rid of this file after packaging.
67  
-at_exit { File.delete(scope('REVISION')) rescue nil }
  73
+at_exit do
  74
+  File.delete(scope('REVISION')) rescue nil
  75
+  File.delete(scope('VERSION_DATE')) rescue nil
  76
+end
68 77
 
69 78
 desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
70 79
 task :install => [:package] do
5  doc-src/SASS_CHANGELOG.md
Source Rendered
@@ -185,6 +185,11 @@ This will not print a warning.
185 185
 
186 186
 * Preserve single-line comments that are embedded within multi-line comments.
187 187
 
  188
+* Preserve newlines in nested selectors when those selectors are used multiple
  189
+  times in the same document.
  190
+
  191
+* Allow tests to be run without the `LANG` environment variable set.
  192
+
188 193
 * Update the bundled version of [Listen](https://github.com/guard/listen) to
189 194
   0.4.7.
190 195
 
6  lib/sass/selector/sequence.rb
@@ -46,15 +46,15 @@ def initialize(seqs_and_ops)
46 46
       # @return [Sequence] This selector, with parent references resolved
47 47
       # @raise [Sass::SyntaxError] If a parent selector is invalid
48 48
       def resolve_parent_refs(super_seq)
49  
-        members = @members
  49
+        members = @members.dup
50 50
         nl = (members.first == "\n" && members.shift)
51 51
         unless members.any? do |seq_or_op|
52 52
             seq_or_op.is_a?(SimpleSequence) && seq_or_op.members.first.is_a?(Parent)
53 53
           end
54  
-          members = []
  54
+          old_members, members = members, []
55 55
           members << nl if nl
56 56
           members << SimpleSequence.new([Parent.new], false)
57  
-          members += @members
  57
+          members += old_members
58 58
         end
59 59
 
60 60
         Sequence.new(
14  lib/sass/version.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'date'
  2
+
1 3
 # This is necessary for loading Sass when Haml is required in Rails 3.
2 4
 # Once the split is complete, we can remove it.
3 5
 require File.dirname(__FILE__) + '/../sass'
@@ -16,6 +18,7 @@ module Version
16 18
     # The `:name` key has the name of the version.
17 19
     # The `:string` key contains a human-readable string representation of the version.
18 20
     # The `:number` key is the major, minor, and teeny keys separated by periods.
  21
+    # The `:date` key, which is not guaranteed to be defined, is the [DateTime] at which this release was cut.
19 22
     # If Sass is checked out from Git, the `:rev` key will have the revision hash.
20 23
     # For example:
21 24
     #
@@ -23,6 +26,7 @@ module Version
23 26
     #       :string => "2.1.0.9616393",
24 27
     #       :rev    => "9616393b8924ef36639c7e82aa88a51a24d16949",
25 28
     #       :number => "2.1.0",
  29
+    #       :date   => DateTime.parse("Apr 30 13:52:01 2009 -0700"),
26 30
     #       :major  => 2, :minor => 1, :teeny => 0
27 31
     #     }
28 32
     #
@@ -36,6 +40,7 @@ module Version
36 40
     #     {
37 41
     #       :string => "3.0.beta.1",
38 42
     #       :number => "3.0.beta.1",
  43
+    #       :date   => DateTime.parse("Mar 31 00:38:04 2010 -0700"),
39 44
     #       :major => 3, :minor => 0, :teeny => -1,
40 45
     #       :prerelease => "beta",
41 46
     #       :prerelease_number => 1
@@ -55,6 +60,10 @@ def version
55 60
         :name => name
56 61
       }
57 62
 
  63
+      if date = version_date
  64
+        @@version[:date] = date
  65
+      end
  66
+
58 67
       if numbers[3].is_a?(String)
59 68
         @@version[:teeny] = -1
60 69
         @@version[:prerelease] = numbers[3]
@@ -101,6 +110,11 @@ def revision_number
101 110
       end
102 111
       return nil
103 112
     end
  113
+
  114
+    def version_date
  115
+      return unless File.exists?(scope('VERSION_DATE'))
  116
+      return DateTime.parse(File.read(scope('VERSION_DATE')).strip)
  117
+    end
104 118
   end
105 119
 
106 120
   extend Sass::Version
21  test/sass/scss/scss_test.rb
@@ -1357,6 +1357,27 @@ def test_reference_combinator_with_parent_ref
1357 1357
 SCSS
1358 1358
   end
1359 1359
 
  1360
+  def test_newline_selector_rendered_multiple_times
  1361
+    assert_equal <<CSS, render(<<SCSS)
  1362
+form input,
  1363
+form select {
  1364
+  color: white; }
  1365
+
  1366
+form input,
  1367
+form select {
  1368
+  color: white; }
  1369
+CSS
  1370
+@for $i from 1 through 2 {
  1371
+  form {
  1372
+    input,
  1373
+    select {
  1374
+      color: white;
  1375
+    }
  1376
+  }
  1377
+}
  1378
+SCSS
  1379
+  end
  1380
+
1360 1381
   def test_prop_name_interpolation_after_hyphen
1361 1382
     assert_equal <<CSS, render(<<SCSS)
1362 1383
 a {
1  test/test_helper.rb
@@ -7,6 +7,7 @@
7 7
 require 'mathn' if ENV['MATHN'] == 'true'
8 8
 
9 9
 Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)
  10
+Encoding.default_external = 'UTF-8' if defined?(Encoding)
10 11
 
11 12
 module Sass::Script::Functions
12 13
   def option(name)

0 notes on commit daf44b6

Please sign in to comment.
Something went wrong with that request. Please try again.