lotus-model 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +6 -0
  4. data/.yardopts +5 -0
  5. data/EXAMPLE.md +217 -0
  6. data/Gemfile +14 -2
  7. data/README.md +303 -3
  8. data/Rakefile +17 -1
  9. data/lib/lotus-model.rb +1 -0
  10. data/lib/lotus/entity.rb +157 -0
  11. data/lib/lotus/model.rb +23 -2
  12. data/lib/lotus/model/adapters/abstract.rb +167 -0
  13. data/lib/lotus/model/adapters/implementation.rb +111 -0
  14. data/lib/lotus/model/adapters/memory/collection.rb +132 -0
  15. data/lib/lotus/model/adapters/memory/command.rb +90 -0
  16. data/lib/lotus/model/adapters/memory/query.rb +457 -0
  17. data/lib/lotus/model/adapters/memory_adapter.rb +149 -0
  18. data/lib/lotus/model/adapters/sql/collection.rb +209 -0
  19. data/lib/lotus/model/adapters/sql/command.rb +67 -0
  20. data/lib/lotus/model/adapters/sql/query.rb +615 -0
  21. data/lib/lotus/model/adapters/sql_adapter.rb +154 -0
  22. data/lib/lotus/model/mapper.rb +101 -0
  23. data/lib/lotus/model/mapping.rb +23 -0
  24. data/lib/lotus/model/mapping/coercer.rb +80 -0
  25. data/lib/lotus/model/mapping/collection.rb +336 -0
  26. data/lib/lotus/model/version.rb +4 -1
  27. data/lib/lotus/repository.rb +620 -0
  28. data/lotus-model.gemspec +15 -11
  29. data/test/entity_test.rb +126 -0
  30. data/test/fixtures.rb +81 -0
  31. data/test/model/adapters/abstract_test.rb +75 -0
  32. data/test/model/adapters/implementation_test.rb +22 -0
  33. data/test/model/adapters/memory/query_test.rb +91 -0
  34. data/test/model/adapters/memory_adapter_test.rb +1044 -0
  35. data/test/model/adapters/sql/query_test.rb +121 -0
  36. data/test/model/adapters/sql_adapter_test.rb +1078 -0
  37. data/test/model/mapper_test.rb +94 -0
  38. data/test/model/mapping/coercer_test.rb +27 -0
  39. data/test/model/mapping/collection_test.rb +82 -0
  40. data/test/repository_test.rb +283 -0
  41. data/test/test_helper.rb +30 -0
  42. data/test/version_test.rb +7 -0
  43. metadata +109 -11
@@ -0,0 +1,30 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ if ENV['COVERAGE'] == 'true'
5
+ require 'simplecov'
6
+ require 'coveralls'
7
+
8
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
9
+ SimpleCov::Formatter::HTMLFormatter,
10
+ Coveralls::SimpleCov::Formatter
11
+ ]
12
+
13
+ SimpleCov.start do
14
+ command_name 'test'
15
+ add_filter 'test'
16
+ end
17
+ end
18
+
19
+ require 'minitest/autorun'
20
+ $:.unshift 'lib'
21
+ require 'lotus-model'
22
+ require 'lotus/model/adapters/memory_adapter'
23
+ require 'lotus/model/adapters/sql_adapter'
24
+
25
+ db = Pathname.new(__dir__).join('../tmp/test.db')
26
+ db.dirname.mkpath # create directory if not exist
27
+ db.delete if db.exist? # delete file if exist
28
+
29
+ SQLITE_CONNECTION_STRING = "sqlite://#{ db }"
30
+ require 'fixtures'
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ describe Lotus::Model::VERSION do
4
+ it 'returns current version' do
5
+ Lotus::Model::VERSION.must_equal '0.1.0'
6
+ end
7
+ end
metadata CHANGED
@@ -1,15 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-01 00:00:00.000000000 Z
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lotus-utils
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ - - ">"
21
+ - !ruby/object:Gem::Version
22
+ version: 0.1.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.1'
30
+ - - ">"
31
+ - !ruby/object:Gem::Version
32
+ version: 0.1.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: sequel
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '4.9'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '4.9'
13
47
  - !ruby/object:Gem::Dependency
14
48
  name: bundler
15
49
  requirement: !ruby/object:Gem::Requirement
@@ -24,21 +58,36 @@ dependencies:
24
58
  - - "~>"
25
59
  - !ruby/object:Gem::Version
