LP-Exporter 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -2
- data/.yardopts +1 -1
- data/bin/lp_exporter +0 -0
- data/lib/lp/exporter.rb +7 -6
- data/lib/lp/exporter/app.rb +2 -1
- data/lib/lp/exporter/version.rb +1 -1
- data/spec/lp-exporter_spec.rb +5 -5
- data/spec/spec_helper.rb +5 -5
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a10f0d6f0decb321e1a1fce25af3da55fb379905
|
4
|
+
data.tar.gz: 0fd943c0323ddb81e32083f5c17ca2cdda6d91da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a246cd1877b62412a8986d8aa0a31d47f784f8fe26b062f495ae47868e259ea51a8ec4ad2059ec8b047bcf89e76ab3930bbd546a93151ac74d986923b801dfa
|
7
|
+
data.tar.gz: 513736c5f137522e6cc3322147adbd13d1c00dfa1c7c25a876d8582b84bd0d0ae804b17e81a14d524b7a1aa8b375682748fa441ede9ee9d17de735c18b82fafc
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--color
|
2
|
-
--format progress
|
1
|
+
--color
|
2
|
+
--format progress
|
data/.yardopts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--markup markdown
|
1
|
+
--markup markdown
|
data/bin/lp_exporter
CHANGED
File without changes
|
data/lib/lp/exporter.rb
CHANGED
@@ -36,23 +36,24 @@ module LP
|
|
36
36
|
file = cab.files
|
37
37
|
fileList = {}
|
38
38
|
begin
|
39
|
-
|
39
|
+
pathname = file.getFilename.gsub('\\', '/')
|
40
|
+
path = Pathname.new(pathname)
|
40
41
|
next unless path.extname == '.mui'
|
41
|
-
realname = path.basename('.*')
|
42
|
+
realname = path.basename('.*')
|
42
43
|
found = (files.count == 0)
|
43
44
|
files.each do |str|
|
44
|
-
if realname.
|
45
|
+
if realname.fnmatch?(str + '*', File::FNM_DOTMATCH | File::FNM_PATHNAME | File::FNM_CASEFOLD)
|
45
46
|
found = true
|
46
47
|
break
|
47
48
|
end
|
48
49
|
end
|
49
50
|
next unless found
|
50
|
-
nameparts = realname.split('.')
|
51
|
+
nameparts = realname.to_s.split('.')
|
51
52
|
base = nameparts.first
|
52
53
|
namelen = nameparts.length
|
53
54
|
namelen -= 1 if nameparts[-1] == 'dll'
|
54
55
|
name = nameparts[0, namelen].join('.')
|
55
|
-
data = path.dirname.to_s.split('_')
|
56
|
+
data = path.dirname.basename.to_s.split('_')
|
56
57
|
arch = data[0]
|
57
58
|
lang = data[-2]
|
58
59
|
newName = [lang, arch, realname].join('_')
|
@@ -73,7 +74,7 @@ module LP
|
|
73
74
|
# @param [Array] entry info about file
|
74
75
|
# @param [Boolean] lang if should use language name rather than LangID
|
75
76
|
def self.export(path, entry, lang = false)
|
76
|
-
filepath = File.join(path, entry.first)+'.
|
77
|
+
filepath = File.join(path, entry.first)+'.yaml'
|
77
78
|
data = {}
|
78
79
|
data = YAML.load_file(filepath) if File.exists?(filepath)
|
79
80
|
langName = entry[1]
|
data/lib/lp/exporter/app.rb
CHANGED
data/lib/lp/exporter/version.rb
CHANGED
data/spec/lp-exporter_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe LP::Exporter do
|
4
|
-
|
5
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe LP::Exporter do
|
4
|
+
|
5
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'simplecov'
|
2
|
-
|
3
|
-
SimpleCov.start
|
4
|
-
|
5
|
-
require_relative '../lib/lp/exporter.rb'
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
SimpleCov.start
|
4
|
+
|
5
|
+
require_relative '../lib/lp/exporter.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LP-Exporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dāvis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libmspack
|
@@ -151,11 +151,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.6.12
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Export langauge data from Microsoft language pack lp.cab files
|
158
158
|
test_files:
|
159
159
|
- spec/lp-exporter_spec.rb
|
160
160
|
- spec/spec_helper.rb
|
161
|
-
has_rdoc:
|