gcc-to-clang-analyzer 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/g++ +1 -1
- data/gcc-to-clang-analyzer.gemspec +1 -1
- data/lib/gcc_to_clang_analyzer/rewrite_plist_file.rb +27 -27
- data/lib/gcc_to_clang_analyzer/version.rb +1 -1
- data/spec/rewrite_plist_file_spec.rb +36 -16
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc1882243e5664d784f77a1ad87d29a42bd5ad01
|
4
|
+
data.tar.gz: 17269f06ac469d31e8be62b82553365585fe1cea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e9df1c2c0bbb6a0ebc16c3a2572232d3fec3bc05ef894c96314dbd6dfdc3e7b6c5a942a4fdd5932a882a95e54a0fd9502167a4e142872edeed38ef94ef1eca5
|
7
|
+
data.tar.gz: 440b599c35c6349ff312734fd290a58b3c2e1378d4c46f98e81b1806bdd8668112c7579ac36b79dd1b3a71d9a4dc009a3f25f16de172b2ca306de846a9fbf618
|
data/bin/g++
CHANGED
@@ -1,17 +1,21 @@
|
|
1
|
-
|
1
|
+
require 'plist'
|
2
2
|
#require 'ox'
|
3
3
|
#require 'rexml/document'
|
4
|
-
require 'nokogiri'
|
4
|
+
#require 'nokogiri'
|
5
5
|
|
6
6
|
class RewritePlistFile
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
class NullLogger
|
8
|
+
def debug(s)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
def self.with_prefix(prefix, original)
|
12
|
+
v = Plist::parse_xml(original)
|
13
|
+
files = v['files']
|
14
|
+
v['files'] = files.map{|i|File.join(prefix, i)}
|
15
|
+
v.to_plist()
|
16
|
+
end
|
17
|
+
# def self.with_prefix(prefix, original, log=NullLogger.new)
|
18
|
+
# doc = REXML::Document.new(original, :attribute_quote => :quote)
|
15
19
|
# array_element = REXML::XPath.first(doc, "//key[text()='files']/following-sibling::array")
|
16
20
|
# if array_element
|
17
21
|
# array_element.elements.each do |s|
|
@@ -24,21 +28,17 @@ class RewritePlistFile
|
|
24
28
|
# return res.string
|
25
29
|
# end
|
26
30
|
# return original
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
log.debug("TRANSFORMED") if log
|
41
|
-
log.debug(doc.to_xml) if log
|
42
|
-
return doc.to_xml()
|
43
|
-
end
|
31
|
+
# end
|
32
|
+
# def self.with_prefix(prefix, original, log=NullLogger.new)
|
33
|
+
# doc = Nokogiri::XML(original)
|
34
|
+
# log.debug("ORIGINAL") if log
|
35
|
+
# log.debug(doc.to_xml) if log
|
36
|
+
# array_element = doc.xpath("//key[text()='files']/following-sibling::array/string")
|
37
|
+
# array_element.each do |e|
|
38
|
+
# e.content = File.join(prefix, e.content)
|
39
|
+
# end
|
40
|
+
# log.debug("TRANSFORMED") if log
|
41
|
+
# log.debug(doc.to_xml) if log
|
42
|
+
# return doc.to_xml()
|
43
|
+
# end
|
44
44
|
end
|
@@ -1,5 +1,9 @@
|
|
1
1
|
require 'gcc_to_clang_analyzer/rewrite_plist_file'
|
2
2
|
|
3
|
+
def spaces_to_tab(s)
|
4
|
+
s.gsub(' ', "\t")
|
5
|
+
end
|
6
|
+
|
3
7
|
describe RewritePlistFile do
|
4
8
|
it 'should replace the files array with a prefixed version' do
|
5
9
|
original = <<-eos
|
@@ -21,17 +25,18 @@ eos
|
|
21
25
|
<?xml version="1.0" encoding="UTF-8"?>
|
22
26
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
23
27
|
<plist version="1.0">
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
<dict>
|
29
|
+
<key>clang_version</key>
|
30
|
+
<string>clang version 3.4 (trunk 182989)</string>
|
31
|
+
<key>files</key>
|
32
|
+
<array>
|
33
|
+
<string>test/src/eeprommanager/main1.cpp</string>
|
34
|
+
<string>test/src/eeprommanager/main2.cpp</string>
|
35
|
+
</array>
|
36
|
+
</dict>
|
33
37
|
</plist>
|
34
38
|
eos
|
39
|
+
should_be_plist = spaces_to_tab(should_be_plist)
|
35
40
|
new_plist = RewritePlistFile.with_prefix('test', original)
|
36
41
|
new_plist.should eq(should_be_plist)
|
37
42
|
end
|
@@ -41,15 +46,30 @@ eos
|
|
41
46
|
<?xml version="1.0" encoding="UTF-8"?>
|
42
47
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
43
48
|
<plist version="1.0">
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
49
|
+
<dict>
|
50
|
+
<key>clang_version</key>
|
51
|
+
<string>clang version 3.4 (trunk 182989)</string>
|
52
|
+
<key>files</key>
|
53
|
+
<array> </array>
|
54
|
+
</dict>
|
50
55
|
</plist>
|
51
56
|
eos
|
57
|
+
|
58
|
+
should_be_plist = <<-eos
|
59
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
60
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
61
|
+
<plist version="1.0">
|
62
|
+
<dict>
|
63
|
+
<key>clang_version</key>
|
64
|
+
<string>clang version 3.4 (trunk 182989)</string>
|
65
|
+
<key>files</key>
|
66
|
+
<array/>
|
67
|
+
</dict>
|
68
|
+
</plist>
|
69
|
+
eos
|
70
|
+
|
71
|
+
should_be_plist = spaces_to_tab(should_be_plist)
|
52
72
|
new_file = RewritePlistFile.with_prefix('test', original)
|
53
|
-
new_file.should eq(
|
73
|
+
new_file.should eq(should_be_plist)
|
54
74
|
end
|
55
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Köstlin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,13 +53,13 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: plist2
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|