yogo-project 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.document +5 -0
  2. data/.gitignore +27 -0
  3. data/Gemfile +34 -0
  4. data/Gemfile.lock +198 -0
  5. data/LICENSE +20 -0
  6. data/README.rdoc +17 -0
  7. data/Rakefile +56 -0
  8. data/VERSION +1 -0
  9. data/features/step_definitions/yogo_project_steps.rb +0 -0
  10. data/features/support/env.rb +1 -0
  11. data/features/yogo_project.feature +9 -0
  12. data/lib/datamapper/adapters/postgres.rb +9 -0
  13. data/lib/datamapper/adapters/sqlite.rb +9 -0
  14. data/lib/yogo-project.rb +2 -0
  15. data/lib/yogo/collection.rb +12 -0
  16. data/lib/yogo/collection/asset.rb +12 -0
  17. data/lib/yogo/collection/asset/model.rb +11 -0
  18. data/lib/yogo/collection/asset/model_configuration.rb +21 -0
  19. data/lib/yogo/collection/asset/model_properties.rb +47 -0
  20. data/lib/yogo/collection/base.rb +69 -0
  21. data/lib/yogo/collection/base/collection_repository.rb +21 -0
  22. data/lib/yogo/collection/base/model.rb +20 -0
  23. data/lib/yogo/collection/base/model_collection_context.rb +25 -0
  24. data/lib/yogo/collection/base/model_configuration.rb +34 -0
  25. data/lib/yogo/collection/data.rb +61 -0
  26. data/lib/yogo/collection/data/model.rb +72 -0
  27. data/lib/yogo/collection/data/model_configuration.rb +42 -0
  28. data/lib/yogo/collection/data/model_properties.rb +15 -0
  29. data/lib/yogo/collection/field_view.rb +26 -0
  30. data/lib/yogo/collection/form.rb +22 -0
  31. data/lib/yogo/collection/property.rb +127 -0
  32. data/lib/yogo/collection/static.rb +13 -0
  33. data/lib/yogo/collection/static/model_configuration.rb +31 -0
  34. data/lib/yogo/configuration.rb +9 -0
  35. data/lib/yogo/datamapper/model/common/properties.rb +16 -0
  36. data/lib/yogo/datamapper/model/configuration.rb +31 -0
  37. data/lib/yogo/datamapper/model/operations/add.rb +34 -0
  38. data/lib/yogo/datamapper/model/operations/clear.rb +29 -0
  39. data/lib/yogo/datamapper/model/stored/configuration.rb +25 -0
  40. data/lib/yogo/datamapper/repository_manager.rb +30 -0
  41. data/lib/yogo/datamapper/repository_manager/model.rb +40 -0
  42. data/lib/yogo/datamapper/repository_manager/resource.rb +124 -0
  43. data/lib/yogo/example/dynamic/project_full.rb +48 -0
  44. data/lib/yogo/example/dynamic/project_remix.rb +16 -0
  45. data/lib/yogo/example/voeis/managed/data_stream.rb +39 -0
  46. data/lib/yogo/example/voeis/managed/site.rb +51 -0
  47. data/lib/yogo/example/voeis/project.rb +57 -0
  48. data/lib/yogo/operation.rb +49 -0
  49. data/lib/yogo/project.rb +32 -0
  50. data/lib/yogo/property_ext.rb +7 -0
  51. data/spec/resource/.gitdir +0 -0
  52. data/spec/resource/text_file_asset.txt +1 -0
  53. data/spec/spec_helper.rb +49 -0
  54. data/spec/yogo/all_collection_data_models_spec.rb +34 -0
  55. data/spec/yogo/all_collection_managers_spec.rb +18 -0
  56. data/spec/yogo/all_collections_spec.rb +54 -0
  57. data/spec/yogo/all_data_collections_spec.rb +51 -0
  58. data/spec/yogo/asset_collection_spec.rb +28 -0
  59. data/spec/yogo/data_collection_spec.rb +16 -0
  60. data/yogo-project.gemspec +128 -0
  61. metadata +222 -0
