rbgccxml 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,12 +1,8 @@
1
- require 'rake/rdoctask'
1
+ require 'rdoc/task'
2
2
  require 'rake/contrib/sshpublisher'
3
- require 'rake/gempackagetask'
4
3
 
5
4
  require 'rspec/core/rake_task'
6
5
 
7
- PROJECT_NAME = "rbgccxml"
8
- RBGCCXML_VERSION = "1.0.1"
9
-
10
6
  task :default => :spec
11
7
 
12
8
  desc "Run all specs"
@@ -35,7 +31,7 @@ namespace :web do
35
31
  end
36
32
 
37
33
  # As part of the rbplusplus project, this just goes in a subfolder
38
- desc "Update the website"
34
+ desc "Update the website"
39
35
  task :upload => "web:build" do |t|
40
36
  Rake::SshDirPublisher.new("#{RUBYFORGE_USERNAME}@rubyforge.org", PROJECT_WEB_PATH, "publish").upload
41
37
  end
@@ -45,37 +41,3 @@ namespace :web do
45
41
  rm_rf "publish"
46
42
  end
47
43
  end
48
-
49
- spec = Gem::Specification.new do |s|
50
- s.name = PROJECT_NAME
51
- s.version = RBGCCXML_VERSION
52
- s.summary = 'Ruby interface to GCCXML'
53
- s.homepage = 'http://rbplusplus.rubyforge.org/rbgccxml'
54
- s.rubyforge_project = "rbplusplus"
55
- s.author = 'Jason Roelofs'
56
- s.email = 'jameskilton@gmail.com'
57
-
58
- s.add_dependency "nokogiri", "~> 1.4.0"
59
- s.add_dependency "gccxml_gem", "~> 0.9"
60
-
61
- s.description = <<-END
62
- Rbgccxml is a library that parses out GCCXML (http://www.gccxml.org) output
63
- and provides a simple but very powerful querying API for finding exactly
64
- what you want out of the C++ source code
65
- END
66
-
67
- patterns = [
68
- 'TODO',
69
- 'Rakefile',
70
- 'lib/**/*.rb',
71
- ]
72
-
73
- s.files = patterns.map {|p| Dir.glob(p) }.flatten
74
-
75
- s.test_files = Dir.glob('spec/**/*.rb')
76
-
77
- s.require_paths = ['lib']
78
- end
79
-
80
- Rake::GemPackageTask.new(spec) do |pkg|
81
- end
@@ -43,11 +43,13 @@ module RbGCCXML
43
43
  # Like #superclass above, this will find all superclasses for this class.
44
44
  # Functions the same as #superclass except this method always returns a QueryResult
45
45
  def superclasses(access_type = nil)
46
- [
47
- NodeCache.find_children_of_type(self, "Base").select do |base|
48
- access_type.nil? ? true : base.send("#{access_type}?")
49
- end
50
- ].flatten.map {|base| base.cpp_type }
46
+ QueryResult.new(
47
+ [
48
+ NodeCache.find_children_of_type(self, "Base").select do |base|
49
+ access_type.nil? ? true : base.send("#{access_type}?")
50
+ end
51
+ ].flatten.map {|base| base.cpp_type }
52
+ )
51
53
  end
52
54
 
53
55
  # Find all methods for this class. See Node#namespaces
@@ -6,7 +6,7 @@ module RbGCCXML
6
6
 
7
7
  # Get the list of EnumValues for this enumeration
8
8
  def values
9
- children
9
+ QueryResult.new children
10
10
  end
11
11
 
12
12
  # Is this enumeration anonymous? As in, does it have a name or is
@@ -3,17 +3,17 @@ module RbGCCXML
3
3
  # Represents a <Function> node, a global or namespaced function
4
4
  # or static class functions.
5
5
  class Function < Node
6
-
6
+
7
7
  # First of all, no more querying once you're this far in
8
8
  %w(classes namespaces functions).each do |f|
9
9
  define_method(f) do
10
10
  raise NotQueryableException.new("Cannot query for #{f} while in a Function")
11
11
  end
12
12
  end
13
-
13
+
14
14
  # Get the list of Arguments for this Function.
15
15
  def arguments
16
- children
16
+ QueryResult.new children
17
17
  end
18
18
 
19
19
  # Get the Node representing this Function's return type
@@ -25,5 +25,10 @@ describe "Function and Method Arguments" do
25
25
  rockin = @arguments_source.functions("rockin")
26
26
  rockin.arguments[1].value.should == "functions::test()"
27
27
  end
28
+
29
+ specify "should be a QueryResult" do
30
+ test = @arguments_source.functions("test1")
31
+ test.arguments.should be_a_kind_of(RbGCCXML::QueryResult)
32
+ end
28
33
  end
29
34
 
data/spec/classes_test.rb CHANGED
@@ -163,6 +163,7 @@ describe "Query inheritance heirarchy" do
163
163
  specify "can query for multiple inheritance" do
164
164
  multi = @source.classes("MultiBase")
165
165
  multi.superclasses.length.should == 2
166
+ multi.superclasses.should be_a_kind_of(RbGCCXML::QueryResult)
166
167
  multi.superclasses.select {|sp| sp.name == "ParentClass"}.should_not be_nil
167
168
  multi.superclasses.select {|sp| sp.name == "Parent2"}.should_not be_nil
168
169
  end
@@ -46,5 +46,10 @@ describe "Querying for enumerations" do
46
46
  found.values[2].value.should == 2
47
47
  end
48
48
 
49
+ specify "should be a QueryResult" do
50
+ enum = @enum_source.enumerations("TestEnum")
51
+ enum.values.length.should == 3
52
+ enum.values.should be_a_kind_of(RbGCCXML::QueryResult)
53
+ end
49
54
  end
50
55
 
metadata CHANGED
@@ -1,67 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rbgccxml
3
- version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 0
9
- - 1
10
- version: 1.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jason Roelofs
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2010-12-17 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-12-06 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: nokogiri
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &6465030 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 1
32
- - 4
33
- - 0
20
+ - !ruby/object:Gem::Version
34
21
  version: 1.4.0
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: gccxml_gem
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *6465030
25
+ - !ruby/object:Gem::Dependency
26
+ name: gccxml_gem
27
+ requirement: &6464790 !ruby/object:Gem::Requirement
41
28
  none: false
42
- requirements:
29
+ requirements:
43
30
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 25
46
- segments:
47
- - 0
48
- - 9
49
- version: "0.9"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.9'
50
33
  type: :runtime
51
- version_requirements: *id002
52
- description: |
53
- Rbgccxml is a library that parses out GCCXML (http://www.gccxml.org) output
34
+ prerelease: false
35
+ version_requirements: *6464790
36
+ description: ! 'Rbgccxml is a library that parses out GCCXML (http://www.gccxml.org)
37
+ output
38
+
54
39
  and provides a simple but very powerful querying API for finding exactly
40
+
55
41
  what you want out of the C++ source code
56
42
 
43
+ '
57
44
  email: jameskilton@gmail.com
58
45
  executables: []
59
-
60
46
  extensions: []
61
-
62
47
  extra_rdoc_files: []
63
-
64
- files:
48
+ files:
65
49
  - TODO
66
50
  - Rakefile
67
51
  - lib/jamis.rb
@@ -112,41 +96,31 @@ files:
112
96
  - spec/test_helper.rb
113
97
  - spec/types_test.rb
114
98
  - spec/variables_test.rb
115
- has_rdoc: true
116
99
  homepage: http://rbplusplus.rubyforge.org/rbgccxml
117
100
  licenses: []
118
-
119
101
  post_install_message:
120
102
  rdoc_options: []
121
-
122
- require_paths:
103
+ require_paths:
123
104
  - lib
124
- required_ruby_version: !ruby/object:Gem::Requirement
105
+ required_ruby_version: !ruby/object:Gem::Requirement
125
106
  none: false
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- hash: 3
130
- segments:
131
- - 0
132
- version: "0"
133
- required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
112
  none: false
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- hash: 3
139
- segments:
140
- - 0
141
- version: "0"
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
142
117
  requirements: []
143
-
144
118
  rubyforge_project: rbplusplus
145
- rubygems_version: 1.3.7
119
+ rubygems_version: 1.8.6
146
120
  signing_key:
147
121
  specification_version: 3
148
122
  summary: Ruby interface to GCCXML
149
- test_files:
123
+ test_files:
150
124
  - spec/arguments_test.rb
151
125
  - spec/classes_test.rb
152
126
  - spec/enumerations_test.rb