compass-rails 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.travis.yml +1 -0
- data/README.md +5 -98
- data/lib/compass-rails.rb +1 -1
- data/lib/compass-rails/patches/sprite_importer.rb +0 -1
- data/lib/compass-rails/version.rb +1 -1
- data/sache.json +5 -0
- data/test/helpers/command_helper.rb +1 -3
- data/test/helpers/debug_helper.rb +2 -2
- data/test/helpers/file_helper.rb +4 -4
- data/test/helpers/rails_helper.rb +1 -1
- data/test/helpers/rails_project.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Njg0OTJkZjEyNzhlNGM1YzQzYWE1MzFhM2RhNTZhMzkyMTIyZGNhOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmFkMGZlYTI3NTExNjVjMzU5MWI3ZDkxOWNiYmE2MzllZTFmMDBkMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDk3N2IzZDQwNjgyMWVmY2JhZjhlNmNhNjYyMDkxYTdiNDY0MjNiZTQyOTQ2
|
10
|
+
YTk5Nzc1NjI5MGM2MTJmMjc3YjBkZDdhYTNkMTY5NDVhYmMwMDk2NGIzYTY2
|
11
|
+
MzcxYzYwNzg3OTZjMGJjZGM1OTZkYTQ1MjYyNDNhZDczODA2YzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTkzZTEwNDFlNDcyMjZlMjVmZmQwMjI0YzQ3NGQ3NmVkYWY4OTgyNGU4Nzg2
|
14
|
+
MTkzZDE5MTRmNWQ1YmZmZGI5NTBiYzQ0ZDcxY2Q0MWJjMTdlNDE5NGY3NzEy
|
15
|
+
M2U0Yzc5YjQ2ZTk2YjQ2ODQ5NDU1Y2RlZGQ2N2MzNDRlOTk0MDg=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# compass-rails
|
2
|
+
|
3
|
+
**We Take Pull Requests!**
|
2
4
|
|
3
5
|
[![Build Status](https://travis-ci.org/Compass/compass-rails.png?branch=stable)](https://travis-ci.org/Compass/compass-rails)
|
4
6
|
[![Code Climate](https://codeclimate.com/github/Compass/compass-rails.png)](https://codeclimate.com/github/Compass/compass-rails)
|
@@ -6,10 +8,9 @@
|
|
6
8
|
Compass rails is an adapter for the [Compass Stylesheet Authoring
|
7
9
|
Framework](http://compass-style.org) for [Ruby on Rails](http://rubyonrails.org/).
|
8
10
|
|
9
|
-
Since Compass v0.12, this
|
10
|
-
into your rails application.
|
11
|
+
Since Compass v0.12.0, this is the only way to use compass with your rails application.
|
11
12
|
|
12
|
-
|
13
|
+
Supports Rails 3.x, 4.x releases.
|
13
14
|
|
14
15
|
## Installation
|
15
16
|
|
@@ -50,19 +51,6 @@ Use `application.css` to require files that use compass features. Ex:
|
|
50
51
|
|
51
52
|
*Don't* use `*= require something` within your SCSS or SASS files. You're gonna have a bad time.
|
52
53
|
|
53
|
-
## Optional
|
54
|
-
|
55
|
-
To set up your project with starter stylesheets and a configuration
|
56
|
-
file:
|
57
|
-
|
58
|
-
$ bundle exec compass init
|
59
|
-
|
60
|
-
If using a compass-based framework (like [susy](http://susy.oddbird.net/) or [blueprint](http://compass-style.org/reference/blueprint/)) then you can use the `--using` option to set this:
|
61
|
-
|
62
|
-
$ bundle exec compass init --using blueprint
|
63
|
-
|
64
|
-
Note that the `compass init` step is optional if you have a project running Rails 3.0 or greater.
|
65
|
-
|
66
54
|
### Configuration
|
67
55
|
|
68
56
|
If you have a compass configuration file (recommended) then you can
|
@@ -73,52 +61,6 @@ files, then you should understand that the compass configuration
|
|
73
61
|
options explained there will be methods and properties on the `config.compass`
|
74
62
|
configuration object exposed to rails within any configuration block.
|
75
63
|
|
76
|
-
### Notes On Sprockets Directives
|
77
|
-
|
78
|
-
Sprockets, used by the rails asset pipeline, provides directives for
|
79
|
-
doing things like requiring. These **must not** be used with Sass files.
|
80
|
-
Instead use the sass `@import` directive. In rails projects, the
|
81
|
-
`@import` directive is configured to work with sprockets via `sass-rails`. For more information on importing in rails 3.1 or greater see the [Sass-Rails README](https://github.com/rails/sass-rails/blob/master/README.md)
|
82
|
-
|
83
|
-
### Developing with Rails-based Compilation
|
84
|
-
|
85
|
-
By default, your sass files in `app/assets/stylesheets` will be
|
86
|
-
automatically compiled by the [`Sass::Plugin`](http://sass-lang.com/docs/yardoc/Sass/Plugin.html) or the [Rails asset
|
87
|
-
pipeline](http://guides.rubyonrails.org/asset_pipeline.html) depending on the version of rails that you use.
|
88
|
-
|
89
|
-
When using this approach you will need to reload your webpage in order
|
90
|
-
to trigger a recompile of your stylesheets.
|
91
|
-
|
92
|
-
### Developing with the Compass watcher
|
93
|
-
|
94
|
-
When using the Compass watcher to update your stylesheets, your
|
95
|
-
stylesheets are recompiled as soon as you save your Sass files. In this
|
96
|
-
mode, compiled stylesheets will be written to your project's public
|
97
|
-
folder and therefore will be served directly by your project's web
|
98
|
-
server -- superceding the normal rails compilation.
|
99
|
-
|
100
|
-
In this mode, rails 3.0 or earlier users will experience a slight
|
101
|
-
speed up by disabling the `Sass::Plugin` like so:
|
102
|
-
|
103
|
-
```ruby
|
104
|
-
config.after_initialize do
|
105
|
-
Sass::Plugin.options[:never_update] = true
|
106
|
-
end
|
107
|
-
```
|
108
|
-
|
109
|
-
To return to using the Rails-based compilation mode, simply delete
|
110
|
-
the compiled stylesheets and remove any configuration changes.
|
111
|
-
|
112
|
-
### Compiling for Production without Asset Pipeline
|
113
|
-
|
114
|
-
If not using the asset pipeline run:
|
115
|
-
|
116
|
-
$ bundle exec compass compile -e production --force
|
117
|
-
|
118
|
-
It is suggested that you compile your stylesheets as part of the deploy
|
119
|
-
or build process. However, some people choose to check in their compiled
|
120
|
-
stylesheets.
|
121
|
-
|
122
64
|
### Installing Compass extensions
|
123
65
|
|
124
66
|
Step 1: Add it to your Gemfile in the `:assets` group and run the `bundle` command to install it.
|
@@ -149,41 +91,6 @@ config.compass.require "susy"
|
|
149
91
|
|
150
92
|
to your application.rb configuration file.
|
151
93
|
|
152
|
-
## Rails 3.1 Caveats
|
153
|
-
|
154
|
-
compass-rails requires Rails 3.1.1 and greater. Also, Rails 3.1 is out of support so consider upgrading.
|
155
|
-
|
156
|
-
## Rails 3.0 Caveats
|
157
|
-
|
158
|
-
If you want rails to compile your stylesheets (instead of using the
|
159
|
-
compass watcher) you need to edit `config/application.rb` and change:
|
160
|
-
|
161
|
-
```ruby
|
162
|
-
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
163
|
-
```
|
164
|
-
|
165
|
-
to this:
|
166
|
-
|
167
|
-
```ruby
|
168
|
-
Bundler.require(:default, :assets, Rails.env) if defined?(Bundler)
|
169
|
-
```
|
170
|
-
|
171
|
-
Also, Rails 3.0 is out of support so consider upgrading.
|
172
|
-
|
173
|
-
## Upgrading Rails 3.0 and older projects to compass-rails
|
174
|
-
|
175
|
-
First and foremost, follow the installation instructions above.
|
176
|
-
|
177
|
-
CompassRails uses the rails convention for stylesheet locations even in
|
178
|
-
older versions of rails that do not use the assets pipeline.
|
179
|
-
If you have your stylesheets already in `app/stylesheets`, you have two choices:
|
180
|
-
|
181
|
-
1. Move your stylesheets to `app/assets/stylesheets`.
|
182
|
-
2. Configure your project to look in the **legacy location** of
|
183
|
-
`app/stylesheets` by setting `config.compass.sass_dir =
|
184
|
-
"app/stylesheets"` in your rails configuration or by setting
|
185
|
-
`sass_dir = "app/stylesheets"` in your compass configuration file.
|
186
|
-
|
187
94
|
## Contributing
|
188
95
|
|
189
96
|
1. Fork it
|
data/lib/compass-rails.rb
CHANGED
@@ -216,7 +216,7 @@ module CompassRails
|
|
216
216
|
end
|
217
217
|
|
218
218
|
def asset_pipeline_enabled?
|
219
|
-
return false unless rails_loaded?
|
219
|
+
return false unless rails_loaded? && ::Rails.respond_to?(:application) && !::Rails.application.nil?
|
220
220
|
rails_config = ::Rails.application.config
|
221
221
|
if rails_config.respond_to?(:assets)
|
222
222
|
rails_config.assets.enabled != false
|
@@ -13,7 +13,6 @@ module CompassRails
|
|
13
13
|
def find(uri, options)
|
14
14
|
if old = super(uri, options)
|
15
15
|
self.class.files(uri).each do |file|
|
16
|
-
puts file.inspect
|
17
16
|
relative_path = Pathname.new(file).relative_path_from(Pathname.new(root))
|
18
17
|
begin
|
19
18
|
pathname = context.resolve(relative_path)
|
data/sache.json
ADDED
@@ -43,7 +43,7 @@ module CompassRails
|
|
43
43
|
BUNDLER_COMMAND = 'bundle'
|
44
44
|
|
45
45
|
def run_command(command, gemfile=nil)
|
46
|
-
debug("Running: #{command} with gemfile: #{gemfile}".foreground(:cyan))
|
46
|
+
debug(Rainbow("Running: #{command} with gemfile: #{gemfile}").foreground(:cyan))
|
47
47
|
capture_all_output { CompassRails::Test::CommandRunner.new(command, gemfile).run }
|
48
48
|
end
|
49
49
|
|
@@ -116,5 +116,3 @@ class CompassRails::Test::CommandRunner
|
|
116
116
|
@original_env.each { |key, value| ENV[key] = value }
|
117
117
|
end
|
118
118
|
end
|
119
|
-
|
120
|
-
|
data/test/helpers/file_helper.rb
CHANGED
@@ -4,19 +4,19 @@ module CompassRails
|
|
4
4
|
include DebugHelper
|
5
5
|
|
6
6
|
def mkdir_p(dir)
|
7
|
-
debug("Creating Directory: #{dir}".foreground(:green))
|
7
|
+
debug(Rainbow("Creating Directory: #{dir}").foreground(:green))
|
8
8
|
::FileUtils.mkdir_p dir
|
9
9
|
assert File.directory?(dir), "mkdir_p: #{dir} failed"
|
10
10
|
end
|
11
11
|
|
12
12
|
def rm_rf(path)
|
13
|
-
debug("Removing: #{path}".foreground(:red))
|
13
|
+
debug(Rainbow("Removing: #{path}").foreground(:red))
|
14
14
|
::FileUtils.rm_rf(path)
|
15
15
|
assert !File.directory?(path), "rm_rf: #{path} failed"
|
16
16
|
end
|
17
17
|
|
18
18
|
def cd(path, &block)
|
19
|
-
debug("Entered: #{path}".foreground(:yellow))
|
19
|
+
debug(Rainbow("Entered: #{path}").foreground(:yellow))
|
20
20
|
Dir.chdir(path, &block)
|
21
21
|
end
|
22
22
|
|
@@ -27,7 +27,7 @@ module CompassRails
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def touch(file)
|
30
|
-
debug("Touching File: #{file}".foreground(:green))
|
30
|
+
debug(Rainbow("Touching File: #{file}").foreground(:green))
|
31
31
|
::FileUtils.touch(file)
|
32
32
|
end
|
33
33
|
|
@@ -34,7 +34,7 @@ module CompassRails
|
|
34
34
|
}
|
35
35
|
|
36
36
|
def rails_command(options, version)
|
37
|
-
debug("Running Rails command with: rails #{options.join(' ')}".foreground(:cyan))
|
37
|
+
debug(Rainbow("Running Rails command with: rails #{options.join(' ')}").foreground(:cyan))
|
38
38
|
run_command("rails #{options.join(' ')}", GEMFILES[version])
|
39
39
|
end
|
40
40
|
|
@@ -109,7 +109,7 @@ module CompassRails
|
|
109
109
|
|
110
110
|
def add_to_gemfile(name, requirements)
|
111
111
|
gemfile = directory.join(GEMFILE)
|
112
|
-
debug("Adding gem #{name} to file: #{gemfile}".foreground(:green))
|
112
|
+
debug(Rainbow("Adding gem #{name} to file: #{gemfile}").foreground(:green))
|
113
113
|
if requirements
|
114
114
|
gem_string = " gem '#{name}', #{requirements}\n"
|
115
115
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Davis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/compass-rails/railties/3_1.rb
|
68
68
|
- lib/compass-rails/railties/4_0.rb
|
69
69
|
- lib/compass-rails/version.rb
|
70
|
+
- sache.json
|
70
71
|
- test/fixtures/.gitkeep
|
71
72
|
- test/helpers/command_helper.rb
|
72
73
|
- test/helpers/debug_helper.rb
|