gcc-to-clang-analyzer 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8710435833b45638f303fb97f7891831c92257a
4
- data.tar.gz: fd0aaef73469568f9af236efb27b1f2d0cc9c2d8
3
+ metadata.gz: fcf5a94d9492a0ec261dd310b2e0a581525e361d
4
+ data.tar.gz: 1788dbf79927d9ea5c3ed09bc58783c9c3119a31
5
5
  SHA512:
6
- metadata.gz: c31c747f228b34625c546bd1c9a418cfe22533390a18f08178c14f9a4e7362049adf95f6328358770d693c8418f78c777fa9a26d15af11b025de5052b16c02f8
7
- data.tar.gz: 0dc0300c7e4d0dac46d748c3b36985aee5042377fb1c8d458d0d5dbbbf018e424ca5830a8bb3441edf7d336b8cdfaf8c959eb169f37cc53f01af7a062e8c8b4f
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
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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)
@@ -21,5 +21,4 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.5'
22
22
  spec.add_development_dependency 'rspec'
23
23
  spec.add_development_dependency 'rake'
24
- spec.add_runtime_dependency 'plist'
25
24
  end
@@ -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
- v = Plist::parse_xml(original)
6
- files = v['files']
7
- v['files'] = files.map{|i|File.join(prefix, i)}
8
- v.to_plist()
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
@@ -1,3 +1,3 @@
1
1
  module GccToClangAnalyzer
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -18,24 +18,23 @@ describe RewritePlistFile do
18
18
  </plist>
19
19
  eos
20
20
 
21
- should_be_plist = <<-eos
22
- <?xml version="1.0" encoding="UTF-8"?>
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="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>
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.5
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