Skip to content

Commit

Permalink
Merge commit 'nex3/master' into plugin_v2
Browse files Browse the repository at this point in the history
* commit 'nex3/master': (75 commits)
  Move a Haml changelog entry out of the Sass changelog.
  Bump VERSION to 3.0.18.
  [Haml] Fix version number checks between release/prerelease versions.
  [Haml] Make tests pass with Rails 3 rc 2.
  [Sass] Let SCSS @imports import multiple files.
  Add changelog entries for ::Rails.
  Check for Rails.env rather than Rails.root when deciding between Rails.env and RAILS_ENV.
  Reference the Rails module as ::Rails.
  Get rid of Haml::Exec::Generic.
  Get rid of --rails.
  Touch up the FAQ.
  [Haml] Fix a bug caused by the haml_tag fix.
  Set has_rdoc = false in the gemfile.
  [Sass] Convert haml_tag attribute keys to strings.
  [Sass] Add a --stop-on-error option.
  Rails 2 uses config.gem, not gem.
  Update the installation instructions in the README.
  [Haml] Document that :html5 is the default format in Rails 3.
  Document previous.
  Removed require rake by switching to Dir.[].
  ...

Conflicts:
	lib/sass/plugin.rb
	lib/sass/plugin/configuration.rb
  • Loading branch information
chriseppstein committed Sep 3, 2010
2 parents 8e03bfc + ffd10a5 commit fe9b6f2
Show file tree
Hide file tree
Showing 46 changed files with 898 additions and 405 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -29,8 +29,9 @@ For more information on these commands, check out
haml --help
sass --help

To install Haml and Sass as a Rails plugin,
just run `haml --rails path/to/rails/app`
To install Haml and Sass in Rails 2,
just add `config.gem "haml"` to `config/environment.rb`.
In Rails 3, add `gem "haml"` to your Gemfile instead.
and both Haml and Sass will be installed.
Views with the `.html.haml` extension will automatically use Haml.
Sass is a little more complicated;
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -97,7 +97,7 @@ task :release_elpa do
haml_unchanged = mode_unchanged?(:haml, version)
sass_unchanged = mode_unchanged?(:sass, version)
next if haml_unchanged && sass_unchanged
raise "haml-mode.el and sass-mode.el are out of sync." if haml_unchanged ^ sass_unchanged
raise "haml-mode.el and sass-mode.el are out of sync." if (!!haml_unchanged) ^ (!!sass_unchanged)

if sass_unchanged && File.read(scope("extra/sass-mode.el")).
include?(";; Package-Requires: ((haml-mode #{sass_unchanged.inspect}))")
Expand Down
9 changes: 5 additions & 4 deletions doc-src/FAQ.md
Expand Up @@ -132,8 +132,9 @@ in Haml, you have to do
{#q-blank-page}

There are several reasons these things might be happening.
First of all, make sure `vendor/plugins/haml` really exists
and has an `init.rb` file in there.
First of all, make sure that Haml really is installed;
either you've loaded the gem (via `config.gem` in Rails 2.3 or in the Gemfile in Rails 3),
or `vendor/plugins/haml` exists and contains files.
Then try restarting Mongrel or WEBrick or whatever you might be using.

Finally, if none of these work,
Expand Down Expand Up @@ -179,8 +180,8 @@ from your Sass functions.

## You still haven't answered my question!

Sorry! Try looking at the Haml or Sass references,
in the doucmentation for the haml and Sass modules, respectively.
Sorry! Try looking at the [Haml](http://haml-lang.com/docs/yardoc/HAML_REFERENCE.md.html)
or [Sass](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html) references,
If you can't find an answer there,
feel free to ask in `#haml` on irc.freenode.net
or send an email to the [mailing list](http://groups.google.com/group/haml?hl=en).
67 changes: 66 additions & 1 deletion doc-src/HAML_CHANGELOG.md
Expand Up @@ -3,13 +3,78 @@
* Table of contents
{:toc}

## 3.0.13 (Unreleased)
## 3.2.0 (Unreleased)

* Get rid of the `--rails` flag for the `haml` executable.
This flag hasn't been necessary since Rails 2.0.
Existing Rails 2.0 installations will continue to work.

## 3.0.18

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18).

* Don't require `rake` in the gemspec, for bundler compatibility under
JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog).

* Get rid of the annoying RDoc errors on install.

* Disambiguate references to the `Rails` module when `haml-rails` is installed.

* Fix a bug in `haml_tag` that would allow duplicate attributes to be added
and make `data-` attributes not work.

* Compatibility with Rails 3 final.

## 3.0.17

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17).

