clutil 2015.262.0 → 2017.063.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/cl/util/win.rb +1 -50
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5140c95a23b473643ac0f3ec9af29c0c001a8692
|
4
|
+
data.tar.gz: ab935374fef1627033cec2119117e6f84ab3ae53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88b57119aff6044b17b3e2fd91452d930146c0d785962bef91b960c1082f95e00f191fa18aaa1233f57617ed9565d5cfb7b761b92e23940a6d55896590b2cc3d
|
7
|
+
data.tar.gz: ea00c0c1acfff1666fbd3bf6abbf3934bd49436a69c009732812678a5c056993b84f8de535147dec818824b462157b174458e80cd7aabbc9a1ce66bc1df3d17d
|
data/cl/util/win.rb
CHANGED
@@ -2,26 +2,7 @@ require 'Win32API'
|
|
2
2
|
require 'win32ole'
|
3
3
|
require File.dirname(__FILE__) + '/file'
|
4
4
|
|
5
|
-
#
|
6
|
-
# http://ruby-talk.com/41583
|
7
|
-
# But I see two potential problems that make not consistent with the
|
8
|
-
# original ruby command:
|
9
|
-
# 1) it takes only one argument
|
10
|
-
|
11
|
-
# code by Hee-Sob Park - posted here:
|
12
|
-
# http://ruby-talk.com/10006
|
13
|
-
def system(command)
|
14
|
-
# 2) it always set "$?" variable to false - should be working now...
|
15
|
-
|
16
|
-
# not allowed to set $?
|
17
|
-
# $? = Win32API.new("crtdll", "system", ['P'], 'L').Call(command)
|
18
|
-
# $? == 0
|
19
|
-
|
20
|
-
# http://msdn.microsoft.com/library/en-us/vccore98/html/_crt_system.2c_._wsystem.asp
|
21
|
-
Win32API.new("crtdll", "system", ['P'], 'L').Call(command)
|
22
|
-
end
|
23
|
-
|
24
|
-
# the system cmd in MSVC built ruby does not set $?, so no access to
|
5
|
+
# the system cmd in MSVC built ruby does not set $?, so no access to
|
25
6
|
# the exit code can be had. The following works, but is obtuse enough
|
26
7
|
# for me to encapsulate in this method.
|
27
8
|
# Bit slightly modified from - nobu http://ruby-talk.com/76086
|
@@ -34,36 +15,6 @@ def system_return_exitcode(cmd)
|
|
34
15
|
return exitcode
|
35
16
|
end
|
36
17
|
|
37
|
-
# MENON Jean-Francois [Jean-Francois.MENON@meteo.fr]
|
38
|
-
# http://ruby-talk.com/41583
|
39
|
-
# But I see two potential problems that make not consistent with the
|
40
|
-
# original ruby command:
|
41
|
-
# 1) it always set "$?" variable to false
|
42
|
-
|
43
|
-
# code by Hee-Sob Park - posted here:
|
44
|
-
# http://ruby-talk.com/10006
|
45
|
-
def `(command)
|
46
|
-
# http://msdn.microsoft.com/library/en-us/vccore98/HTML/_crt__popen.2c_._wpopen.asp
|
47
|
-
popen = Win32API.new("crtdll", "_popen", ['P','P'], 'L')
|
48
|
-
pclose = Win32API.new("crtdll", "_pclose", ['L'], 'L')
|
49
|
-
fread = Win32API.new("crtdll", "fread", ['P','L','L','L'], 'L')
|
50
|
-
feof = Win32API.new("crtdll", "feof", ['L'], 'L')
|
51
|
-
saved_stdout = $stdout.clone
|
52
|
-
psBuffer = " " * 128
|
53
|
-
rBuffer = ""
|
54
|
-
f = popen.Call(command,"r")
|
55
|
-
while feof.Call( f )==0
|
56
|
-
l = fread.Call( psBuffer,1,128,f )
|
57
|
-
# fix emailed direct to me from Park from 10006 code
|
58
|
-
# was:
|
59
|
-
# rBuffer += psBuffer[0..l]
|
60
|
-
rBuffer += psBuffer[0...l]
|
61
|
-
end
|
62
|
-
pclose.Call f
|
63
|
-
$stdout.reopen(saved_stdout)
|
64
|
-
rBuffer
|
65
|
-
end
|
66
|
-
|
67
18
|
P_WAIT = 0
|
68
19
|
P_NOWAIT = 1
|
69
20
|
OLD_P_OVERLAY = 2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2017.063.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chrismo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.6.8
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: cLabs Ruby Utilities
|