compass-rails 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +15 -15
- data/lib/compass-rails.rb +7 -10
- data/lib/compass-rails/configuration/{3_1.rb → asset_pipeline.rb} +1 -1
- data/lib/compass-rails/patches/3_1.rb +1 -19
- data/lib/compass-rails/patches/4_0.rb +1 -14
- data/lib/compass-rails/patches/compass.rb +12 -0
- data/lib/compass-rails/version.rb +1 -1
- data/test/helpers/rails_project.rb +0 -10
- metadata +11 -15
- data/lib/compass-rails/railties/2_3.rb +0 -56
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MmUwYjg0NjMwMzRhNjQ3NGUzYTQ5OThkY2VhMTU4MTc3ZjY4ODdhMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ODQ0YzAyNDIyNmI3NDU2OTJlZGJlMzg4MDdlODYyMzFkNmU4M2UzZQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NGQ0YjRlYTM1NTBiMWUzYzEyZGQwNmU4OThkNGJhMjc3NTRkYzgyY2JlYmI2
|
10
|
+
NjMyOWFiMjJmZGRiZjVhM2EyZjExNDUxMmMwZjM2ZmIwNTQxMDU0OTM2ZDg5
|
11
|
+
MzlmYjFhNTdiNmI1YmMwNjY0OWI3MDUyMWJkYWMxMWQyMmFkYjA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YmNlMGQ2NTU2OWU3ZWYxN2FhN2M3NzNjYzAzNzEzZTkzN2Q4NmQxOTZlMTkz
|
14
|
+
Mjc4YWRhMGFiNzk3ODNlNTQwZmZhMzYwMjA5MDgxNWYxNmZlOWUxMDYyOGY1
|
15
|
+
MTUwZjQ2ZWJlMjVkNDYxMzdiN2FhZTA4YTk2ODM4MGY5ZTdhMjU=
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# CompassRails
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/Compass/compass-rails.png?branch=stable)](https://travis-ci.org/Compass/compass-rails)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/Compass/compass-rails.png)](https://codeclimate.com/github/Compass/compass-rails)
|
4
5
|
|
5
6
|
Compass rails is an adapter for the [Compass Stylesheet Authoring
|
6
7
|
Framework](http://compass-style.org) for [Ruby on Rails](http://rubyonrails.org/).
|
@@ -8,8 +9,7 @@ Framework](http://compass-style.org) for [Ruby on Rails](http://rubyonrails.org/
|
|
8
9
|
Since Compass v0.12, this adapter is the only way to install compass
|
9
10
|
into your rails application.
|
10
11
|
|
11
|
-
This adapter supports
|
12
|
-
please read the caveats below.
|
12
|
+
This adapter supports Rails 3.x, 4.x releases.
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
@@ -29,19 +29,6 @@ And then execute:
|
|
29
29
|
|
30
30
|
$ bundle
|
31
31
|
|
32
|
-
## Optional
|
33
|
-
|
34
|
-
To set up your project with starter stylesheets and a configuration
|
35
|
-
file:
|
36
|
-
|
37
|
-
$ bundle exec compass init
|
38
|
-
|
39
|
-
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:
|
40
|
-
|
41
|
-
$ bundle exec compass init --using blueprint
|
42
|
-
|
43
|
-
Note that the `compass init` step is optional if you have a project running Rails 3.0 or greater.
|
44
|
-
|
45
32
|
## Usage
|
46
33
|
|
47
34
|
Change your `application.css` to `application.css.scss` or `application.css.sass` and use `@import` to your hearts content. Ex:
|
@@ -63,6 +50,19 @@ Use `application.css` to require files that use compass features. Ex:
|
|
63
50
|
|
64
51
|
*Don't* use `*= require something` within your SCSS or SASS files. You're gonna have a bad time.
|
65
52
|
|
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
66
|
### Configuration
|
67
67
|
|
68
68
|
If you have a compass configuration file (recommended) then you can
|
data/lib/compass-rails.rb
CHANGED
@@ -7,7 +7,6 @@ module CompassRails
|
|
7
7
|
RAILS_4 = %r{^4.[0|1]}
|
8
8
|
RAILS_32 = %r{^3.2}
|
9
9
|
RAILS_31 = %r{^3.1}
|
10
|
-
RAILS_23 = %r{^2.3}
|
11
10
|
RAILS_3 = %r{^3.0}
|
12
11
|
|
13
12
|
extend self
|
@@ -125,11 +124,9 @@ module CompassRails
|
|
125
124
|
load_rails
|
126
125
|
config = Compass::Configuration::Data.new('rails')
|
127
126
|
config.extend(Configuration::Default)
|
128
|
-
if
|
129
|
-
|
130
|
-
|
131
|
-
config.extend(Configuration::Rails3_1)
|
132
|
-
end
|
127
|
+
if asset_pipeline_enabled?
|
128
|
+
require "compass-rails/configuration/asset_pipeline"
|
129
|
+
config.extend(Configuration::AssetPipeline)
|
133
130
|
end
|
134
131
|
config
|
135
132
|
end
|
@@ -176,7 +173,7 @@ module CompassRails
|
|
176
173
|
end
|
177
174
|
end
|
178
175
|
|
179
|
-
# Rails
|
176
|
+
# Rails projects without asset pipeline use this in their compass initializer.
|
180
177
|
def initialize!(config = nil)
|
181
178
|
check_for_double_boot!
|
182
179
|
config ||= Compass.detect_configuration_file(root)
|
@@ -221,10 +218,10 @@ module CompassRails
|
|
221
218
|
def asset_pipeline_enabled?
|
222
219
|
return false unless rails_loaded?
|
223
220
|
rails_config = ::Rails.application.config
|
224
|
-
|
225
|
-
rails_config.
|
221
|
+
if rails_config.respond_to?(:assets)
|
222
|
+
rails_config.assets.enabled != false
|
226
223
|
else
|
227
|
-
|
224
|
+
false
|
228
225
|
end
|
229
226
|
end
|
230
227
|
|
@@ -1,30 +1,12 @@
|
|
1
|
+
require 'compass-rails/patches/compass'
|
1
2
|
require 'compass-rails/patches/static_compiler'
|
2
3
|
|
3
4
|
module Sass::Script::Functions
|
4
5
|
def generated_image_url(path, only_path = nil)
|
5
|
-
path = if Compass.configuration.generated_images_dir
|
6
|
-
full_path = File.join(Compass.configuration.generated_images_dir, path.value)
|
7
|
-
Sass::Script::String.new full_path.sub(File.join('app', 'assets', 'images'), "")[1..-1]
|
8
|
-
end
|
9
|
-
|
10
6
|
asset_url(path, Sass::Script::String.new("image"))
|
11
7
|
end
|
12
8
|
end
|
13
9
|
|
14
|
-
|
15
|
-
module Compass::RailsImageFunctionPatch
|
16
|
-
private
|
17
|
-
|
18
|
-
def image_path_for_size(image_file)
|
19
|
-
begin
|
20
|
-
file = ::Rails.application.assets.find_asset(image_file)
|
21
|
-
return file
|
22
|
-
rescue ::Sprockets::FileOutsidePaths
|
23
|
-
return super(image_file)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
10
|
module Sass::Script::Functions
|
29
11
|
include Compass::RailsImageFunctionPatch
|
30
12
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'compass-rails/patches/compass'
|
1
2
|
require 'compass-rails/patches/sass_importer'
|
2
3
|
require 'compass-rails/patches/sprite_importer'
|
3
4
|
|
@@ -14,20 +15,6 @@ module Sass::Script::Functions
|
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
17
|
-
|
18
|
-
module Compass::RailsImageFunctionPatch
|
19
|
-
private
|
20
|
-
|
21
|
-
def image_path_for_size(image_file)
|
22
|
-
begin
|
23
|
-
file = ::Rails.application.assets.find_asset(image_file)
|
24
|
-
return file
|
25
|
-
rescue ::Sprockets::FileOutsidePaths
|
26
|
-
return super(image_file)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
18
|
module Sass::Script::Functions
|
32
19
|
include Compass::RailsImageFunctionPatch
|
33
20
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Compass::RailsImageFunctionPatch
|
2
|
+
private
|
3
|
+
|
4
|
+
def image_path_for_size(image_file)
|
5
|
+
begin
|
6
|
+
file = ::Rails.application.assets.find_asset(image_file)
|
7
|
+
return file
|
8
|
+
rescue ::Sprockets::FileOutsidePaths
|
9
|
+
return super(image_file)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -103,16 +103,6 @@ module CompassRails
|
|
103
103
|
inject_into_file(directory.join(APPLICATION_FILE), value, :after, 'class Application < Rails::Application')
|
104
104
|
end
|
105
105
|
|
106
|
-
## GEM METHODS
|
107
|
-
|
108
|
-
def configure_for_bundler!
|
109
|
-
Rails.logger.warn("This method is deprecated") && return
|
110
|
-
end
|
111
|
-
|
112
|
-
def bundle
|
113
|
-
raise "NO BUNDLE FOR U"
|
114
|
-
end
|
115
|
-
|
116
106
|
private
|
117
107
|
|
118
108
|
## GEM METHODS
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.1.2
|
4
|
+
version: 1.1.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Scott Davis
|
@@ -11,24 +10,22 @@ authors:
|
|
11
10
|
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date: 2013-12-
|
13
|
+
date: 2013-12-27 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
requirements:
|
19
18
|
- - ! '>='
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: 0.12.2
|
22
|
-
none: false
|
23
|
-
name: compass
|
24
|
-
type: :runtime
|
25
21
|
prerelease: false
|
26
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
23
|
requirements:
|
28
24
|
- - ! '>='
|
29
25
|
- !ruby/object:Gem::Version
|
30
26
|
version: 0.12.2
|
31
|
-
|
27
|
+
name: compass
|
28
|
+
type: :runtime
|
32
29
|
description: Integrate Compass into Rails 3.0 and up.
|
33
30
|
email:
|
34
31
|
- jetviper21@gmail.com
|
@@ -54,18 +51,18 @@ files:
|
|
54
51
|
- gemfiles/rails40.gemfile
|
55
52
|
- lib/compass-rails.rb
|
56
53
|
- lib/compass-rails/configuration.rb
|
57
|
-
- lib/compass-rails/configuration/
|
54
|
+
- lib/compass-rails/configuration/asset_pipeline.rb
|
58
55
|
- lib/compass-rails/configuration/default.rb
|
59
56
|
- lib/compass-rails/installer.rb
|
60
57
|
- lib/compass-rails/patches.rb
|
61
58
|
- lib/compass-rails/patches/3_1.rb
|
62
59
|
- lib/compass-rails/patches/4_0.rb
|
60
|
+
- lib/compass-rails/patches/compass.rb
|
63
61
|
- lib/compass-rails/patches/importer.rb
|
64
62
|
- lib/compass-rails/patches/sass_importer.rb
|
65
63
|
- lib/compass-rails/patches/sprite_importer.rb
|
66
64
|
- lib/compass-rails/patches/static_compiler.rb
|
67
65
|
- lib/compass-rails/railties.rb
|
68
|
-
- lib/compass-rails/railties/2_3.rb
|
69
66
|
- lib/compass-rails/railties/3_0.rb
|
70
67
|
- lib/compass-rails/railties/3_1.rb
|
71
68
|
- lib/compass-rails/railties/4_0.rb
|
@@ -87,6 +84,7 @@ files:
|
|
87
84
|
homepage: https://github.com/Compass/compass-rails
|
88
85
|
licenses:
|
89
86
|
- MIT
|
87
|
+
metadata: {}
|
90
88
|
post_install_message:
|
91
89
|
rdoc_options: []
|
92
90
|
require_paths:
|
@@ -96,18 +94,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
94
|
- - ! '>='
|
97
95
|
- !ruby/object:Gem::Version
|
98
96
|
version: '0'
|
99
|
-
none: false
|
100
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
98
|
requirements:
|
102
99
|
- - ! '>='
|
103
100
|
- !ruby/object:Gem::Version
|
104
101
|
version: '0'
|
105
|
-
none: false
|
106
102
|
requirements: []
|
107
103
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.
|
104
|
+
rubygems_version: 2.1.11
|
109
105
|
signing_key:
|
110
|
-
specification_version:
|
106
|
+
specification_version: 4
|
111
107
|
summary: Integrate Compass into Rails 3.0 and up.
|
112
108
|
test_files:
|
113
109
|
- test/fixtures/.gitkeep
|
@@ -1,56 +0,0 @@
|
|
1
|
-
#rails 2.x doesn't have railties so gona do this the long way
|
2
|
-
require "sass/plugin/rack" #unless defined?(Sass::Plugin::Rack)
|
3
|
-
|
4
|
-
module ActionController
|
5
|
-
class Base
|
6
|
-
def process_with_compass(*args)
|
7
|
-
Sass::Plugin.rails_controller = self
|
8
|
-
begin
|
9
|
-
process_without_compass(*args)
|
10
|
-
ensure
|
11
|
-
Sass::Plugin.rails_controller = nil
|
12
|
-
end
|
13
|
-
end
|
14
|
-
alias_method_chain :process, :compass
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
module Sass::Plugin
|
20
|
-
class << self
|
21
|
-
attr_accessor :rails_controller
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
module Compass::SassExtensions::Functions::Urls::ImageUrl
|
26
|
-
def image_url_with_rails_integration(path, only_path = Sass::Script::Bool.new(false), cache_buster = Sass::Script::Bool.new(true))
|
27
|
-
if (@controller = Sass::Plugin.rails_controller) && @controller.respond_to?(:request) && @controller.request
|
28
|
-
begin
|
29
|
-
if only_path.to_bool
|
30
|
-
Sass::Script::String.new image_path(path.value)
|
31
|
-
else
|
32
|
-
Sass::Script::String.new "url(#{image_path(path.value)})"
|
33
|
-
end
|
34
|
-
ensure
|
35
|
-
@controller = nil
|
36
|
-
end
|
37
|
-
else
|
38
|
-
image_url_without_rails_integration(path, only_path, cache_buster)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
alias_method_chain :image_url, :rails_integration
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
class Sass::Script::Functions::EvaluationContext
|
46
|
-
include Sass::Script::Functions
|
47
|
-
private
|
48
|
-
include ActionView::Helpers::AssetTagHelper
|
49
|
-
end
|
50
|
-
|
51
|
-
unless Compass.detect_configuration_file.nil?
|
52
|
-
Compass.add_configuration(CompassRails.configuration)
|
53
|
-
CompassRails.initialize!
|
54
|
-
else
|
55
|
-
CompassRails.initialize!(CompassRails.configuration)
|
56
|
-
end
|