Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/sass/selector/sequence.rb
	test/sass/scss/scss_test.rb
  • Loading branch information
nex3 committed Aug 3, 2012
2 parents 4b0ad09 + 2798d48 commit daf44b6
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 5 deletions.
13 changes: 11 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
# Don't use Rake::GemPackageTast because we want prerequisites to run
# before we load the gemspec.
desc "Build all the packages."
task :package => [:revision_file, :submodules, :permissions] do
task :package => [:revision_file, :date_file, :submodules, :permissions] do
version = get_version
File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
load scope('sass.gemspec')
Expand Down Expand Up @@ -63,8 +63,17 @@ task :revision_file do
end
end

task :date_file do
File.open(scope('VERSION_DATE'), 'w') do |f|
f.puts Time.now.utc.strftime('%d %B %Y %T %Z')
end
end

# We also need to get rid of this file after packaging.
at_exit { File.delete(scope('REVISION')) rescue nil }
at_exit do
File.delete(scope('REVISION')) rescue nil
File.delete(scope('VERSION_DATE')) rescue nil
end

desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
task :install => [:package] do
Expand Down
5 changes: 5 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ This will not print a warning.

* Preserve single-line comments that are embedded within multi-line comments.

* Preserve newlines in nested selectors when those selectors are used multiple
times in the same document.

* Allow tests to be run without the `LANG` environment variable set.

* Update the bundled version of [Listen](https://github.com/guard/listen) to
0.4.7.

Expand Down
6 changes: 3 additions & 3 deletions lib/sass/selector/sequence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ def initialize(seqs_and_ops)
# @return [Sequence] This selector, with parent references resolved
# @raise [Sass::SyntaxError] If a parent selector is invalid
def resolve_parent_refs(super_seq)
members = @members
members = @members.dup
nl = (members.first == "\n" && members.shift)
unless members.any? do |seq_or_op|
seq_or_op.is_a?(SimpleSequence) && seq_or_op.members.first.is_a?(Parent)
end
members = []
old_members, members = members, []
members << nl if nl
members << SimpleSequence.new([Parent.new], false)
members += @members
members += old_members
end

Sequence.new(
Expand Down
14 changes: 14 additions & 0 deletions lib/sass/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'date'

# This is necessary for loading Sass when Haml is required in Rails 3.
# Once the split is complete, we can remove it.
require File.dirname(__FILE__) + '/../sass'
Expand All @@ -16,13 +18,15 @@ module Version
# The `:name` key has the name of the version.
# The `:string` key contains a human-readable string representation of the version.
# The `:number` key is the major, minor, and teeny keys separated by periods.
# The `:date` key, which is not guaranteed to be defined, is the [DateTime] at which this release was cut.
# If Sass is checked out from Git, the `:rev` key will have the revision hash.
# For example:
#
# {
# :string => "2.1.0.9616393",
# :rev => "9616393b8924ef36639c7e82aa88a51a24d16949",
# :number => "2.1.0",
# :date => DateTime.parse("Apr 30 13:52:01 2009 -0700"),
# :major => 2, :minor => 1, :teeny => 0
# }
#
Expand All @@ -36,6 +40,7 @@ module Version
# {
# :string => "3.0.beta.1",
# :number => "3.0.beta.1",
# :date => DateTime.parse("Mar 31 00:38:04 2010 -0700"),
# :major => 3, :minor => 0, :teeny => -1,
# :prerelease => "beta",
# :prerelease_number => 1
Expand All @@ -55,6 +60,10 @@ def version
:name => name
}

if date = version_date
@@version[:date] = date
end

if numbers[3].is_a?(String)
@@version[:teeny] = -1
@@version[:prerelease] = numbers[3]
Expand Down Expand Up @@ -101,6 +110,11 @@ def revision_number
end
return nil
end

def version_date
return unless File.exists?(scope('VERSION_DATE'))
return DateTime.parse(File.read(scope('VERSION_DATE')).strip)
end
end

extend Sass::Version
Expand Down
21 changes: 21 additions & 0 deletions test/sass/scss/scss_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,27 @@ def test_reference_combinator_with_parent_ref
SCSS
end

def test_newline_selector_rendered_multiple_times
assert_equal <<CSS, render(<<SCSS)
form input,
form select {
color: white; }
form input,
form select {
color: white; }
CSS
@for $i from 1 through 2 {
form {
input,
select {
color: white;
}
}
}
SCSS
end

def test_prop_name_interpolation_after_hyphen
assert_equal <<CSS, render(<<SCSS)
a {
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require 'mathn' if ENV['MATHN'] == 'true'

Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)
Encoding.default_external = 'UTF-8' if defined?(Encoding)

module Sass::Script::Functions
def option(name)
Expand Down

0 comments on commit daf44b6

Please sign in to comment.