winlnk 0.0.2 → 0.0.3
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/lib/winlnk.rb +5 -1
- data/test/test_error.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c52a14179cd99db83990b3049ae63b89ee6006d5
|
|
4
|
+
data.tar.gz: c6cce9bbedcfab5fa31fa378d362c64f5ec58da8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31ea40e3dac00f53847902b298e665c468216300f104906c2156a4346e152608d172ab11375b5d46d59556f0675d062b0f69a4c4ab7e2b9adf8d96b533bbd6a4
|
|
7
|
+
data.tar.gz: b27805ec219caf048a8d9a1abcfca585e1130e7e9af144fb435339c83087ef31662061bc35deacd557e3cf7fbf82701df201daeb466ebfa8f435d998739507f1
|
data/lib/winlnk.rb
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
class WinLnk
|
|
30
30
|
MAGIC = "\x4c\x00\x00\x00".b
|
|
31
31
|
CLSID = "\x01\x14\x02\x00\x00\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x00\x46".b
|
|
32
|
+
private_constant :MAGIC, :CLSID
|
|
32
33
|
|
|
33
34
|
FLAG_HAS_LINK_TARGET_ID_LIST = 1 << 0
|
|
34
35
|
FLAG_HAS_LINK_INFO = 1 << 1
|
|
@@ -99,7 +100,10 @@ class WinLnk
|
|
|
99
100
|
# to be +codepage+.
|
|
100
101
|
def initialize(pathname, codepage)
|
|
101
102
|
@codepage = codepage
|
|
102
|
-
|
|
103
|
+
# Do not use Kernel.#open or File.read, which is actually IO.read,
|
|
104
|
+
# because they can open pipes. File.read was fixed to not open pipes
|
|
105
|
+
# in Ruby 2.6.
|
|
106
|
+
@data = File.open(pathname, mode: "rb:ASCII-8BIT") { |f| f.read }
|
|
103
107
|
off = read_header()
|
|
104
108
|
printf("Link flags: %b\n", @flags) if @@debug
|
|
105
109
|
|
data/test/test_error.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: winlnk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- KAMADA Ken'ichi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
This is a library to parse Windows Shell Link (shortcut or .lnk) files
|