gcc-to-clang-analyzer 0.0.7 → 0.0.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f39f8ee53e037f850b152e1e248b270d10e40c
|
4
|
+
data.tar.gz: 3a4dd8986ec3994261e2afe434b838bc9e772f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f647028ce5da4e45e7aa49669fb5be0a29d5760aafb56df773479d9a4e18d930c398967a757ce4d2a0fc3e93d461b7485376be3cdb047e1a8cfeb5a7078bd9c2
|
7
|
+
data.tar.gz: c91ba13b3661efd82a68d5188606d9c0cd56a46d8a83ce3f984cc127f9c21f59951a623e6bf12fb2fe66aa5189e0ac2b0087f423a98ad739dc86703a2f612226
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#require 'plist'
|
2
2
|
#require 'ox'
|
3
|
-
require 'rexml/document'
|
3
|
+
#require 'rexml/document'
|
4
|
+
require 'nokogiri'
|
4
5
|
|
5
6
|
class RewritePlistFile
|
6
7
|
# def self.with_prefix(prefix, original)
|
@@ -9,19 +10,27 @@ class RewritePlistFile
|
|
9
10
|
# v['files'] = files.map{|i|File.join(prefix, i)}
|
10
11
|
# v.to_plist()
|
11
12
|
# end
|
13
|
+
# def self.with_prefix(prefix, original)
|
14
|
+
# doc = REXML::Document.new(original)
|
15
|
+
# array_element = REXML::XPath.first(doc, "//key[text()='files']/following-sibling::array")
|
16
|
+
# if array_element
|
17
|
+
# array_element.elements.each do |s|
|
18
|
+
# s.text = File.join(prefix, s.text)
|
19
|
+
# end
|
20
|
+
# res = StringIO.new
|
21
|
+
# formatter = REXML::Formatters::Pretty.new(2)
|
22
|
+
# formatter.compact = true
|
23
|
+
# formatter.write(doc, res)
|
24
|
+
# return res.string
|
25
|
+
# end
|
26
|
+
# return original
|
27
|
+
# end
|
12
28
|
def self.with_prefix(prefix, original)
|
13
|
-
doc =
|
14
|
-
array_element =
|
15
|
-
|
16
|
-
|
17
|
-
s.text = File.join(prefix, s.text)
|
18
|
-
end
|
19
|
-
res = StringIO.new
|
20
|
-
formatter = REXML::Formatters::Pretty.new(2)
|
21
|
-
formatter.compact = true
|
22
|
-
formatter.write(doc, res)
|
23
|
-
return res.string
|
29
|
+
doc = Nokogiri::XML(original)
|
30
|
+
array_element = doc.xpath("//key[text()='files']/following-sibling::array/string")
|
31
|
+
array_element.each do |e|
|
32
|
+
e.content = File.join(prefix, e.content)
|
24
33
|
end
|
25
|
-
return
|
34
|
+
return doc.to_xml()
|
26
35
|
end
|
27
36
|
end
|
@@ -6,22 +6,21 @@ describe RewritePlistFile do
|
|
6
6
|
<?xml version="1.0" encoding="UTF-8"?>
|
7
7
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
8
8
|
<plist version="1.0">
|
9
|
-
<dict>
|
10
|
-
|
11
|
-
<string>clang version 3.4 (trunk 182989)</string>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
</dict>
|
9
|
+
<dict>
|
10
|
+
<key>clang_version</key>
|
11
|
+
<string>clang version 3.4 (trunk 182989)</string>
|
12
|
+
<key>files</key>
|
13
|
+
<array>
|
14
|
+
<string>src/eeprommanager/main1.cpp</string>
|
15
|
+
<string>src/eeprommanager/main2.cpp</string>
|
16
|
+
</array>
|
17
|
+
</dict>
|
18
18
|
</plist>
|
19
19
|
eos
|
20
|
-
|
21
20
|
should_be_plist = <<-eos
|
22
|
-
<?xml version=
|
21
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
23
22
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
24
|
-
<plist version=
|
23
|
+
<plist version="1.0">
|
25
24
|
<dict>
|
26
25
|
<key>clang_version</key>
|
27
26
|
<string>clang version 3.4 (trunk 182989)</string>
|
@@ -33,16 +32,15 @@ eos
|
|
33
32
|
</dict>
|
34
33
|
</plist>
|
35
34
|
eos
|
36
|
-
should_be_plist.strip!
|
37
35
|
new_plist = RewritePlistFile.with_prefix('test', original)
|
38
36
|
new_plist.should eq(should_be_plist)
|
39
37
|
end
|
40
38
|
|
41
39
|
it 'should do nothing for empty file arrays' do
|
42
40
|
original = <<-eos
|
43
|
-
<?xml version=
|
41
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
44
42
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
45
|
-
<plist version=
|
43
|
+
<plist version="1.0">
|
46
44
|
<dict>
|
47
45
|
<key>clang_version</key>
|
48
46
|
<string>clang version 3.4 (trunk 182989)</string>
|
@@ -52,6 +50,6 @@ eos
|
|
52
50
|
</plist>
|
53
51
|
eos
|
54
52
|
new_file = RewritePlistFile.with_prefix('test', original)
|
55
|
-
new_file.should eq(original
|
53
|
+
new_file.should eq(original)
|
56
54
|
end
|
57
55
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcc-to-clang-analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Köstlin
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: It then rewirtes the plist files to put the project name before the sourcefiles.
|
56
70
|
email:
|
57
71
|
- christian.koestlin@esrlabs.com
|