26
60
  version: '1.5'
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '5'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '5'
27
75
  - !ruby/object:Gem::Dependency
28
76
  name: rake
29
77
  requirement: !ruby/object:Gem::Requirement
30
78
  requirements:
31
- - - ">="
79
+ - - "~>"
32
80
  - !ruby/object:Gem::Version
33
- version: '0'
81
+ version: '10'
34
82
  type: :development
35
83
  prerelease: false
36
84
  version_requirements: !ruby/object:Gem::Requirement
37
85
  requirements:
38
- - - ">="
86
+ - - "~>"
39
87
  - !ruby/object:Gem::Version
40
- version: '0'
41
- description: Model layer for Lotus
88
+ version: '10'
89
+ description: A persistence framework with entities, repositories, data mapper and
90
+ query objects
42
91
  email:
43
92
  - me@lucaguidi.com
44
93
  executables: []
@@ -46,14 +95,48 @@ extensions: []
46
95
  extra_rdoc_files: []
47
96
  files:
48
97
  - ".gitignore"
98
+ - ".travis.yml"
99
+ - ".yardopts"
100
+ - EXAMPLE.md
49
101
  - Gemfile
50
102
  - LICENSE.txt
51
103
  - README.md
52
104
  - Rakefile
105
+ - lib/lotus-model.rb
106
+ - lib/lotus/entity.rb
53
107
  - lib/lotus/model.rb
108
+ - lib/lotus/model/adapters/abstract.rb
109
+ - lib/lotus/model/adapters/implementation.rb
110
+ - lib/lotus/model/adapters/memory/collection.rb
111
+ - lib/lotus/model/adapters/memory/command.rb
112
+ - lib/lotus/model/adapters/memory/query.rb
113
+ - lib/lotus/model/adapters/memory_adapter.rb
114
+ - lib/lotus/model/adapters/sql/collection.rb
115
+ - lib/lotus/model/adapters/sql/command.rb
116
+ - lib/lotus/model/adapters/sql/query.rb
117
+ - lib/lotus/model/adapters/sql_adapter.rb
118
+ - lib/lotus/model/mapper.rb
119
+ - lib/lotus/model/mapping.rb
120
+ - lib/lotus/model/mapping/coercer.rb
121
+ - lib/lotus/model/mapping/collection.rb
54
122
  - lib/lotus/model/version.rb
123
+ - lib/lotus/repository.rb
55
124
  - lotus-model.gemspec
56
- homepage: ''
125
+ - test/entity_test.rb
126
+ - test/fixtures.rb
127
+ - test/model/adapters/abstract_test.rb
128
+ - test/model/adapters/implementation_test.rb
129
+ - test/model/adapters/memory/query_test.rb
130
+ - test/model/adapters/memory_adapter_test.rb
131
+ - test/model/adapters/sql/query_test.rb
132
+ - test/model/adapters/sql_adapter_test.rb
133
+ - test/model/mapper_test.rb
134
+ - test/model/mapping/coercer_test.rb
135
+ - test/model/mapping/collection_test.rb
136
+ - test/repository_test.rb
137
+ - test/test_helper.rb
138
+ - test/version_test.rb
139
+ homepage: http://lotusrb.org
57
140
  licenses:
58
141
  - MIT
59
142
  metadata: {}
@@ -73,8 +156,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
156
  version: '0'
74
157
  requirements: []
75
158
  rubyforge_project:
76
- rubygems_version: 2.2.0
159
+ rubygems_version: 2.2.2
77
160
  signing_key:
78
161
  specification_version: 4
79
- summary: Model layer for Lotus
80
- test_files: []
162
+ summary: A persistence layer for Lotus
163
+ test_files:
164
+ - test/entity_test.rb
165
+ - test/fixtures.rb
166
+ - test/model/adapters/abstract_test.rb
167
+ - test/model/adapters/implementation_test.rb
168
+ - test/model/adapters/memory/query_test.rb
169
+ - test/model/adapters/memory_adapter_test.rb
170
+ - test/model/adapters/sql/query_test.rb
171
+ - test/model/adapters/sql_adapter_test.rb
172
+ - test/model/mapper_test.rb
173
+ - test/model/mapping/coercer_test.rb
174
+ - test/model/mapping/collection_test.rb
175
+ - test/repository_test.rb
176
+ - test/test_helper.rb
177
+ - test/version_test.rb
178
+ has_rdoc: