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.
- checksums.yaml +4 -4
- data/.rspec +4 -0
- data/.travis.yml +20 -9
- data/Gemfile +10 -1
- data/README.md +1 -1
- data/Rakefile +9 -9
- data/examples/docs.cpp +25 -0
- data/examples/docs.rb +31 -0
- data/ffi-clang.gemspec +1 -1
- data/lib/ffi/clang.rb +16 -13
- data/lib/ffi/clang/clang_version.rb +29 -0
- data/lib/ffi/clang/code_completion.rb +1 -1
- data/lib/ffi/clang/comment.rb +8 -4
- data/lib/ffi/clang/compilation_database.rb +1 -1
- data/lib/ffi/clang/cursor.rb +42 -15
- data/lib/ffi/clang/diagnostic.rb +6 -2
- data/lib/ffi/clang/file.rb +6 -9
- data/lib/ffi/clang/index.rb +4 -4
- data/lib/ffi/clang/lib.rb +1 -1
- data/lib/ffi/clang/lib/{utils.rb → clang_version.rb} +1 -1
- data/lib/ffi/clang/lib/code_completion.rb +2 -3
- data/lib/ffi/clang/lib/comment.rb +0 -2
- data/lib/ffi/clang/lib/compilation_database.rb +6 -9
- data/lib/ffi/clang/lib/cursor.rb +10 -18
- data/lib/ffi/clang/lib/diagnostic.rb +4 -4
- data/lib/ffi/clang/lib/file.rb +4 -6
- data/lib/ffi/clang/lib/inclusions.rb +2 -2
- data/lib/ffi/clang/lib/index.rb +0 -2
- data/lib/ffi/clang/lib/source_location.rb +6 -8
- data/lib/ffi/clang/lib/source_range.rb +1 -1
- data/lib/ffi/clang/lib/string.rb +0 -2
- data/lib/ffi/clang/lib/translation_unit.rb +2 -2
- data/lib/ffi/clang/lib/type.rb +8 -17
- data/lib/ffi/clang/source_location.rb +2 -2
- data/lib/ffi/clang/source_range.rb +16 -3
- data/lib/ffi/clang/token.rb +4 -4
- data/lib/ffi/clang/translation_unit.rb +5 -5
- data/lib/ffi/clang/type.rb +0 -14
- data/lib/ffi/clang/version.rb +2 -2
- data/spec/{clang → ffi/clang}/code_completion_spec.rb +6 -6
- data/spec/{clang → ffi/clang}/comment_spec.rb +22 -39
- data/spec/{clang → ffi/clang}/compilation_database_spec.rb +8 -10
- data/spec/{clang → ffi/clang}/cursor_spec.rb +89 -97
- data/spec/{clang → ffi/clang}/diagnostic_spec.rb +9 -10
- data/spec/{clang → ffi/clang}/file_spec.rb +3 -5
- data/spec/{fixtures → ffi/clang/fixtures}/a.c +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/canonical.c +0 -0
- data/spec/ffi/clang/fixtures/class.cpp +8 -0
- data/spec/{fixtures → ffi/clang/fixtures}/compile_commands.json +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/completion.cxx +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/docs.c +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/docs.cc +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/docs.h +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/list.c +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/location1.c +0 -0
- data/spec/ffi/clang/fixtures/simple.ast +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/simple.c +0 -0
- data/spec/{fixtures → ffi/clang/fixtures}/test.cxx +0 -0
- data/spec/{clang → ffi/clang}/index_spec.rb +17 -14
- data/spec/{clang → ffi/clang}/source_location_spec.rb +12 -14
- data/spec/{clang → ffi/clang}/source_range_spec.rb +12 -14
- data/spec/{clang → ffi/clang}/token_spec.rb +6 -8
- data/spec/{clang → ffi/clang}/translation_unit_spec.rb +28 -30
- data/spec/{clang → ffi/clang}/type_spec.rb +17 -33
- data/spec/ffi/clang/version_spec.rb +28 -0
- data/spec/spec_helper.rb +11 -37
- metadata +61 -55
- data/lib/ffi/clang/utils.rb +0 -89
- data/spec/clang/utils_spec.rb +0 -60
data/spec/clang/utils_spec.rb
DELETED
@@ -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
|