* Understand that mingw counts as Windows.

## 3.0.16

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16).

* Fix an html2haml ERB-parsing bug where ERB blocks were occasionally
left without indentation in Haml.

* Fix parsing of `if` and `case` statements whose values were assigned to variables.
This is still bad style, though.

* Fix `form_for` and `form_tag` when they're passed a block that
returns a string in a helper.

## 3.0.15

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15).

There were no changes made to Haml between versions 3.0.14 and 3.0.15.

## 3.0.14

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14).

* Allow CSS-style classes and ids to contain colons.

* Fix an obscure bug with if statements.

### Rails 3 Support

* Don't use the `#returning` method, which Rails 3 no longer provides.

## 3.0.13

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13).

## Rails 3 Support

Support for Rails 3 versions prior to beta 4 has been removed.
Upgrade to Rails 3.0.0.beta4 if you haven't already.

### Minor Improvements

* Properly process frozen strings with encoding declarations.

## 3.0.12

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12).
Expand Down
15 changes: 8 additions & 7 deletions doc-src/HAML_REFERENCE.md
Expand Up @@ -128,7 +128,8 @@ in `environment.rb` in Rails...
Available options are:

{#format-option} `:format`
: Determines the output format. The default is `:xhtml`.
: Determines the output format. Normally the default is `:xhtml`,
although under Rails 3 it's `:html5`, since that's the Rails 3's default format.
Other options are `:html4` and `:html5`, which are
identical to `:xhtml` except there are no self-closing tags,
the XML prolog is ignored and correct DOCTYPEs are generated.
Expand Down Expand Up @@ -360,10 +361,10 @@ For example:

could render as any of:

<div class="column numeric sort ascending">Contents</div>
<div class="column numeric">Contents</div>
<div class="column sort descending">Contents</div>
<div class="column">Contents</div>
<div class="numeric sort ascending">Contents</div>
<div class="numeric">Contents</div>
<div class="sort descending">Contents</div>
<div>Contents</div>

depending on whether `@item.type` is `"numeric"` or `nil`,
whether `@item == @sortcol`,
Expand Down Expand Up @@ -766,7 +767,7 @@ is compiled to:
</html>

You can also specify the specific doctype after the `!!!`
When the [`:format`](#format-option) is set to `:xhtml` (the default),
When the [`:format`](#format-option) is set to `:xhtml` (the default except in Rails 3),
the following doctypes are supported:

`!!!`
Expand Down Expand Up @@ -1279,7 +1280,7 @@ It's placed at the end of a line (after some whitespace)
and means that all following lines that end with `|`
will be evaluated as though they were on the same line.
**Note that even the last line in the multiline block
should end wit `|`.**
should end with `|`.**
For example:

%whoo
Expand Down
88 changes: 85 additions & 3 deletions doc-src/SASS_CHANGELOG.md
Expand Up @@ -3,7 +3,84 @@
* Table of contents
{:toc}

## 3.0.13 (Unreleased)
## 3.2.0 (Unreleased)

* Get rid of the `--rails` flag for the `sass` executable.
This flag hasn't been necessary since Rails 2.0.
Existing Rails 2.0 installations will continue to work.

## 3.0.18

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18).

* Don't require `rake` in the gemspec, for bundler compatibility under
JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog).

* Add a command-line option `--stop-on-error` that causes Sass to exit
when a file fails to compile using `--watch` or `--update`.

* Fix a bug in `haml_tag` that would allow duplicate attributes to be added
and make `data-` attributes not work.

* Get rid of the annoying RDoc errors on install.

* Disambiguate references to the `Rails` module when `haml-rails` is installed.

* Allow `@import` in SCSS to import multiple files in the same `@import` rule.

## 3.0.17

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17).

* Disallow `#{}` interpolation in `@media` queries or unrecognized directives.
This was never allowed, but now it explicitly throws an error
rather than just producing invalid CSS.

* Make `sass --watch` not throw an error when passed a single file or directory.

