abstract_graph 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +22 -0
  4. data/README.rdoc +43 -0
  5. data/Rakefile +14 -0
  6. data/abstract_graph.gemspec +22 -0
  7. data/lib/abstract_graph.rb +10 -0
  8. data/lib/abstract_graph/composition.rb +11 -0
  9. data/lib/abstract_graph/composition/edge.rb +21 -0
  10. data/lib/abstract_graph/composition/edge/initialize.rb +18 -0
  11. data/lib/abstract_graph/composition/edge/is_coincident.rb +15 -0
  12. data/lib/abstract_graph/composition/uniquenamecollection.rb +21 -0
  13. data/lib/abstract_graph/composition/uniquenamecollection/add.rb +19 -0
  14. data/lib/abstract_graph/composition/uniquenamecollection/dup.rb +20 -0
  15. data/lib/abstract_graph/composition/uniquenamecollection/initialize.rb +14 -0
  16. data/lib/abstract_graph/composition/uniquenamecollection/link.rb +32 -0
  17. data/lib/abstract_graph/composition/uniquenamecollection/method_missing.rb +14 -0
  18. data/lib/abstract_graph/composition/vertex.rb +21 -0
  19. data/lib/abstract_graph/composition/vertex/delete.rb +12 -0
  20. data/lib/abstract_graph/composition/vertex/initialize.rb +14 -0
  21. data/lib/abstract_graph/graph.rb +25 -0
  22. data/lib/abstract_graph/graph/add_edge.rb +30 -0
  23. data/lib/abstract_graph/graph/add_vertex.rb +16 -0
  24. data/lib/abstract_graph/graph/delete_edge.rb +21 -0
  25. data/lib/abstract_graph/graph/delete_vertex.rb +21 -0
  26. data/lib/abstract_graph/graph/dup.rb +14 -0
  27. data/lib/abstract_graph/graph/has_edge.rb +13 -0
  28. data/lib/abstract_graph/graph/has_vertex.rb +13 -0
  29. data/lib/abstract_graph/graph/initialize.rb +16 -0
  30. data/lib/abstract_graph/version.rb +5 -0
  31. data/spec/abstract_graph/composition/edge/initialize_spec.rb +38 -0
  32. data/spec/abstract_graph/composition/edge/is_coincident_spec.rb +33 -0
  33. data/spec/abstract_graph/composition/edge/name_spec.rb +53 -0
  34. data/spec/abstract_graph/composition/edge/vertices_spec.rb +32 -0
  35. data/spec/abstract_graph/composition/edge_spec.rb +8 -0
  36. data/spec/abstract_graph/composition/uniquenamecollection/add_spec.rb +41 -0
  37. data/spec/abstract_graph/composition/uniquenamecollection/dup_spec.rb +29 -0
  38. data/spec/abstract_graph/composition/uniquenamecollection/initialize_spec.rb +21 -0
  39. data/spec/abstract_graph/composition/uniquenamecollection/link_spec.rb +67 -0
  40. data/spec/abstract_graph/composition/uniquenamecollection/method_missing_spec.rb +50 -0
  41. data/spec/abstract_graph/composition/uniquenamecollection_spec.rb +8 -0
  42. data/spec/abstract_graph/composition/vertex/delete_spec.rb +12 -0
  43. data/spec/abstract_graph/composition/vertex/initialize_spec.rb +45 -0
  44. data/spec/abstract_graph/composition/vertex/name_spec.rb +47 -0
  45. data/spec/abstract_graph/composition/vertex/value_spec.rb +46 -0
  46. data/spec/abstract_graph/composition/vertex_spec.rb +8 -0
  47. data/spec/abstract_graph/graph/add_edge_spec.rb +46 -0
  48. data/spec/abstract_graph/graph/add_vertex_spec.rb +29 -0
  49. data/spec/abstract_graph/graph/delete_edge_spec.rb +56 -0
  50. data/spec/abstract_graph/graph/delete_vertex_spec.rb +48 -0
  51. data/spec/abstract_graph/graph/dup_spec.rb +37 -0
  52. data/spec/abstract_graph/graph/has_edge_spec.rb +31 -0
  53. data/spec/abstract_graph/graph/has_vertex_spec.rb +27 -0
  54. data/spec/abstract_graph/graph/intialize_spec.rb +17 -0
  55. data/spec/abstract_graph/graph_spec.rb +6 -0
  56. data/spec/abstract_graph_spec.rb +7 -0
  57. data/spec/dummy_helper.rb +4 -0
  58. data/spec/spec_helper.rb +11 -0
  59. metadata +149 -0
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ module AbstractGraph
4
+ module Composition
5
+ describe Graph do
6
+
7
+ before :each do
8
+ @vertex1 = "Vertex1"
9
+ @vertex2 = "Vertex2"
10
+ @graph = Graph.new
11
+ @graph.add_vertex @vertex1
12
+ @graph.add_vertex @vertex2
13
+ end
14
+
15
+ describe "#has_edge?(String)" do
16
+
17
+ it "returns whether the string name is a named edge in the graph" do
18
+ @graph.add_edge( "MyEdge", @vertex1, @vertex2 )
19
+ @graph.has_edge?( "MyEdge" ).should be_true
20
+ end
21
+
22
+ it "returns false when the string is not a named edge" do
23
+ @graph.has_edge?( "MyVertex" ).should be_false
24
+ @graph.has_edge?( "AlsoFalse" ).should_not be_nil
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ module AbstractGraph
4
+ module Composition
5
+ describe Graph do
6
+
7
+ before :each do
8
+ @graph = Graph.new
9
+ end
10
+
11
+ describe "#has_vertex?(String)" do
12
+
13
+ it "returns whether the string name is a named vertex in the graph" do
14
+ @graph.add_vertex "MyVertex"
15
+ @graph.has_vertex?( "MyVertex" ).should be_true
16
+ end
17
+
18
+ it "returns false when the string is not a named vertex" do
19
+ @graph.has_vertex?( "MyVertex" ).should be_false
20
+ @graph.has_vertex?( "AlsoFalse" ).should_not be_nil
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ module AbstractGraph
4
+ describe Graph do
5
+ describe "#new" do
6
+
7
+ before(:each) do
8
+ @graph = Graph.new
9
+ end
10
+
11
+ it "returns an object of class Graph" do
12
+ @graph.class.should == Graph
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ module AbstractGraph
4
+ describe Graph do
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe AbstractGraph do
4
+ it 'should return correct version string' do
5
+ AbstractGraph.version_string.should == "AbstractGraph version #{AbstractGraph::VERSION}"
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ # simple class that implements #name
2
+ class Dummy
3
+ attr_accessor :name
4
+ end
@@ -0,0 +1,11 @@
1
+ require 'dummy_helper'
2
+ require 'rspec'
3
+ require 'abstract_graph'
4
+
5
+ # below already coded inside the rakefile
6
+ =begin
7
+ RSpec.configure do |config|
8
+ config.color_enabled = true
9
+ config.formatter = 'documentation'
10
+ end
11
+ =end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: abstract_graph
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Austin Lee ~D4L
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '2.5'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '2.5'
30
+ description: ! "Abstract Graph is a graphing library that can create\n mathematical
31
+ graphs and perform operatations on them."
32
+ email:
33
+ - Austin.Lee.D4L@gmail.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - .gitignore
39
+ - Gemfile
40
+ - LICENSE
41
+ - README.rdoc
42
+ - Rakefile
43
+ - abstract_graph.gemspec
44
+ - lib/abstract_graph.rb
45
+ - lib/abstract_graph/composition.rb
46
+ - lib/abstract_graph/composition/edge.rb
47
+ - lib/abstract_graph/composition/edge/initialize.rb
48
+ - lib/abstract_graph/composition/edge/is_coincident.rb
49
+ - lib/abstract_graph/composition/uniquenamecollection.rb
50
+ - lib/abstract_graph/composition/uniquenamecollection/add.rb
51
+ - lib/abstract_graph/composition/uniquenamecollection/dup.rb
52
+ - lib/abstract_graph/composition/uniquenamecollection/initialize.rb
53
+ - lib/abstract_graph/composition/uniquenamecollection/link.rb
54
+ - lib/abstract_graph/composition/uniquenamecollection/method_missing.rb
55
+ - lib/abstract_graph/composition/vertex.rb
56
+ - lib/abstract_graph/composition/vertex/delete.rb
57
+ - lib/abstract_graph/composition/vertex/initialize.rb
58
+ - lib/abstract_graph/graph.rb
59
+ - lib/abstract_graph/graph/add_edge.rb
60
+ - lib/abstract_graph/graph/add_vertex.rb
61
+ - lib/abstract_graph/graph/delete_edge.rb
62
+ - lib/abstract_graph/graph/delete_vertex.rb
63
+ - lib/abstract_graph/graph/dup.rb
64
+ - lib/abstract_graph/graph/has_edge.rb
65
+ - lib/abstract_graph/graph/has_vertex.rb
66
+ - lib/abstract_graph/graph/initialize.rb
67
+ - lib/abstract_graph/version.rb
68
+ - spec/abstract_graph/composition/edge/initialize_spec.rb
69
+ - spec/abstract_graph/composition/edge/is_coincident_spec.rb
70
+ - spec/abstract_graph/composition/edge/name_spec.rb
71
+ - spec/abstract_graph/composition/edge/vertices_spec.rb
72
+ - spec/abstract_graph/composition/edge_spec.rb
73
+ - spec/abstract_graph/composition/uniquenamecollection/add_spec.rb
74
+ - spec/abstract_graph/composition/uniquenamecollection/dup_spec.rb
75
+ - spec/abstract_graph/composition/uniquenamecollection/initialize_spec.rb
76
+ - spec/abstract_graph/composition/uniquenamecollection/link_spec.rb
77
+ - spec/abstract_graph/composition/uniquenamecollection/method_missing_spec.rb
78
+ - spec/abstract_graph/composition/uniquenamecollection_spec.rb
79
+ - spec/abstract_graph/composition/vertex/delete_spec.rb
80
+ - spec/abstract_graph/composition/vertex/initialize_spec.rb
81
+ - spec/abstract_graph/composition/vertex/name_spec.rb
82
+ - spec/abstract_graph/composition/vertex/value_spec.rb
83
+ - spec/abstract_graph/composition/vertex_spec.rb
84
+ - spec/abstract_graph/graph/add_edge_spec.rb
85
+ - spec/abstract_graph/graph/add_vertex_spec.rb
86
+ - spec/abstract_graph/graph/delete_edge_spec.rb
87
+ - spec/abstract_graph/graph/delete_vertex_spec.rb
88
+ - spec/abstract_graph/graph/dup_spec.rb
89
+ - spec/abstract_graph/graph/has_edge_spec.rb
90
+ - spec/abstract_graph/graph/has_vertex_spec.rb
91
+ - spec/abstract_graph/graph/intialize_spec.rb
92
+ - spec/abstract_graph/graph_spec.rb
93
+ - spec/abstract_graph_spec.rb
94
+ - spec/dummy_helper.rb
95
+ - spec/spec_helper.rb
96
+ homepage: https://github.com/D4L/abstractGraph
97
+ licenses:
98
+ - MIT
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ! '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubyforge_project:
117
+ rubygems_version: 1.8.24
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: Mathmatical graph analysis software.
121
+ test_files:
122
+ - spec/abstract_graph/composition/edge/initialize_spec.rb
123
+ - spec/abstract_graph/composition/edge/is_coincident_spec.rb
124
+ - spec/abstract_graph/composition/edge/name_spec.rb
125
+ - spec/abstract_graph/composition/edge/vertices_spec.rb
126
+ - spec/abstract_graph/composition/edge_spec.rb
127
+ - spec/abstract_graph/composition/uniquenamecollection/add_spec.rb
128
+ - spec/abstract_graph/composition/uniquenamecollection/dup_spec.rb
129
+ - spec/abstract_graph/composition/uniquenamecollection/initialize_spec.rb
130
+ - spec/abstract_graph/composition/uniquenamecollection/link_spec.rb
131
+ - spec/abstract_graph/composition/uniquenamecollection/method_missing_spec.rb
132
+ - spec/abstract_graph/composition/uniquenamecollection_spec.rb
133
+ - spec/abstract_graph/composition/vertex/delete_spec.rb
134
+ - spec/abstract_graph/composition/vertex/initialize_spec.rb
135
+ - spec/abstract_graph/composition/vertex/name_spec.rb
136
+ - spec/abstract_graph/composition/vertex/value_spec.rb
137
+ - spec/abstract_graph/composition/vertex_spec.rb
138
+ - spec/abstract_graph/graph/add_edge_spec.rb
139
+ - spec/abstract_graph/graph/add_vertex_spec.rb
140
+ - spec/abstract_graph/graph/delete_edge_spec.rb
141
+ - spec/abstract_graph/graph/delete_vertex_spec.rb
142
+ - spec/abstract_graph/graph/dup_spec.rb
143
+ - spec/abstract_graph/graph/has_edge_spec.rb
144
+ - spec/abstract_graph/graph/has_vertex_spec.rb
145
+ - spec/abstract_graph/graph/intialize_spec.rb
146
+ - spec/abstract_graph/graph_spec.rb
147
+ - spec/abstract_graph_spec.rb
148
+ - spec/dummy_helper.rb
149
+ - spec/spec_helper.rb