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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 323da23761368a9a6aecb218389933c2f78047b2
4
- data.tar.gz: c889435a04d5fd75ac791b093dd17dc4939ef7c9
3
+ metadata.gz: bc1882243e5664d784f77a1ad87d29a42bd5ad01
4
+ data.tar.gz: 17269f06ac469d31e8be62b82553365585fe1cea
5
5
  SHA512:
6
- metadata.gz: 111e65d006c480de5633fcbbb6fa44aec0dba3878118a1c374c87670afdfd66616f16f969a9b0202fa5fb8a8c8d7a6a9fbf7f045aa207ed2593fda10042459ee
7
- data.tar.gz: 0036c48ced553e38bf8daa0b3b5e2d32aeba85672968fce8090172dffb4574289b6dd228cce01de54f97b954d6f46a6b54bb4d6c8838d8ad5ff044598e8c1190
6
+ metadata.gz: 9e9df1c2c0bbb6a0ebc16c3a2572232d3fec3bc05ef894c96314dbd6dfdc3e7b6c5a942a4fdd5932a882a95e54a0fd9502167a4e142872edeed38ef94ef1eca5
7
+ data.tar.gz: 440b599c35c6349ff312734fd290a58b3c2e1378d4c46f98e81b1806bdd8668112c7579ac36b79dd1b3a71d9a4dc009a3f25f16de172b2ca306de846a9fbf618
data/bin/g++ CHANGED
@@ -17,7 +17,7 @@ LOG.info("executing '#{cl}'")
17
17
  res = system(cl)
18
18
  unless res
19
19
  LOG.warn("problems while executing #{cl}")
20
- exit res
20
+ exit 1
21
21
  end
22
22
 
23
23
  if output.length > 0
@@ -21,5 +21,5 @@ 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 'nokogiri'
24
+ spec.add_development_dependency 'plist2'
25
25
  end
@@ -1,17 +1,21 @@
1
- #require 'plist'
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
- # def self.with_prefix(prefix, original)
8
- # v = Plist::parse_xml(original)
9
- # files = v['files']
10
- # v['files'] = files.map{|i|File.join(prefix, i)}
11
- # v.to_plist()
12
- # end
13
- # def self.with_prefix(prefix, original)
14
- # doc = REXML::Document.new(original)
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
- # end
28
- class NullLogger
29
- def debug(s)
30
- 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
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,3 +1,3 @@
1
1
  module GccToClangAnalyzer
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  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
- <dict>
25
- <key>clang_version</key>
26
- <string>clang version 3.4 (trunk 182989)</string>
27
- <key>files</key>
28
- <array>
29
- <string>test/src/eeprommanager/main1.cpp</string>
30
- <string>test/src/eeprommanager/main2.cpp</string>
31
- </array>
32
- </dict>
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
- <dict>
45
- <key>clang_version</key>
46
- <string>clang version 3.4 (trunk 182989)</string>
47
- <key>files</key>
48
- <array> </array>
49
- </dict>
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(original)
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.10
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-04 00:00:00.000000000 Z
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: nokogiri
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: :runtime
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements: