gcc-to-clang-analyzer 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -20
- data/gcc-to-clang-analyzer.gemspec +0 -1
- data/lib/gcc_to_clang_analyzer/rewrite_plist_file.rb +19 -5
- data/lib/gcc_to_clang_analyzer/version.rb +1 -1
- data/spec/rewrite_plist_file_spec.rb +13 -14
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcf5a94d9492a0ec261dd310b2e0a581525e361d
|
4
|
+
data.tar.gz: 1788dbf79927d9ea5c3ed09bc58783c9c3119a31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0e970f305a3470ccea8f1de3455c27461d2ac121435011d362f80472bc4ecb2ff7d7612ef96037f256a2ebd4efe99000d535b982b9250764339425a32659888
|
7
|
+
data.tar.gz: b1f70d051f762abc079bce0cb64498a70a1c174545d9dc6adef12bfb23cd85e372b690292a1702596bd130b0c849e9f2153a9448cd26c82ea8a825cf47c54d89
|
data/README.md
CHANGED
@@ -1,29 +1,12 @@
|
|
1
1
|
# Gcc::To::Clang::Analyzer
|
2
2
|
|
3
|
-
|
3
|
+
simple g++ drop in replacement, that calls clang --analyze instead of g++
|
4
|
+
and removes, changes some of the commandline parameters.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'gcc-to-clang-analyzer'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
8
|
$ gem install gcc-to-clang-analyzer
|
18
9
|
|
19
10
|
## Usage
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it ( http://github.com/<my-github-username>/gcc-to-clang-analyzer/fork )
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
12
|
+
$ g++ (is now mapped to clang --analyze)
|
@@ -1,10 +1,24 @@
|
|
1
|
-
require 'plist'
|
1
|
+
#require 'plist'
|
2
|
+
#require 'ox'
|
3
|
+
require 'rexml/document'
|
2
4
|
|
3
5
|
class RewritePlistFile
|
6
|
+
# def self.with_prefix(prefix, original)
|
7
|
+
# v = Plist::parse_xml(original)
|
8
|
+
# files = v['files']
|
9
|
+
# v['files'] = files.map{|i|File.join(prefix, i)}
|
10
|
+
# v.to_plist()
|
11
|
+
# end
|
4
12
|
def self.with_prefix(prefix, original)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
13
|
+
doc = REXML::Document.new(original)
|
14
|
+
array_element = REXML::XPath.first(doc, "//key[text()='files']/following-sibling::array")
|
15
|
+
array_element.elements.each do |s|
|
16
|
+
s.text = File.join(prefix, s.text)
|
17
|
+
end
|
18
|
+
res = StringIO.new
|
19
|
+
formatter = REXML::Formatters::Pretty.new(2)
|
20
|
+
formatter.compact = true
|
21
|
+
formatter.write(doc, res)
|
22
|
+
return res.string
|
9
23
|
end
|
10
24
|
end
|
@@ -18,24 +18,23 @@ describe RewritePlistFile do
|
|
18
18
|
</plist>
|
19
19
|
eos
|
20
20
|
|
21
|
-
|
22
|
-
<?xml version=
|
21
|
+
should_be_plist = <<-eos
|
22
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
23
23
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
24
|
-
<plist version=
|
25
|
-
<dict>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
</dict>
|
24
|
+
<plist version='1.0'>
|
25
|
+
<dict>
|
26
|
+
<key>clang_version</key>
|
27
|
+
<string>clang version 3.4 (trunk 182989)</string>
|
28
|
+
<key>files</key>
|
29
|
+
<array>
|
30
|
+
<string>test/src/eeprommanager/main1.cpp</string>
|
31
|
+
<string>test/src/eeprommanager/main2.cpp</string>
|
32
|
+
</array>
|
33
|
+
</dict>
|
34
34
|
</plist>
|
35
35
|
eos
|
36
|
+
should_be_plist.strip!
|
36
37
|
|
37
|
-
|
38
|
-
|
39
38
|
new_plist = RewritePlistFile.with_prefix('test', original_plist)
|
40
39
|
new_plist.should eq(should_be_plist)
|
41
40
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Köstlin
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: plist
|
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'
|
69
55
|
description: It then rewirtes the plist files to put the project name before the sourcefiles.
|
70
56
|
email:
|
71
57
|
- christian.koestlin@esrlabs.com
|