hanami-model 0.0.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +145 -0
  3. data/EXAMPLE.md +212 -0
  4. data/LICENSE.md +22 -0
  5. data/README.md +600 -7
  6. data/hanami-model.gemspec +17 -12
  7. data/lib/hanami-model.rb +1 -0
  8. data/lib/hanami/entity.rb +298 -0
  9. data/lib/hanami/entity/dirty_tracking.rb +74 -0
  10. data/lib/hanami/model.rb +204 -2
  11. data/lib/hanami/model/adapters/abstract.rb +281 -0
  12. data/lib/hanami/model/adapters/file_system_adapter.rb +288 -0
  13. data/lib/hanami/model/adapters/implementation.rb +111 -0
  14. data/lib/hanami/model/adapters/memory/collection.rb +132 -0
  15. data/lib/hanami/model/adapters/memory/command.rb +113 -0
  16. data/lib/hanami/model/adapters/memory/query.rb +653 -0
  17. data/lib/hanami/model/adapters/memory_adapter.rb +179 -0
  18. data/lib/hanami/model/adapters/null_adapter.rb +24 -0
  19. data/lib/hanami/model/adapters/sql/collection.rb +287 -0
  20. data/lib/hanami/model/adapters/sql/command.rb +73 -0
  21. data/lib/hanami/model/adapters/sql/console.rb +33 -0
  22. data/lib/hanami/model/adapters/sql/consoles/mysql.rb +49 -0
  23. data/lib/hanami/model/adapters/sql/consoles/postgresql.rb +48 -0
  24. data/lib/hanami/model/adapters/sql/consoles/sqlite.rb +26 -0
  25. data/lib/hanami/model/adapters/sql/query.rb +788 -0
  26. data/lib/hanami/model/adapters/sql_adapter.rb +296 -0
  27. data/lib/hanami/model/coercer.rb +74 -0
  28. data/lib/hanami/model/config/adapter.rb +116 -0
  29. data/lib/hanami/model/config/mapper.rb +45 -0
  30. data/lib/hanami/model/configuration.rb +275 -0
  31. data/lib/hanami/model/error.rb +7 -0
  32. data/lib/hanami/model/mapper.rb +124 -0
  33. data/lib/hanami/model/mapping.rb +48 -0
  34. data/lib/hanami/model/mapping/attribute.rb +85 -0
  35. data/lib/hanami/model/mapping/coercers.rb +314 -0
  36. data/lib/hanami/model/mapping/collection.rb +490 -0
  37. data/lib/hanami/model/mapping/collection_coercer.rb +79 -0
  38. data/lib/hanami/model/migrator.rb +324 -0
  39. data/lib/hanami/model/migrator/adapter.rb +170 -0
  40. data/lib/hanami/model/migrator/connection.rb +133 -0
  41. data/lib/hanami/model/migrator/mysql_adapter.rb +72 -0
  42. data/lib/hanami/model/migrator/postgres_adapter.rb +119 -0
  43. data/lib/hanami/model/migrator/sqlite_adapter.rb +110 -0
  44. data/lib/hanami/model/version.rb +4 -1
  45. data/lib/hanami/repository.rb +872 -0
  46. metadata +100 -16
  47. data/.gitignore +0 -9
  48. data/Gemfile +0 -4
  49. data/Rakefile +0 -2
  50. data/bin/console +0 -14
  51. data/bin/setup +0 -8
metadata CHANGED
@@ -1,61 +1,144 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
+ - Trung Lê
9
+ - Alfonso Uceda
8
10
  autorequire:
9
- bindir: exe
11
+ bindir: bin
10
12
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
13
+ date: 2016-01-22 00:00:00.000000000 Z
12
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hanami-utils
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.7'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0.7'
29
+ - !ruby/object:Gem::Dependency
30
+ name: sequel
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '4.9'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '4.9'
13
43
  - !ruby/object:Gem::Dependency
14
44
  name: bundler
15
45
  requirement: !ruby/object:Gem::Requirement
16
46
  requirements:
17
47
  - - "~>"
18
48
  - !ruby/object:Gem::Version
19
- version: '1.11'
49
+ version: '1.6'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '1.6'
57
+ - !ruby/object:Gem::Dependency
58
+ name: minitest
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '5'
20
64
  type: :development
21
65
  prerelease: false
22
66
  version_requirements: !ruby/object:Gem::Requirement
23
67
  requirements:
24
68
  - - "~>"
25
69
  - !ruby/object:Gem::Version
26
- version: '1.11'
70
+ version: '5'
27
71
  - !ruby/object:Gem::Dependency
