coffee_without_nodejs 0.5.0 → 0.6.0
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.
- checksums.yaml +4 -4
- data/bin/coff +4 -1
- data/lib/coffee_without_nodejs/compiler.rb +1 -1
- data/lib/coffee_without_nodejs/version.rb +1 -1
- data/lib/coffee_without_nodejs/watcher.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d050e85a1a36002dc0adf934e08514dd95c93783
|
|
4
|
+
data.tar.gz: 56915b0067753979302f7ed9cc0277b59e104c69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15c5a2a680cb877c350e5c200bdbdd97c4c03742616a9eba177ab27551d1bc840d01d3802f31a2ace8633b267149f6dc96734b605d9b888e8a346e7c961636eb
|
|
7
|
+
data.tar.gz: ae251a6ae8d87b5a3bfb22a608ed062665ab8eda19edaaaf184b16637c6bd42cf9796e2ced974c296bfca280cca08d1d36732ccd7ab55d2c46c42f7e73aa6205
|
data/bin/coff
CHANGED
|
@@ -19,7 +19,10 @@ else
|
|
|
19
19
|
fail "`#{file}' is not valid filename." unless File.exist? file
|
|
20
20
|
|
|
21
21
|
content = CoffeeWithoutNodejs.compile(file).to_s
|
|
22
|
-
|
|
22
|
+
unless content.empty?
|
|
23
|
+
token = CodeRay.scan(content, :js)
|
|
24
|
+
print $stdout.tty? ? token.terminal : token.text
|
|
25
|
+
end
|
|
23
26
|
end
|
|
24
27
|
end
|
|
25
28
|
end
|
|
@@ -12,6 +12,8 @@ module CoffeeWithoutNodejs
|
|
|
12
12
|
@notifier = INotify::Notifier.new
|
|
13
13
|
@path = File.expand_path('.')
|
|
14
14
|
|
|
15
|
+
Signal.trap(2) {|sig| Process.exit }
|
|
16
|
+
|
|
15
17
|
start_watch_files
|
|
16
18
|
|
|
17
19
|
@notifier.watch(@path, :moved_from, :moved_to, :create, :delete, :onlydir, :recursive) do |event|
|
|
@@ -22,7 +24,7 @@ module CoffeeWithoutNodejs
|
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
coffee_files.each do |file|
|
|
25
|
-
|
|
27
|
+
CoffeeCompiler.compile_file(file, true, true)
|
|
26
28
|
end
|
|
27
29
|
|
|
28
30
|
# start loop.
|
|
@@ -34,7 +36,7 @@ module CoffeeWithoutNodejs
|
|
|
34
36
|
def start_watch_files
|
|
35
37
|
coffee_files.each do |file|
|
|
36
38
|
@notifier.watch(file, :modify) do
|
|
37
|
-
|
|
39
|
+
CoffeeCompiler.compile_file(file, true, true)
|
|
38
40
|
end
|
|
39
41
|
end
|
|
40
42
|
end
|