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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61de08829c462bf882db9eff690eb2c6beb92b82
4
- data.tar.gz: 6575e27221ed2c3a518d01979fc817a34db62e7c
3
+ metadata.gz: d050e85a1a36002dc0adf934e08514dd95c93783
4
+ data.tar.gz: 56915b0067753979302f7ed9cc0277b59e104c69
5
5
  SHA512:
6
- metadata.gz: 00275f2bf31c659e3f94ae43c575004d06d7d153484f29cfaf661cc64af3f81a440117363fa20fb560a042fbfdc5848d811f854aa893bab045d5a8c5b6d70656
7
- data.tar.gz: 0a5b166a5028434dd1ee0b1165d0f893c671f6bb2788753592ac944c26282822d25cfd5ae08a081d0c5a5c887e2277b4cd6c79398deae658a8e6639f4cc3c74d
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
- print CodeRay.scan(content, :js).terminal unless content.empty?
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
@@ -67,7 +67,7 @@ WRAPPER
67
67
  puts "==> #{js_path.relative_path_from(root_dir)}"
68
68
  js_path
69
69
  else
70
- puts "==> #{file_path}"
70
+ puts "==> #{file_path}" if $stdout.tty?
71
71
  target_js_content
72
72
  end
73
73
  rescue ExecJS::RuntimeError
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  module CoffeeWithoutNodejs
5
- VERSION = [0, 5, 0]
5
+ VERSION = [0, 6, 0]
6
6
 
7
7
  class << VERSION
8
8
  def to_s
@@ -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
- CoffeeWithoutNodejs.compile(file)
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
- CoffeeWithoutNodejs.compile(file)
39
+ CoffeeCompiler.compile_file(file, true, true)
38
40
  end
39
41
  end
40
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee_without_nodejs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billy.Zheng(zw963)