28
72
  name: rake
29
73
  requirement: !ruby/object:Gem::Requirement
30
74
  requirements:
31
75
  - - "~>"
32
76
  - !ruby/object:Gem::Version
33
- version: '10.0'
77
+ version: '10'
34
78
  type: :development
35
79
  prerelease: false
36
80
  version_requirements: !ruby/object:Gem::Requirement
37
81
  requirements:
38
82
  - - "~>"
39
83
  - !ruby/object:Gem::Version
40
- version: '10.0'
41
- description: Hanami is a web framework for Ruby
84
+ version: '10'
85
+ description: A persistence framework with entities, repositories, data mapper and
86
+ query objects
42
87
  email:
43
88
  - me@lucaguidi.com
89
+ - trung.le@ruby-journal.com
90
+ - uceda73@gmail.com
44
91
  executables: []
45
92
  extensions: []
46
93
  extra_rdoc_files: []
47
94
  files:
48
- - ".gitignore"
49
- - Gemfile
95
+ - CHANGELOG.md
96
+ - EXAMPLE.md
97
+ - LICENSE.md
50
98
  - README.md
51
- - Rakefile
52
- - bin/console
53
- - bin/setup
54
99
  - hanami-model.gemspec
100
+ - lib/hanami-model.rb
101
+ - lib/hanami/entity.rb
102
+ - lib/hanami/entity/dirty_tracking.rb
55
103
  - lib/hanami/model.rb
104
+ - lib/hanami/model/adapters/abstract.rb
105
+ - lib/hanami/model/adapters/file_system_adapter.rb
106
+ - lib/hanami/model/adapters/implementation.rb
107
+ - lib/hanami/model/adapters/memory/collection.rb
108
+ - lib/hanami/model/adapters/memory/command.rb
109
+ - lib/hanami/model/adapters/memory/query.rb
110
+ - lib/hanami/model/adapters/memory_adapter.rb
111
+ - lib/hanami/model/adapters/null_adapter.rb
112
+ - lib/hanami/model/adapters/sql/collection.rb
113
+ - lib/hanami/model/adapters/sql/command.rb
114
+ - lib/hanami/model/adapters/sql/console.rb
115
+ - lib/hanami/model/adapters/sql/consoles/mysql.rb
116
+ - lib/hanami/model/adapters/sql/consoles/postgresql.rb
117
+ - lib/hanami/model/adapters/sql/consoles/sqlite.rb
118
+ - lib/hanami/model/adapters/sql/query.rb
119
+ - lib/hanami/model/adapters/sql_adapter.rb
120
+ - lib/hanami/model/coercer.rb
121
+ - lib/hanami/model/config/adapter.rb
122
+ - lib/hanami/model/config/mapper.rb
123
+ - lib/hanami/model/configuration.rb
124
+ - lib/hanami/model/error.rb
125
+ - lib/hanami/model/mapper.rb
126
+ - lib/hanami/model/mapping.rb
127
+ - lib/hanami/model/mapping/attribute.rb
128
+ - lib/hanami/model/mapping/coercers.rb
129
+ - lib/hanami/model/mapping/collection.rb
130
+ - lib/hanami/model/mapping/collection_coercer.rb
131
+ - lib/hanami/model/migrator.rb
132
+ - lib/hanami/model/migrator/adapter.rb
133
+ - lib/hanami/model/migrator/connection.rb
134
+ - lib/hanami/model/migrator/mysql_adapter.rb
135
+ - lib/hanami/model/migrator/postgres_adapter.rb
136
+ - lib/hanami/model/migrator/sqlite_adapter.rb
56
137
  - lib/hanami/model/version.rb
138
+ - lib/hanami/repository.rb
57
139
  homepage: http://hanamirb.org
58
- licenses: []
140
+ licenses:
141
+ - MIT
59
142
  metadata: {}
60
143
  post_install_message:
61
144
  rdoc_options: []
@@ -65,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
148
  requirements:
66
149
  - - ">="
67
150
  - !ruby/object:Gem::Version
68
- version: '0'
151
+ version: 2.0.0
69
152
  required_rubygems_version: !ruby/object:Gem::Requirement
70
153
  requirements:
71
154
  - - ">="
@@ -76,5 +159,6 @@ rubyforge_project:
76
159
  rubygems_version: 2.5.1
77
160
  signing_key:
78
161
  specification_version: 4
79
- summary: The web, with simplicity
162
+ summary: A persistence layer for Hanami
80
163
  test_files: []
164
+ has_rdoc:
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in hanami-model.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "hanami/model"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here