* Understand that mingw counts as Windows.

* Make `sass --update` return a non-0 exit code if one or more files being updated
contained an error.

## 3.0.16

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16).

* Fix a bug where certain sorts of comments would get improperly
rendered in the `:compact` style.

* Always allow a trailing `*/` in loud comments in the indented syntax.

* Fix a performance issue with SCSS parsing in rare cases.
Thanks to [Chris Eppstein](http://chriseppstein.github.com).

* Use better heuristics for figuring out when someone might be using
the wrong syntax with `sass --watch`.

## 3.0.15

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15).

* Fix a bug where `sass --watch` and `sass --update` were completely broken.

* Allow `@import`ed values to contain commas.

## 3.0.14

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14).

* Properly parse paths with drive letters on Windows (e.g. `C:\Foo\Bar.sass`)
in the Sass executable.

* Compile Sass files in a deterministic order.

* Fix a bug where comments after `@if` statements in SCSS
weren't getting passed through to the output document.

## 3.0.13

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13).

## CSS `@import` Directives

Expand Down Expand Up @@ -38,10 +115,15 @@ is now parsed by Sass.
The Sass command-line executable can now require Ruby files
using the `--require` flag (or `-r` for short).

## Rails 3 Support
## Rails Support

Make sure the default Rails options take precedence over the default non-Rails options.
This makes `./script/server --daemon` work again.

### Rails 3 Support

Support for Rails 3 versions prior to beta 4 has been removed.
Upg rade to Rails 3.0.0.beta4 if you haven't already.
Upgrade to Rails 3.0.0.beta4 if you haven't already.

## 3.0.12

Expand Down
40 changes: 31 additions & 9 deletions doc-src/SASS_REFERENCE.md
Expand Up @@ -759,7 +759,7 @@ For example:

$translucent-red: rgba(255, 0, 0, 0.5);
p {
color: opacify($translucent-red, 80%);
color: opacify($translucent-red, 0.8);
background-color: transparentize($translucent-red, 50%);
}

Expand Down Expand Up @@ -847,12 +847,12 @@ SassScript defines some useful functions
that are called using the normal CSS function syntax:

p {
color: hsl(0, 100%, 50%);
color: hsl(0, 100%, 0.5);
}

is compiled to:

#main {
p {
color: #ff0000; }

See {Sass::Script::Functions} for a full listing of Sass functions,
Expand Down Expand Up @@ -912,8 +912,8 @@ For example:
is compiled to:

#main {
content: First content;
new-content: First time reference; }
content: "First content";
new-content: "First time reference"; }

## `@`-Rules and Directives {#directives}

Expand All @@ -939,9 +939,18 @@ Additional search directories may be specified
using the [`:load_paths`](#load_paths-option) option,
or the `--load-path` option on the command line.

`@import` takes a filename with or without an extension.
If the extension is `.css`, it will be treated as a plain CSS `@import` rule.
If the extension is `.scss` or `.sass`, that file will be imported.
`@import` takes a filename to import.
By default, it looks for a Sass file to import directly,
but there are a few circumstances under which it will compile to a CSS `@import` rule:

* If the file's extension is `.css`.
* If the filename begins with `http://`.
* If the filename is a `url()`.
* If the `@import` has any media queries.

If none of the above conditions are met
and the extension is `.scss` or `.sass`,
then the named Sass or SCSS file will be imported.
If there is no extension,
Sass will try to find a file with that name and the `.scss` or `.sass` extension
and import it.
Expand All @@ -958,10 +967,22 @@ would both import the file `foo.scss`,
whereas

@import "foo.css";
@import "foo" screen;
@import "http://foo.com/bar";
@import url(foo);

would simply compile to
would all compile to

@import "foo.css";
@import "foo" screen;
@import "http://foo.com/bar";
@import url(foo);

It's also possible to import multiple files in one `@import`. For example:

@import "rounded-corners", "text-shadow";

would import both the `rounded-corners` and the `text-shadow` files.

#### Partials {#partials}

Expand Down Expand Up @@ -1550,6 +1571,7 @@ For example:
width: $width;
style: dashed;
}
}
p { @include sexy-border(blue); }
h1 { @include sexy-border(blue, 2in); }

Expand Down

0 comments on commit fe9b6f2

Please sign in to comment.