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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a36a18d19410ade37fa2a577d3f4644fd25e85eb
4
- data.tar.gz: 851b3fb0ea8808387173091550d6e971a9f44b10
3
+ metadata.gz: a10f0d6f0decb321e1a1fce25af3da55fb379905
4
+ data.tar.gz: 0fd943c0323ddb81e32083f5c17ca2cdda6d91da
5
5
  SHA512:
6
- metadata.gz: 9eb4002b0068c884722ad404a7aff4906047d0e0727968ecdb6f20b09c295770a9d2377b6c3974d2b73500cce10ab24ffe1404f40bcc3ce3e781106850d77c91
7
- data.tar.gz: 9d034945743565d6d4a4541b30347b29f09f5c397e3f03beeedb3318abee61e4b403180dd6d1589725382dd0b715e97c9aa59cbf5266b3235079c27366828de8
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
File without changes
@@ -36,23 +36,24 @@ module LP
36
36
  file = cab.files
37
37
  fileList = {}
38
38
  begin
39
- path = Pathname.new(file.getFilename)
39
+ pathname = file.getFilename.gsub('\\', '/')
40
+ path = Pathname.new(pathname)
40
41
  next unless path.extname == '.mui'
41
- realname = path.basename('.*').to_s
42
+ realname = path.basename('.*')
42
43
  found = (files.count == 0)
43
44
  files.each do |str|
44
- if realname.match(str)
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)+'.yml'
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]
@@ -48,7 +48,8 @@ module LP
48
48
  # Start Application
49
49
  def self.start
50
50
  options = getOptions
51
- if not options or options[:LP].nil?
51
+ return false if not options
52
+ if options[:LP].nil?
52
53
  puts options[:Parser].help
53
54
  return false
54
55
  end
@@ -1,6 +1,6 @@
1
1
  module LP
2
2
  module Exporter
3
3
  # Version
4
- VERSION = '0.0.2'
4
+ VERSION = '0.1.0'
5
5
  end
6
6
  end
@@ -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
@@ -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.2
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: 2014-01-22 00:00:00.000000000 Z
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.2.1
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: