jsc 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -5
- data/Rakefile +2 -2
- data/bin/jsc +39 -37
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
-
jsc,
|
1
|
+
jsc, JavaScript Compiler
|
2
2
|
by sub
|
3
3
|
http://github.com/sub/jsc
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
|
-
|
7
|
+
Simple Ruby API to Google Closure Compiler Web service.
|
8
8
|
|
9
9
|
== FEATURES:
|
10
10
|
|
11
|
-
|
11
|
+
With <b>jsc</b> you can compile your JavaScript code throught {Google Closure Compiler REST service}[http://code.google.com/closure/compiler/].
|
12
|
+
|
13
|
+
The package comes with a jsc commands which accepts several options, run:
|
12
14
|
|
13
15
|
jsc --help
|
14
16
|
|
@@ -65,7 +67,7 @@ Now, select the code to compile and run:
|
|
65
67
|
|
66
68
|
== REQUIREMENTS:
|
67
69
|
|
68
|
-
jsc require the {bones}[http://gemcutter.org/gems/bones] gem
|
70
|
+
jsc require the {bones}[http://gemcutter.org/gems/bones] gem.
|
69
71
|
|
70
72
|
== INSTALL:
|
71
73
|
|
@@ -75,4 +77,4 @@ If you have gemcutter in your gem sources, run:
|
|
75
77
|
|
76
78
|
== LICENSE:
|
77
79
|
|
78
|
-
GNU General Public License (GPLv3)
|
80
|
+
GNU General Public License (GPLv3)
|
data/Rakefile
CHANGED
data/bin/jsc
CHANGED
@@ -1,52 +1,53 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# == Synopsis
|
4
|
-
#
|
5
|
-
# jsc, JavaScript Compiler.
|
6
|
-
#
|
7
|
-
# This command compiles your JavaScript code throught Google
|
8
|
-
# Closure Compiler Service.
|
9
|
-
# Look at http://github.com/sub/google_closure_compiler for more info
|
10
|
-
#
|
11
|
-
# == Usage
|
12
|
-
#
|
13
|
-
# jsc [OPTION] ... CODE
|
14
|
-
#
|
15
|
-
# -h, --help:
|
16
|
-
# show help
|
17
|
-
#
|
18
|
-
# --file x, -f x:
|
19
|
-
# compile file x
|
20
|
-
#
|
21
|
-
# --level value, -l value:
|
22
|
-
# compile with level value
|
23
|
-
# If this option is not supplied, SIMPLE_OPTIMIZATIONS will be used
|
24
|
-
# Look at Google API for accepted values
|
25
|
-
#
|
26
|
-
# --errors, -e:
|
27
|
-
# check for errors
|
28
|
-
#
|
29
|
-
# --warns, -w:
|
30
|
-
# check for warnings
|
31
|
-
#
|
32
|
-
# --stats, -s:
|
33
|
-
# get statistics for compiled code
|
34
|
-
#
|
35
|
-
# CODE: The code that will be compiled.
|
36
|
-
|
37
3
|
require 'getoptlong'
|
38
4
|
require 'rdoc/usage'
|
39
5
|
|
40
6
|
require File.expand_path(
|
41
7
|
File.join(File.dirname(__FILE__), %w[.. lib jsc]))
|
42
8
|
|
9
|
+
USAGE_PREAMBLE = <<-EOU
|
10
|
+
|
11
|
+
jsc, JavaScript Compiler.
|
12
|
+
|
13
|
+
This command compiles your JavaScript code throught Google Closure Compiler Service.
|
14
|
+
Look at http://gemcutter.org/gems/jsc for more info.
|
15
|
+
|
16
|
+
== Usage
|
17
|
+
|
18
|
+
jsc [options] ... CODE
|
19
|
+
|
20
|
+
--file x, -f x:
|
21
|
+
compile file x
|
22
|
+
|
23
|
+
--errors, -e:
|
24
|
+
check for errors
|
25
|
+
|
26
|
+
--warns, -w:
|
27
|
+
check for warnings
|
28
|
+
|
29
|
+
--stats, -s:
|
30
|
+
get statistics for compiled code
|
31
|
+
|
32
|
+
--level value, -l value:
|
33
|
+
compile with level value
|
34
|
+
If this option is not supplied, SIMPLE_OPTIMIZATIONS will be used
|
35
|
+
(look at Google API for accepted values).
|
36
|
+
|
37
|
+
--help, -h:
|
38
|
+
this help
|
39
|
+
|
40
|
+
CODE: The code that will be compiled.
|
41
|
+
|
42
|
+
EOU
|
43
|
+
|
43
44
|
opts = GetoptLong.new(
|
44
45
|
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
|
45
46
|
[ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT ],
|
46
|
-
[ '--level','-l', GetoptLong::REQUIRED_ARGUMENT ],
|
47
47
|
[ '--errors', '-e', GetoptLong::NO_ARGUMENT ],
|
48
48
|
[ '--warns', '-w', GetoptLong::NO_ARGUMENT ],
|
49
|
-
[ '--stats', '-s', GetoptLong::NO_ARGUMENT ]
|
49
|
+
[ '--stats', '-s', GetoptLong::NO_ARGUMENT ],
|
50
|
+
[ '--level','-l', GetoptLong::REQUIRED_ARGUMENT ]
|
50
51
|
)
|
51
52
|
|
52
53
|
file = false
|
@@ -55,7 +56,8 @@ output_info, level, file_path = String.new
|
|
55
56
|
opts.each do |opt, arg|
|
56
57
|
case opt
|
57
58
|
when '--help'
|
58
|
-
|
59
|
+
puts USAGE_PREAMBLE
|
60
|
+
exit 0
|
59
61
|
when '--file'
|
60
62
|
file = true
|
61
63
|
file_path = arg
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sub
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 3.1.0
|
24
24
|
version:
|
25
|
-
description:
|
25
|
+
description: Simple Ruby API to Google Closure Compiler Web service.
|
26
26
|
email: fitzkarraldo@gmail.com
|
27
27
|
executables:
|
28
28
|
- jsc
|
@@ -79,6 +79,6 @@ rubyforge_project: jsc
|
|
79
79
|
rubygems_version: 1.3.5
|
80
80
|
signing_key:
|
81
81
|
specification_version: 3
|
82
|
-
summary: Google Closure Compiler
|
82
|
+
summary: Simple Ruby API to Google Closure Compiler Web service
|
83
83
|
test_files:
|
84
84
|
- test/test_jsc.rb
|