js-preflight 0.0.5 → 0.0.6
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 +4 -0
- data/bin/preflight +5 -2
- data/lib/js-preflight/lint.rb +5 -1
- data/lib/js-preflight/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -4,6 +4,10 @@ Run jslint and jsmin on all .js files sourced in html files provided as argument
|
|
4
4
|
for details:
|
5
5
|
preflight --help
|
6
6
|
|
7
|
+
Prerequisites
|
8
|
+
-------------
|
9
|
+
Spidermonkey - `brew install spidermonkey`
|
10
|
+
|
7
11
|
Bugs
|
8
12
|
----
|
9
13
|
Output isn't perfect yet; you'll need to move the packed .js file yourself for now
|
data/bin/preflight
CHANGED
@@ -193,8 +193,11 @@ if ARGV.length > 0
|
|
193
193
|
# css, stylesheets, images, img
|
194
194
|
if options[:build_path]
|
195
195
|
js_output.rewind
|
196
|
-
STDERR.puts "
|
197
|
-
File.
|
196
|
+
STDERR.puts "Saving assets.js"
|
197
|
+
js_path = File.join(options[:build_path], "js")
|
198
|
+
css_path = File.join(options[:build_path], "css")
|
199
|
+
FileUtils.mkdir_p(js_path)
|
200
|
+
File.open(File.join(js_path, "assets.js"), "w") do |assets|
|
198
201
|
assets.write js_output.read
|
199
202
|
end
|
200
203
|
asset_paths = %w{css stylesheets images img}
|
data/lib/js-preflight/lint.rb
CHANGED
@@ -25,7 +25,11 @@ module Js
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def lint
|
28
|
-
`js
|
28
|
+
unless `which js`.empty?
|
29
|
+
`js -f #{executable_path}/jslint < #{filename}`
|
30
|
+
else
|
31
|
+
"No js interpreter found; consider installing Spidermonkey"
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
data/lib/js-preflight/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 6
|
9
|
+
version: 0.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Scott Burton
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-05-03 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|