sass-rails-source-maps 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +6 -4
- data/lib/sass-rails-source-maps.rb +2 -6
- data/lib/sass-rails-source-maps/sass_template.rb +13 -7
- data/lib/sass-rails-source-maps/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65ef39e2cb5190e60f6397f4258df7cbf917d8db
|
4
|
+
data.tar.gz: d245c03d2b950a70daabab4e4d5f18f8917223e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1da1dcede53db9c37d641674f708b8b037f15e287997685e9d299a38ed044bb5bba40723e7da4102c9d958e9e1325b2c1231e92ab31d5187c4fc660ba00031f1
|
7
|
+
data.tar.gz: e17117ad29d80c9167bb725d4087796e39570ffc431a90353a3847f5cc406f15b9eddb61d82d3402153749dea19a13bdfc3bdaac6bdc18e7216d7ec22b5a18ee
|
data/README.markdown
CHANGED
@@ -29,15 +29,17 @@ to make Rails regenerate assets. After assets regeneration, `assets/source_maps`
|
|
29
29
|
|
30
30
|
## Usage
|
31
31
|
|
32
|
-
To see something like this ![screenshot](https://
|
32
|
+
To see something like this ![screenshot](https://dl.dropboxusercontent.com/u/21012539/screenshots/screenshot.png) you need to enable source maps in Google Chrome.
|
33
33
|
|
34
34
|
To enable source maps open Chrome inspector go to [chrome://flags/#enable-devtools-experiments](chrome://flags/#enable-devtools-experiments) and `Enable Developer Tools experiments`. Then restart Google Chrome.
|
35
35
|
|
36
|
-
After restart, go to inspector `
|
36
|
+
After restart, go to inspector `Experiments` settings and enable `Sass stylesheet debugging`.
|
37
37
|
|
38
|
-
![experimental settings](https://
|
38
|
+
![experimental settings](https://dl.dropboxusercontent.com/u/21012539/screenshots/screenshot_experiments.png)
|
39
39
|
|
40
|
-
|
40
|
+
And finally in `General` settings check `Enable source maps`.
|
41
|
+
|
42
|
+
![general settings](https://dl.dropboxusercontent.com/u/21012539/screenshots/screenshot_general.png)
|
41
43
|
|
42
44
|
Enabling source maps may vary in different Chrome versions. For more info please see [Working with CSS Preprocessors](https://developers.google.com/chrome-developer-tools/docs/css-preprocessors); part _Using Sass with CSS source maps_.
|
43
45
|
|
@@ -10,10 +10,6 @@ module SassRailsSourceMaps
|
|
10
10
|
|
11
11
|
end
|
12
12
|
|
13
|
-
Sprockets::ScssTemplate.
|
14
|
-
include SassRailsSourceMaps::SassTemplate
|
15
|
-
end
|
13
|
+
Sprockets::ScssTemplate.send(:include, SassRailsSourceMaps::SassTemplate)
|
16
14
|
|
17
|
-
Sprockets::SassTemplate.
|
18
|
-
include SassRailsSourceMaps::SassTemplate
|
19
|
-
end
|
15
|
+
Sprockets::SassTemplate.send(:include, SassRailsSourceMaps::SassTemplate)
|
@@ -12,7 +12,7 @@ module SassRailsSourceMaps
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def evaluate_with_source_maps(context, locals, &block)
|
16
16
|
cache_store = Sprockets::SassCacheStore.new(context.environment)
|
17
17
|
|
18
18
|
options = {
|
@@ -36,15 +36,21 @@ module SassRailsSourceMaps
|
|
36
36
|
|
37
37
|
write_output(data, ::Rails.root.join("public", SOURCE_MAPS_DIRECTORY, basename).to_s)
|
38
38
|
write_output(mapping.to_json(
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
css_path: basename.gsub(".#{syntax.to_s}", ""),
|
40
|
+
sourcemap_path: ::Rails.root.join("public", SOURCE_MAPS_DIRECTORY, options[:sourcemap_filename])) + "\n",
|
41
|
+
::Rails.root.join("public", SOURCE_MAPS_DIRECTORY, options[:sourcemap_filename]).to_s)
|
42
42
|
copy_dependencies(context._dependency_paths)
|
43
43
|
|
44
44
|
result
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
rescue ::Sass::SyntaxError => e
|
46
|
+
context.__LINE__ = e.sass_backtrace.first[:line]
|
47
|
+
raise e
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.included(base)
|
51
|
+
base.class_eval do
|
52
|
+
alias_method_chain :evaluate, :source_maps
|
53
|
+
end
|
48
54
|
end
|
49
55
|
end
|
50
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-rails-source-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vojtech Hyza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -122,3 +122,4 @@ signing_key:
|
|
122
122
|
specification_version: 4
|
123
123
|
summary: Rails gem for generating sass source maps
|
124
124
|
test_files: []
|
125
|
+
has_rdoc:
|