act 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2faf8a1d513d94638d664661519f8b40df95c6ca
4
- data.tar.gz: 7e4c4df4a3971d1b64c138793df53526adfcbb4e
3
+ metadata.gz: 626ce8cd7e573620e8fe2b43549afb1cc4f65b58
4
+ data.tar.gz: 78164113d48edf33d4437457e78c3bcb76ebe577
5
5
  SHA512:
6
- metadata.gz: 5d9ab8baa30dd2bc07755fab8a4a456c866a2b32b1cf4ed9a8f233500475348c44af6c9919cf40f30d381d4b644969b16982ad472296a68b1a1e401191ef7271
7
- data.tar.gz: 2cb5dbe4bd494e7a037e294e90e7e79ae7435d830d71bfa4b90ad6b6f320f93e5fe72b7d1ee2ae650f21b6b5706275e6ebe4bf29a4a262bb84d3f082480f48eb
6
+ metadata.gz: 767f83cbaab9409a310b798ba02eb8c3b0d11ca9bea3edcf702a4a9d75486b7c5def2f37a22358304d8efd9880c2e442c6f33b58380376ec92d520cc9eddee7d
7
+ data.tar.gz: 72c0c6840315a642727fd6b220a15c575b7bed615bc336158a81bc59df5a9c9daa3bc377516a1cbe3395fbe50ead9aec6675e26f24826bcd45a5b2ea792054cc
data/lib/act/command.rb CHANGED
@@ -22,7 +22,7 @@ module Act
22
22
  def self.options
23
23
  [
24
24
  ['--open', 'Open the file in $EDITOR instead of printing it'],
25
- ['--prettify', "Don't prettify output"],
25
+ ['--prettify', 'Prettify output'],
26
26
  ['--line-numbers', 'Show output without line numbers'],
27
27
  ['--lexer=NAME', 'Use the given lexer'],
28
28
  ].concat(super)
data/lib/act/helper.rb CHANGED
@@ -97,10 +97,14 @@ module Act
97
97
  raise ArgumentError unless lexer
98
98
  return string if `which pygmentize`.strip.empty?
99
99
  result = nil
100
- Open3.popen3("pygmentize -l #{lexer}") do |stdin, stdout, stderr|
100
+ Open3.popen3("pygmentize -l #{lexer} -O encoding=utf8") do |stdin, stdout, stderr, wait_thr|
101
101
  stdin.write(string)
102
102
  stdin.close_write
103
103
  result = stdout.read
104
+ unless wait_thr.value.success?
105
+ warn '[!] Syntax highlighting via the pygmentize tool failed'
106
+ result = string
107
+ end
104
108
  end
105
109
  result
106
110
  end
data/lib/act/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Act
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: act
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Pelosin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-19 00:00:00.000000000 Z
11
+ date: 2014-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide