coffee_without_nodejs 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/bin/coff +39 -17
- data/lib/coffee_without_nodejs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4794cbed13504ffea87a2ddec8912937fd22871
|
4
|
+
data.tar.gz: 811ac493e1f2a4462fbc46c306b1e993b68cbb57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afb4b1202398cf7e36e17b0b8f39c254ffb7b6ee2cb3214e9a400120f4692c5d4ccae00288cd00790786f81e758cb5d451d523b559becb194b6eb05eefd1432a
|
7
|
+
data.tar.gz: cab1ab9ee74cd13831bcfb7e9d68ba7996a85daa067cfeeaba8dcd907482aa602e783d56148ffe24bcd05fd184dbafa2ec0d54a513a44c7e10a3ca59a841bded
|
data/README.md
CHANGED
@@ -64,12 +64,10 @@ save literal js outout to file2.js
|
|
64
64
|
|
65
65
|
Or ...
|
66
66
|
|
67
|
-
|
67
|
+
You can run coffee script directly with: `-e` argments or pipe.
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
x = 100;
|
69
|
+
![File](http://zw963.github.io/snapshot15.png)
|
70
|
+
![File](http://zw963.github.io/snapshot16.png)
|
73
71
|
|
74
72
|
This gem is extract from [Alternative Script Suite](https://github.com/zw963/ass).
|
75
73
|
You can found a lot of useful and interesting scripts here.
|
data/bin/coff
CHANGED
@@ -4,25 +4,47 @@
|
|
4
4
|
require 'coffee_without_nodejs'
|
5
5
|
require 'coderay'
|
6
6
|
|
7
|
-
if
|
7
|
+
if File.pipe?($stdin)
|
8
|
+
content = CoffeeWithoutNodejs.compile($stdin.read).to_s
|
9
|
+
unless content.empty?
|
10
|
+
token = CodeRay.scan(content, :js)
|
11
|
+
print $stdout.tty? ? token.terminal : token.text
|
12
|
+
end
|
13
|
+
exit
|
14
|
+
end
|
15
|
+
|
16
|
+
if ARGV.empty?
|
17
|
+
`notify-send 'Starting coffee compiler.' -t 1000` if system 'which notify-send &>/dev/null'
|
18
|
+
CoffeeWithoutNodejs.watch!
|
19
|
+
exit
|
20
|
+
end
|
21
|
+
|
22
|
+
if ['-h', '--help'].include? ARGV.first
|
23
|
+
STDERR.puts 'coff -e "coffee script", to compile coffee to javascript.'
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
|
27
|
+
if ['-e', '--eval'].include? ARGV.first
|
8
28
|
ARGV.shift
|
9
29
|
content = CoffeeWithoutNodejs.compile(ARGV.first).to_s
|
10
30
|
print CodeRay.scan(content, :js).terminal unless content.empty?
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
31
|
+
exit
|
32
|
+
end
|
33
|
+
|
34
|
+
if test 'd', ARGV.first
|
35
|
+
Dir.chdir(ARGV.first) { CoffeeWithoutNodejs.watch! }
|
36
|
+
exit
|
37
|
+
end
|
38
|
+
|
39
|
+
ARGV.each do |file|
|
40
|
+
unless File.exist? file
|
41
|
+
puts "cannot open \`#{file}' for reading: No such file or directory, Skipping"
|
42
|
+
next
|
43
|
+
end
|
44
|
+
|
45
|
+
content = CoffeeWithoutNodejs.compile(file).to_s
|
46
|
+
unless content.empty?
|
47
|
+
token = CodeRay.scan(content, :js)
|
48
|
+
print $stdout.tty? ? token.terminal : token.text
|
27
49
|
end
|
28
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coffee_without_nodejs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Billy.Zheng(zw963)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|