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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f706dfb8e9a356d401dd3d627b4721b8a8c19e83
4
- data.tar.gz: b6792c5c269756253d40cfab42bada190b95a7a0
3
+ metadata.gz: 65ef39e2cb5190e60f6397f4258df7cbf917d8db
4
+ data.tar.gz: d245c03d2b950a70daabab4e4d5f18f8917223e2
5
5
  SHA512:
6
- metadata.gz: a7b84358e016bd36ec55cc45cb36c08c4fe960428c49a1d848ab887265d8c7c9fde3c7397e0e87d18906317eda7b105756a1b04e084973ef533d86b5961c52c5
7
- data.tar.gz: 3d238763943cd487a425ef0667f0591e8447956af89839a0dfdc3351b6334ef2b457c54073e37a404410e3dd92763f9611e2d529580125e966aa8d7f95a15735
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://www.evernote.com/shard/s36/sh/d0c3c46e-d9e7-47d0-b23b-118ca1c77add/d2268cefa01e273ecfda4aba600c8640/res/c14f6a6d-c418-4bdd-80c2-5025dc035221/skitch.png?resizeSmall&width=832) you need to enable source maps in Google Chrome.
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 `experimental` settings and enable `Sass stylesheet debugging` and finally in general settings check `Enable source maps`.
36
+ After restart, go to inspector `Experiments` settings and enable `Sass stylesheet debugging`.
37
37
 
38
- ![experimental settings](https://www.evernote.com/shard/s36/sh/323d6df5-e5a5-467d-89bb-2e933800292a/aba9bcbf79b533e3ab625e9dc8961f61/res/f90634d7-2267-4a53-8a84-0e4baafd56d4/skitch.png?resizeSmall&width=832)
38
+ ![experimental settings](https://dl.dropboxusercontent.com/u/21012539/screenshots/screenshot_experiments.png)
39
39
 
40
- ![general settings](https://www.evernote.com/shard/s36/sh/7fc204d3-b0b2-47a7-9df9-d2d03f08fb2c/46dab5f794b32ede79b9c482b21ca9fa/res/bc1ba16c-e08f-41b4-9417-23c1384b89d9/skitch.png?resizeSmall&width=832)
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.class_eval do
14
- include SassRailsSourceMaps::SassTemplate
15
- end
13
+ Sprockets::ScssTemplate.send(:include, SassRailsSourceMaps::SassTemplate)
16
14
 
17
- Sprockets::SassTemplate.class_eval do
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 evaluate(context, locals, &block)
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
- 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)
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
- rescue ::Sass::SyntaxError => e
46
- context.__LINE__ = e.sass_backtrace.first[:line]
47
- raise e
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
@@ -1,3 +1,3 @@
1
1
  module SassRailsSourceMaps
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  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.1
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-09-17 00:00:00.000000000 Z
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: