vim_printer 0.1.6 → 0.1.7

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: a89755ab69369539a72004c7e5c938d65761267b
4
- data.tar.gz: 97534e524e5964ca043747732a76e49ef02d458a
3
+ metadata.gz: 5566edff0f15c84bb060c3a67ebb43c9a1f82493
4
+ data.tar.gz: 25d4de42648eeeb45ee1a3172053b661857d973c
5
5
  SHA512:
6
- metadata.gz: 60859f71c65d803652f0660815630dd4bd6670b804c2a98b8998914b58915a60e2f384f14fed6039f03a61224074aafba37a7d69e498b36d5a61a8d2ba43702d
7
- data.tar.gz: 83b60ab57d0b53fbff45f0a7ad4ad0031997879d6abf351c01e5e7a9200027d505a6b6573329738d00a3f0fce865b559b55c3c258c3ab56c279035c97ebecd02
6
+ metadata.gz: 528cfb4898ae23c698d738d004ba260ef7e77cbb3109387d7b737ac243ef681865310e2f2a725dfbdffbd71f1a7a5d289dd71979bb91f368896206046b02ecc8
7
+ data.tar.gz: cc553f646c27ab209ec96f41c7993c3aa83308d7f697b05f188a552524e101f6737306b599cb8ebcac94d3dabae737107cf4daf36346d2838520ab0ba18c3d95
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ### Changelog
2
2
 
3
+ #### 0.1.7
4
+
5
+ - Handle the edge case for File.binary?
6
+
3
7
  #### 0.1.6
4
8
 
5
9
  - Update rubocop to 0.23.x
@@ -1,13 +1,17 @@
1
- # From: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/44936
1
+ # from: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/44936
2
2
  class File
3
+ # Note: monkey patch to check if a given file is a binary
3
4
  def self.binary?(name)
4
5
  name = File.expand_path(name)
5
6
  my_stat = stat(name)
6
7
  return false unless my_stat.file?
7
8
  open(name) do |file|
8
9
  blk = file.read(my_stat.blksize)
9
- return blk.size == 0 ||
10
- blk.count("^ -~", "^\r\n") / blk.size > 0.3 || blk.count("\x00") > 0
10
+ if blk
11
+ return blk.size == 0 || blk.count("^ -~", "^\r\n") / blk.size > 0.3 || blk.count("\x00") > 0
12
+ else
13
+ false
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -1,3 +1,3 @@
1
1
  module VimPrinter
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim_printer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burin Choomnuan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -251,7 +251,6 @@ files:
251
251
  - test/fixtures/inputs/java/demo4.yyy.java
252
252
  - test/fixtures/inputs/noexts1_zzz
253
253
  - test/fixtures/inputs/noexts2_zzz
254
- - test/fixtures/inputs/vim_printer_output.tar.gz
255
254
  - test/fixtures/outputs/demo1.xxx.rb.xhtml
256
255
  - test/fixtures/outputs/demo1.yyy.rb.xhtml
257
256
  - test/fixtures/outputs/demo2.xxx.rb.xhtml
@@ -289,25 +288,24 @@ specification_version: 4
289
288
  summary: Batch convert multiple files to htmls using the power of Vim. Work will any
290
289
  languages that can be open with Vim e.g. any non-binary files.
291
290
  test_files:
292
- - test/fixtures/inputs/demo1.xxx.rb
293
- - test/fixtures/inputs/demo1.yyy.rb
294
- - test/fixtures/inputs/demo2.xxx.rb
295
- - test/fixtures/inputs/demo2.yyy.rb
296
- - test/fixtures/inputs/java/demo3.xxx.java
297
- - test/fixtures/inputs/java/demo3.yyy.java
298
- - test/fixtures/inputs/java/demo4.xxx.java
299
- - test/fixtures/inputs/java/demo4.yyy.java
300
- - test/fixtures/inputs/noexts1_zzz
301
- - test/fixtures/inputs/noexts2_zzz
302
- - test/fixtures/inputs/vim_printer_output.tar.gz
291
+ - test/lib/vim_printer/test_cli.rb
292
+ - test/test_helper.rb
303
293
  - test/fixtures/outputs/demo1.xxx.rb.xhtml
304
- - test/fixtures/outputs/demo1.yyy.rb.xhtml
305
- - test/fixtures/outputs/demo2.xxx.rb.xhtml
306
- - test/fixtures/outputs/demo2.yyy.rb.xhtml
307
294
  - test/fixtures/outputs/java/demo3.xxx.java.xhtml
295
+ - test/fixtures/outputs/java/demo4.yyy.java.xhtml
308
296
  - test/fixtures/outputs/java/demo3.yyy.java.xhtml
309
297
  - test/fixtures/outputs/java/demo4.xxx.java.xhtml
310
- - test/fixtures/outputs/java/demo4.yyy.java.xhtml
311
- - test/lib/vim_printer/test_cli.rb
312
- - test/test_helper.rb
298
+ - test/fixtures/outputs/demo2.xxx.rb.xhtml
299
+ - test/fixtures/outputs/demo1.yyy.rb.xhtml
300
+ - test/fixtures/outputs/demo2.yyy.rb.xhtml
301
+ - test/fixtures/inputs/noexts2_zzz
302
+ - test/fixtures/inputs/java/demo3.xxx.java
303
+ - test/fixtures/inputs/java/demo4.xxx.java
304
+ - test/fixtures/inputs/java/demo3.yyy.java
305
+ - test/fixtures/inputs/java/demo4.yyy.java
306
+ - test/fixtures/inputs/demo2.yyy.rb
307
+ - test/fixtures/inputs/demo1.yyy.rb
308
+ - test/fixtures/inputs/demo2.xxx.rb
309
+ - test/fixtures/inputs/noexts1_zzz
310
+ - test/fixtures/inputs/demo1.xxx.rb
313
311
  has_rdoc: