coffee-rails-source-maps 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -0
- data/lib/coffee-rails-source-maps.rb +6 -5
- data/lib/coffee-rails-source-maps/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -23,11 +23,6 @@ if Rails.env.development?
|
|
23
23
|
return Source.context.call("CoffeeScript.compile", script, options)
|
24
24
|
else
|
25
25
|
clean_name = pathname.basename.to_s.split(".").first
|
26
|
-
# adding source maps option. (source maps option requires filename option.)
|
27
|
-
options[:sourceMap] = true
|
28
|
-
options[:filename] = "#{clean_name}.coffee"
|
29
|
-
|
30
|
-
ret = Source.context.call("CoffeeScript.compile", script, options)
|
31
26
|
|
32
27
|
rel_path = if pathname.to_s.start_with?(Bundler.bundle_path.to_s)
|
33
28
|
Pathname('bundler').join(pathname.relative_path_from(Bundler.bundle_path)).dirname
|
@@ -41,6 +36,11 @@ if Rails.env.development?
|
|
41
36
|
map_file = map_dir.join("#{clean_name}.map")
|
42
37
|
coffee_file = map_dir.join("#{clean_name}.coffee")
|
43
38
|
|
39
|
+
options[:sourceMap] = true
|
40
|
+
options[:filename] = "#{clean_name}.coffee" # coffee requires filename option to work with source maps (see http://coffeescript.org/documentation/docs/coffee-script.html#section-4)
|
41
|
+
options[:sourceFiles] = ["/#{coffee_file.relative_path_from(Rails.root.join("public"))}"] # specify coffee source file explicitly (see http://coffeescript.org/documentation/docs/sourcemap.html#section-8)
|
42
|
+
ret = Source.context.call("CoffeeScript.compile", script, options)
|
43
|
+
|
44
44
|
coffee_file.open('w') {|f| f.puts script }
|
45
45
|
map_file.open('w') {|f| f.puts ret["v3SourceMap"]}
|
46
46
|
|
@@ -65,3 +65,4 @@ if Rails.env.development?
|
|
65
65
|
end
|
66
66
|
|
67
67
|
end
|
68
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coffee-rails-source-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coffee-script-source
|
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash:
|
77
|
+
hash: 3804960167039426062
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
segments:
|
85
85
|
- 0
|
86
|
-
hash:
|
86
|
+
hash: 3804960167039426062
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
89
|
rubygems_version: 1.8.25
|