@@ -0,0 +1,51 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
+
3
+ shared_examples_for "All Data Collections" do
4
+ it "should have schema items" do
5
+ @collection.should respond_to(:schema)
6
+ @collection.schema.should be_a_kind_of(::DataMapper::Collection)
7
+ end
8
+
9
+ describe "add schema items" do
10
+ before(:each) do
11
+ @source_collection = @manager.data_collections.create(:name => 'Source Collection')
12
+ @other_collection = @manager.data_collections.create(:name => 'Other Collection')
13
+ end
14
+
15
+ after(:each) do
16
+ @source_collection.destroy
17
+ @other_collection.destroy
18
+ @manager.data_collections.destroy
19
+ end
20
+
21
+ it "should add simple properties" do
22
+ @source_collection.scope do
23
+ original_prop_count = @source_collection.data_model.properties.size
24
+
25
+ @source_collection.schema.create(:type => Yogo::Collection::Property::String,
26
+ :name => "Title")
27
+ @source_collection.schema.create(:type => Yogo::Collection::Property::Integer,
28
+ :name => "Length")
29
+ @source_collection.schema.size.should == 2
30
+ lambda { @source_collection.update_model }.should_not raise_error
31
+
32
+ @source_collection.data_model.properties.size.should == original_prop_count+2
33
+ @source_collection.items.should be_empty
34
+
35
+ entry = @source_collection.items.new()
36
+ entry['Title'].should be_nil
37
+ entry['Length'].should be_nil
38
+
39
+ lambda { entry['Title'] = "Testing a String Property" }.should_not raise_error
40
+ lambda { entry['Length'] = 5 }.should_not raise_error
41
+
42
+ entry.save.should be_true
43
+
44
+ @source_collection.items.should_not be_empty
45
+ @source_collection.items.size.should == 1
46
+ end
47
+ end
48
+
49
+ it "should add relationship properties"
50
+ end
51
+ end
@@ -0,0 +1,28 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
+
3
+ describe "An Asset Collection" do
4
+ before(:each) do
5
+ @manager = Yogo::Project.create(:name => "A Test Project")
6
+ @collection = @manager.data_collections.create(:type => 'Yogo::Collection::Asset', :name => "CercalDB")
7
+ @collection = @manager.data_collections.first(@collection.id)
8
+ end
9
+
10
+ after(:each) do
11
+ @manager.data_collections.destroy
12
+ @manager.destroy
13
+ end
14
+
15
+ it_should_behave_like "All Collections"
16
+
17
+ it "should store a file" do
18
+ @collection.scope do
19
+ asset_file = File.open(File.join(SPEC_RES_DIR, 'text_file_asset.txt'))
20
+ asset = @collection.items.create()
21
+ lambda { asset.file = asset_file }.should_not raise_error
22
+ asset.save.should be_true
23
+ end
24
+ end
25
+
26
+ it "should retrieve a file"
27
+
28
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
+
3
+ describe "A Data Collection" do
4
+ before(:each) do
5
+ @manager = Yogo::Project.create(:name => "A Test Project")
6
+ @collection = @manager.data_collections.create(:type => 'Yogo::Collection::Data', :name => "CercalDB")
7
+ end
8
+
9
+ after(:each) do
10
+ @manager.data_collections.destroy
11
+ @manager.destroy
12
+ end
13
+
14
+ it_should_behave_like "All Collections"
15
+ it_should_behave_like "All Data Collections"
16
+ end
@@ -0,0 +1,128 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{yogo-project}
8
+ s.version = "0.3.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ryan Heimbuch"]
12
+ s.date = %q{2010-11-01}
13
+ s.description = %q{User configurable data layer for Yogo}
14
+ s.email = %q{rheimbuch@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "features/step_definitions/yogo_project_steps.rb",
29
+ "features/support/env.rb",
30
+ "features/yogo_project.feature",
31
+ "lib/datamapper/adapters/postgres.rb",
32
+ "lib/datamapper/adapters/sqlite.rb",
33
+ "lib/yogo-project.rb",
34
+ "lib/yogo/collection.rb",
35
+ "lib/yogo/collection/asset.rb",
36
+ "lib/yogo/collection/asset/model.rb",
37
+ "lib/yogo/collection/asset/model_configuration.rb",
38
+ "lib/yogo/collection/asset/model_properties.rb",
39
+ "lib/yogo/collection/base.rb",
40
+ "lib/yogo/collection/base/collection_repository.rb",
41
+ "lib/yogo/collection/base/model.rb",
42
+ "lib/yogo/collection/base/model_collection_context.rb",
43
+ "lib/yogo/collection/base/model_configuration.rb",
44
+ "lib/yogo/collection/data.rb",
45
+ "lib/yogo/collection/data/model.rb",
46
+ "lib/yogo/collection/data/model_configuration.rb",
47
+ "lib/yogo/collection/data/model_properties.rb",
48
+ "lib/yogo/collection/field_view.rb",
49
+ "lib/yogo/collection/form.rb",
50
+ "lib/yogo/collection/property.rb",
51
+ "lib/yogo/collection/static.rb",
52
+ "lib/yogo/collection/static/model_configuration.rb",
53
+ "lib/yogo/configuration.rb",
54
+ "lib/yogo/datamapper/model/common/properties.rb",
55
+ "lib/yogo/datamapper/model/configuration.rb",
56
+ "lib/yogo/datamapper/model/operations/add.rb",
57
+ "lib/yogo/datamapper/model/operations/clear.rb",
58
+ "lib/yogo/datamapper/model/stored/configuration.rb",
59
+ "lib/yogo/datamapper/repository_manager.rb",
60
+ "lib/yogo/datamapper/repository_manager/model.rb",
61
+ "lib/yogo/datamapper/repository_manager/resource.rb",
62
+ "lib/yogo/example/dynamic/project_full.rb",
63
+ "lib/yogo/example/dynamic/project_remix.rb",
64
+ "lib/yogo/example/voeis/managed/data_stream.rb",
65
+ "lib/yogo/example/voeis/managed/site.rb",
66
+ "lib/yogo/example/voeis/project.rb",
67
+ "lib/yogo/operation.rb",
68
+ "lib/yogo/project.rb",
69
+ "lib/yogo/property_ext.rb",
70
+ "spec/resource/.gitdir",
71
+ "spec/resource/text_file_asset.txt",
72
+ "spec/spec_helper.rb",
73
+ "spec/tmp/.gitdir",
74
+ "spec/yogo/all_collection_data_models_spec.rb",
75
+ "spec/yogo/all_collection_managers_spec.rb",
76
+ "spec/yogo/all_collections_spec.rb",
77
+ "spec/yogo/all_data_collections_spec.rb",
78
+ "spec/yogo/asset_collection_spec.rb",
79
+ "spec/yogo/data_collection_spec.rb",
80
+ "yogo-project.gemspec"
81
+ ]
82
+ s.homepage = %q{http://github.com/yogo/yogo_project}
83
+ s.rdoc_options = ["--charset=UTF-8"]
84
+ s.require_paths = ["lib"]
85
+ s.rubygems_version = %q{1.3.7}
86
+ s.summary = %q{User configurable data layer for Yogo}
87
+ s.test_files = [
88
+ "spec/spec_helper.rb",
89
+ "spec/yogo/all_collection_data_models_spec.rb",
90
+ "spec/yogo/all_collection_managers_spec.rb",
91
+ "spec/yogo/all_collections_spec.rb",
92
+ "spec/yogo/all_data_collections_spec.rb",
93
+ "spec/yogo/asset_collection_spec.rb",
94
+ "spec/yogo/data_collection_spec.rb"
95
+ ]
96
+
97
+ if s.respond_to? :specification_version then
98
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
99
+ s.specification_version = 3
100
+
101
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
102
+ s.add_runtime_dependency(%q<data_mapper>, [">= 0"])
103
+ s.add_runtime_dependency(%q<dm-is-remixable>, [">= 0"])
104
+ s.add_runtime_dependency(%q<dm-postgres-adapter>, [">= 0"])
105
+ s.add_runtime_dependency(%q<dm-sqlite-adapter>, [">= 0"])
106
+ s.add_runtime_dependency(%q<carrierwave>, [">= 0"])
107
+ s.add_runtime_dependency(%q<configatron>, [">= 0"])
108
+ s.add_runtime_dependency(%q<facets>, [">= 0"])
109
+ else
110
+ s.add_dependency(%q<data_mapper>, [">= 0"])
111
+ s.add_dependency(%q<dm-is-remixable>, [">= 0"])
112
+ s.add_dependency(%q<dm-postgres-adapter>, [">= 0"])
113
+ s.add_dependency(%q<dm-sqlite-adapter>, [">= 0"])
114
+ s.add_dependency(%q<carrierwave>, [">= 0"])
115
+ s.add_dependency(%q<configatron>, [">= 0"])
116
+ s.add_dependency(%q<facets>, [">= 0"])
117
+ end
118
+ else
119
+ s.add_dependency(%q<data_mapper>, [">= 0"])
120
+ s.add_dependency(%q<dm-is-remixable>, [">= 0"])
121
+ s.add_dependency(%q<dm-postgres-adapter>, [">= 0"])
122
+ s.add_dependency(%q<dm-sqlite-adapter>, [">= 0"])
123
+ s.add_dependency(%q<carrierwave>, [">= 0"])
124
+ s.add_dependency(%q<configatron>, [">= 0"])
125
+ s.add_dependency(%q<facets>, [">= 0"])
126
+ end
127
+ end
128
+
metadata ADDED
@@ -0,0 +1,222 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yogo-project
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 3
8
+ - 2
9
+ version: 0.3.2
10
+ platform: ruby
11
+ authors:
12
+ - Ryan Heimbuch
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-11-01 00:00:00 -06:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: data_mapper
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ prerelease: false
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: dm-is-remixable
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: dm-postgres-adapter
48
+ requirement: &id003 !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: *id003
59
+ - !ruby/object:Gem::Dependency
60
+ name: dm-sqlite-adapter
61
+ requirement: &id004 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: *id004
72
+ - !ruby/object:Gem::Dependency
73
+ name: carrierwave
74
+ requirement: &id005 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: *id005
85
+ - !ruby/object:Gem::Dependency
86
+ name: configatron
87
+ requirement: &id006 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ type: :runtime
96
+ prerelease: false
97
+ version_requirements: *id006
98
+ - !ruby/object:Gem::Dependency
99
+ name: facets
100
+ requirement: &id007 !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ type: :runtime
109
+ prerelease: false
110
+ version_requirements: *id007
111
+ description: User configurable data layer for Yogo
112
+ email: rheimbuch@gmail.com
113
+ executables: []
114
+
115
+ extensions: []
116
+
117
+ extra_rdoc_files:
118
+ - LICENSE
119
+ - README.rdoc
120
+ files:
121
+ - .document
122
+ - .gitignore
123
+ - Gemfile
124
+ - Gemfile.lock
125
+ - LICENSE
126
+ - README.rdoc
127
+ - Rakefile
128
+ - VERSION
129
+ - features/step_definitions/yogo_project_steps.rb
130
+ - features/support/env.rb
131
+ - features/yogo_project.feature
132
+ - lib/datamapper/adapters/postgres.rb
133
+ - lib/datamapper/adapters/sqlite.rb
134
+ - lib/yogo-project.rb
135
+ - lib/yogo/collection.rb
136
+ - lib/yogo/collection/asset.rb
137
+ - lib/yogo/collection/asset/model.rb
138
+ - lib/yogo/collection/asset/model_configuration.rb
139
+ - lib/yogo/collection/asset/model_properties.rb
140
+ - lib/yogo/collection/base.rb
141
+ - lib/yogo/collection/base/collection_repository.rb
142
+ - lib/yogo/collection/base/model.rb
143
+ - lib/yogo/collection/base/model_collection_context.rb
144
+ - lib/yogo/collection/base/model_configuration.rb
145
+ - lib/yogo/collection/data.rb
146
+ - lib/yogo/collection/data/model.rb
147
+ - lib/yogo/collection/data/model_configuration.rb
148
+ - lib/yogo/collection/data/model_properties.rb
149
+ - lib/yogo/collection/field_view.rb
150
+ - lib/yogo/collection/form.rb
151
+ - lib/yogo/collection/property.rb
152
+ - lib/yogo/collection/static.rb
153
+ - lib/yogo/collection/static/model_configuration.rb
154
+ - lib/yogo/configuration.rb
155
+ - lib/yogo/datamapper/model/common/properties.rb
156
+ - lib/yogo/datamapper/model/configuration.rb
157
+ - lib/yogo/datamapper/model/operations/add.rb
158
+ - lib/yogo/datamapper/model/operations/clear.rb
159
+ - lib/yogo/datamapper/model/stored/configuration.rb
160
+ - lib/yogo/datamapper/repository_manager.rb
161
+ - lib/yogo/datamapper/repository_manager/model.rb
162
+ - lib/yogo/datamapper/repository_manager/resource.rb
163
+ - lib/yogo/example/dynamic/project_full.rb
164
+ - lib/yogo/example/dynamic/project_remix.rb
165
+ - lib/yogo/example/voeis/managed/data_stream.rb
166
+ - lib/yogo/example/voeis/managed/site.rb
167
+ - lib/yogo/example/voeis/project.rb
168
+ - lib/yogo/operation.rb
169
+ - lib/yogo/project.rb
170
+ - lib/yogo/property_ext.rb
171
+ - spec/resource/.gitdir
172
+ - spec/resource/text_file_asset.txt
173
+ - spec/spec_helper.rb
174
+ - spec/tmp/.gitdir
175
+ - spec/yogo/all_collection_data_models_spec.rb
176
+ - spec/yogo/all_collection_managers_spec.rb
177
+ - spec/yogo/all_collections_spec.rb
178
+ - spec/yogo/all_data_collections_spec.rb
179
+ - spec/yogo/asset_collection_spec.rb
180
+ - spec/yogo/data_collection_spec.rb
181
+ - yogo-project.gemspec
182
+ has_rdoc: true
183
+ homepage: http://github.com/yogo/yogo_project
184
+ licenses: []
185
+
186
+ post_install_message:
187
+ rdoc_options:
188
+ - --charset=UTF-8
189
+ require_paths:
190
+ - lib
191
+ required_ruby_version: !ruby/object:Gem::Requirement
192
+ none: false
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ hash: -2719393632946930070
197
+ segments:
198
+ - 0
199
+ version: "0"
200
+ required_rubygems_version: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ segments:
206
+ - 0
207
+ version: "0"
208
+ requirements: []
209
+
210
+ rubyforge_project:
211
+ rubygems_version: 1.3.7
212
+ signing_key:
213
+ specification_version: 3
214
+ summary: User configurable data layer for Yogo
215
+ test_files:
216
+ - spec/spec_helper.rb
217
+ - spec/yogo/all_collection_data_models_spec.rb
218
+ - spec/yogo/all_collection_managers_spec.rb
219
+ - spec/yogo/all_collections_spec.rb
220
+ - spec/yogo/all_data_collections_spec.rb
221
+ - spec/yogo/asset_collection_spec.rb
222
+ - spec/yogo/data_collection_spec.rb