sanzang 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,8 +70,8 @@ module Sanzang::Platform
70
70
  if os_name =~ /mingw|mswin/
71
71
  require 'win32ole'
72
72
  result = WIN32OLE.connect("winmgmts://").ExecQuery(
73
- "select NumberOfLogicalProcessors from Win32_Processor")
74
- result.to_enum.first.NumberOfLogicalProcessors
73
+ "select NumberOfLogicalProcessors from Win32_Processor")
74
+ result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)
75
75
  elsif File.readable?("/proc/cpuinfo")
76
76
  IO.read("/proc/cpuinfo").scan(/^processor/).size
77
77
  elsif File.executable?("/usr/bin/hwprefs")
@@ -116,8 +116,12 @@ module Sanzang
116
116
  io_out.write(
117
117
  gen_listing(buffer, io_in.lineno - buffer.rstrip.count("\n")))
118
118
  ensure
119
- io_in.close if input.kind_of?(String) and not io_in.closed?
120
- io_out.close if output.kind_of?(String) and not io_out.closed?
119
+ if input.kind_of?(String) and defined?(io_in) and io_in
120
+ io_in.close if not io_in.closed?
121
+ end
122
+ if output.kind_of?(String) and defined?(io_out) and io_out
123
+ io_out.close if not io_out.closed?
124
+ end
121
125
  end
122
126
 
123
127
  # The TranslationTable used by the Translator
@@ -19,6 +19,6 @@ module Sanzang
19
19
 
20
20
  # Current version number of Sanzang
21
21
  #
22
- VERSION = "1.0.6"
22
+ VERSION = "1.0.7"
23
23
 
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanzang
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-08 00:00:00.000000000 Z
12
+ date: 2013-11-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel