ffi-clang 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +4 -0
  3. data/.travis.yml +20 -9
  4. data/Gemfile +10 -1
  5. data/README.md +1 -1
  6. data/Rakefile +9 -9
  7. data/examples/docs.cpp +25 -0
  8. data/examples/docs.rb +31 -0
  9. data/ffi-clang.gemspec +1 -1
  10. data/lib/ffi/clang.rb +16 -13
  11. data/lib/ffi/clang/clang_version.rb +29 -0
  12. data/lib/ffi/clang/code_completion.rb +1 -1
  13. data/lib/ffi/clang/comment.rb +8 -4
  14. data/lib/ffi/clang/compilation_database.rb +1 -1
  15. data/lib/ffi/clang/cursor.rb +42 -15
  16. data/lib/ffi/clang/diagnostic.rb +6 -2
  17. data/lib/ffi/clang/file.rb +6 -9
  18. data/lib/ffi/clang/index.rb +4 -4
  19. data/lib/ffi/clang/lib.rb +1 -1
  20. data/lib/ffi/clang/lib/{utils.rb → clang_version.rb} +1 -1
  21. data/lib/ffi/clang/lib/code_completion.rb +2 -3
  22. data/lib/ffi/clang/lib/comment.rb +0 -2
  23. data/lib/ffi/clang/lib/compilation_database.rb +6 -9
  24. data/lib/ffi/clang/lib/cursor.rb +10 -18
  25. data/lib/ffi/clang/lib/diagnostic.rb +4 -4
  26. data/lib/ffi/clang/lib/file.rb +4 -6
  27. data/lib/ffi/clang/lib/inclusions.rb +2 -2
  28. data/lib/ffi/clang/lib/index.rb +0 -2
  29. data/lib/ffi/clang/lib/source_location.rb +6 -8
  30. data/lib/ffi/clang/lib/source_range.rb +1 -1
  31. data/lib/ffi/clang/lib/string.rb +0 -2
  32. data/lib/ffi/clang/lib/translation_unit.rb +2 -2
  33. data/lib/ffi/clang/lib/type.rb +8 -17
  34. data/lib/ffi/clang/source_location.rb +2 -2
  35. data/lib/ffi/clang/source_range.rb +16 -3
  36. data/lib/ffi/clang/token.rb +4 -4
  37. data/lib/ffi/clang/translation_unit.rb +5 -5
  38. data/lib/ffi/clang/type.rb +0 -14
  39. data/lib/ffi/clang/version.rb +2 -2
  40. data/spec/{clang → ffi/clang}/code_completion_spec.rb +6 -6
  41. data/spec/{clang → ffi/clang}/comment_spec.rb +22 -39
  42. data/spec/{clang → ffi/clang}/compilation_database_spec.rb +8 -10
  43. data/spec/{clang → ffi/clang}/cursor_spec.rb +89 -97
  44. data/spec/{clang → ffi/clang}/diagnostic_spec.rb +9 -10
  45. data/spec/{clang → ffi/clang}/file_spec.rb +3 -5
  46. data/spec/{fixtures → ffi/clang/fixtures}/a.c +0 -0
  47. data/spec/{fixtures → ffi/clang/fixtures}/canonical.c +0 -0
  48. data/spec/ffi/clang/fixtures/class.cpp +8 -0
  49. data/spec/{fixtures → ffi/clang/fixtures}/compile_commands.json +0 -0
  50. data/spec/{fixtures → ffi/clang/fixtures}/completion.cxx +0 -0
  51. data/spec/{fixtures → ffi/clang/fixtures}/docs.c +0 -0
  52. data/spec/{fixtures → ffi/clang/fixtures}/docs.cc +0 -0
  53. data/spec/{fixtures → ffi/clang/fixtures}/docs.h +0 -0
  54. data/spec/{fixtures → ffi/clang/fixtures}/list.c +0 -0
  55. data/spec/{fixtures → ffi/clang/fixtures}/location1.c +0 -0
  56. data/spec/ffi/clang/fixtures/simple.ast +0 -0
  57. data/spec/{fixtures → ffi/clang/fixtures}/simple.c +0 -0
  58. data/spec/{fixtures → ffi/clang/fixtures}/test.cxx +0 -0
  59. data/spec/{clang → ffi/clang}/index_spec.rb +17 -14
  60. data/spec/{clang → ffi/clang}/source_location_spec.rb +12 -14
  61. data/spec/{clang → ffi/clang}/source_range_spec.rb +12 -14
  62. data/spec/{clang → ffi/clang}/token_spec.rb +6 -8
  63. data/spec/{clang → ffi/clang}/translation_unit_spec.rb +28 -30
  64. data/spec/{clang → ffi/clang}/type_spec.rb +17 -33
  65. data/spec/ffi/clang/version_spec.rb +28 -0
  66. data/spec/spec_helper.rb +11 -37
  67. metadata +61 -55
  68. data/lib/ffi/clang/utils.rb +0 -89
  69. data/spec/clang/utils_spec.rb +0 -60
@@ -1,60 +0,0 @@
1
- # Copyright, 2014 by Masahiro Sano.
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'spec_helper'
22
-
23
- describe FFI::Clang::Utils do
24
- describe '#self.clang_version_string' do
25
- let (:version) { Utils::clang_version_string }
26
- it "returns a version string for showing to user" do
27
- expect(version).to be_kind_of(String)
28
- expect(version).to match(/clang version \d+\.\d+/)
29
- end
30
- end
31
-
32
- describe '#self.self.clang_version' do
33
- let (:version) { Utils::clang_version }
34
- it "returns only a version of clang as array [major, minor]" do
35
- expect(version).to be_kind_of(Array)
36
- end
37
- end
38
-
39
- describe '#self.clang_version_symbol' do
40
- let (:symbol) { Utils::clang_version_symbol }
41
- it "returns a symbol that represents clang version" do
42
- expect(symbol).to be_kind_of(Symbol)
43
- expect(symbol.to_s).to match(/^clang_\d+\_\d+$/)
44
- end
45
- end
46
-
47
- describe '#self.self.clang_major_version' do
48
- let (:version) { Utils::clang_major_version }
49
- it "returns major versions as integer" do
50
- expect(version).to be_kind_of(Integer)
51
- end
52
- end
53
-
54
- describe '#self.self.clang_minor_version' do
55
- let (:version) { Utils::clang_minor_version }
56
- it "returns minor versions as integer" do
57
- expect(version).to be_kind_of(Integer)
58
- end
59
- end
60
- end