relaxo-model 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 126822058c0a3d4105b8c908ef9b1e5199bd40e9d5d81020a98db4e9ae8e583b
4
- data.tar.gz: b8c9a8ebfb4dd13e34d5f3c2145a65ebf87a778dfd7fa1d7e77b520bfe26857e
3
+ metadata.gz: 76ee0fe261863b66948d14dbb488758149f2e5f13fcbd422f7734bd36997f2f4
4
+ data.tar.gz: 7c03bdd20c4075b211be89ab7ae531702450c54e066bce7eecb966d64eccbbb5
5
5
  SHA512:
6
- metadata.gz: b6be3ce5ffa697b9bae243d57df54ad0054114ff4b30e3f450f81603010bc7590992c8651a49d8746d889b30cc40849866d00db43217d8bf2f047b81ce89a912
7
- data.tar.gz: 02af703b22d3da40fae898725c47aad4ed1a1778ab49afb413797fe9679bcf797a6ffd0476a5589fc953d1d28c875f8b964247f3bd469ce9d4fb9b55f70d89ea
6
+ metadata.gz: f693733a825e2e4571b048ac4af7396c5268ee6fb86467518c040cd44b673a7c2f782f4b6733eb2002186432906af5297e92af85585206c3357b6756ec2c3f9c
7
+ data.tar.gz: af576f5cbe754244eaf31a1f9300fa9f3b52aeeec4dd41b6912f2665028c49ee5b8550d5c571c956d7a0ea099b040ed51ba88fa2c212f33c9050d36d242ec3bb
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Relaxo
22
22
  module Model
23
- VERSION = "0.17.1"
23
+ VERSION = "0.17.2"
24
24
  end
25
25
  end
@@ -29,7 +29,7 @@ class Aggregate
29
29
  end
30
30
 
31
31
  RSpec.describe Relaxo::Model::Document do
32
- let(:database_path) {File.join(__dir__, 'test')}
32
+ let(:database_path) {'tmp/attributes'}
33
33
  let(:database) {Relaxo.connect(database_path)}
34
34
 
35
35
  let(:document_path) {'test/document.json'}
@@ -72,7 +72,7 @@ class User
72
72
  end
73
73
 
74
74
  RSpec.shared_context "model" do
75
- let(:database_path) {File.join(__dir__, 'test')}
75
+ let(:database_path) {'tmp/model'}
76
76
  let(:database) {Relaxo.connect(database_path)}
77
77
 
78
78
  let(:document_path) {'test/document.json'}
metadata CHANGED
@@ -1,45 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaxo-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-28 00:00:00.000000000 Z
11
+ date: 2020-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: relaxo
14
+ name: msgpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: msgpack
28
+ name: relaxo
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '1.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
- name: covered
42
+ name: bake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: bake-bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,21 +67,35 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec
70
+ name: bake-modernize
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 3.4.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
81
88
  - !ruby/object:Gem::Version
82
- version: 3.4.0
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
- name: rake
98
+ name: covered
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - ">="
@@ -94,21 +108,26 @@ dependencies:
94
108
  - - ">="
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0'
97
- description: "\t\tRelaxo Model provides a framework for business logic on top of\n\t\tRelaxo.
98
- While it supports some traditional ORM style patterns, it is\n\t\tprimary focus
99
- is to model business processes and logic.\n"
100
- email:
101
- - samuel.williams@oriontransfer.co.nz
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.4'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.4'
125
+ description:
126
+ email:
102
127
  executables: []
103
128
  extensions: []
104
129
  extra_rdoc_files: []
105
130
  files:
106
- - ".gitignore"
107
- - ".rspec"
108
- - ".travis.yml"
109
- - Gemfile
110
- - README.md
111
- - Rakefile
112
131
  - lib/relaxo/model.rb
113
132
  - lib/relaxo/model/base.rb
114
133
  - lib/relaxo/model/component.rb
@@ -123,7 +142,6 @@ files:
123
142
  - lib/relaxo/model/properties/uuid.rb
124
143
  - lib/relaxo/model/recordset.rb
125
144
  - lib/relaxo/model/version.rb
126
- - relaxo-model.gemspec
127
145
  - spec/relaxo/model/attribute_spec.rb
128
146
  - spec/relaxo/model/document_spec.rb
129
147
  - spec/relaxo/model/model_context.rb
@@ -152,11 +170,5 @@ requirements: []
152
170
  rubygems_version: 3.1.2
153
171
  signing_key:
154
172
  specification_version: 4
155
- summary: A model layer for CouchDB with minimal global state.
156
- test_files:
157
- - spec/relaxo/model/attribute_spec.rb
158
- - spec/relaxo/model/document_spec.rb
159
- - spec/relaxo/model/model_context.rb
160
- - spec/relaxo/model/properties/bcrypt_spec.rb
161
- - spec/relaxo/model/recordset_spec.rb
162
- - spec/spec_helper.rb
173
+ summary: A model layer for the relaxo document database.
174
+ test_files: []
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- Gemfile.lock
11
- .rspec_status
12
- .covered.db
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --format documentation
2
- --backtrace
3
- --warnings
4
- --require spec_helper
@@ -1,20 +0,0 @@
1
- language: ruby
2
- dist: xenial
3
- cache: bundler
4
-
5
- matrix:
6
- include:
7
- - rvm: 2.4
8
- - rvm: 2.5
9
- - rvm: 2.6
10
- - rvm: 2.6
11
- env: COVERAGE=PartialSummary,Coveralls
12
- - rvm: truffleruby
13
- - rvm: ruby-head
14
- - rvm: 2.6
15
- os: osx
16
- allow_failures:
17
- - rvm: truffleruby
18
- - rvm: ruby-head
19
- - rvm: jruby-head
20
- - rvm: truffleruby
data/Gemfile DELETED
@@ -1,11 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in relaxo-model.gemspec
4
- gemspec
5
-
6
- gem 'rugged', git: 'https://github.com/libgit2/rugged.git', submodules: true
7
-
8
- group :development do
9
- gem "pry"
10
- gem "bcrypt"
11
- end
data/README.md DELETED
@@ -1,119 +0,0 @@
1
- # Relaxo Model
2
-
3
- Relaxo Model provides a framework for business logic on top of Relaxo, a document data store built on top of git. While it supports some traditional relational style patterns, it is primary focus is to model business processes and logic at the document level.
4
-
5
- [![Build Status](https://secure.travis-ci.org/ioquatix/relaxo-model.svg)](http://travis-ci.org/ioquatix/relaxo-model)
6
- [![Code Climate](https://codeclimate.com/github/ioquatix/relaxo-model.svg)](https://codeclimate.com/github/ioquatix/relaxo-model)
7
- [![Coverage Status](https://coveralls.io/repos/ioquatix/relaxo-model/badge.svg)](https://coveralls.io/r/ioquatix/relaxo-model)
8
-
9
- ## Basic Usage
10
-
11
- Here is a simple example of a traditional ORM style model:
12
-
13
- ```ruby
14
- require 'relaxo/model'
15
-
16
- database = Relaxo.connect("test")
17
-
18
- trees = [
19
- {:name => 'Hinoki', :planted => Date.parse("2013/11/17")},
20
- {:name => 'Keyaki', :planted => Date.parse("2016/9/24")}
21
- ]
22
-
23
- class Tree
24
- include Relaxo::Model
25
-
26
- property :id, UUID
27
- property :name
28
- property :planted, Attribute[Date]
29
-
30
- view :all, [:type], index: [:id]
31
- end
32
-
33
- database.commit(message: "Create trees") do |changeset|
34
- trees.each do |tree|
35
- Tree.insert(changeset, tree)
36
- end
37
- end
38
-
39
- database.current do |dataset|
40
- Tree.all(dataset).each do |tree|
41
- puts "A #{tree.name} was planted on #{tree.planted.to_s}."
42
-
43
- # Expected output:
44
- # A Hinoki was planted on 2013-11-17.
45
- # A Keyaki was planted on 2016-09-24.
46
- end
47
- end
48
- ```
49
-
50
- ### Non-UUID Primary Key
51
-
52
- ```ruby
53
- #!/usr/bin/env ruby
54
-
55
- gem 'relaxo'
56
-
57
- require 'relaxo/model'
58
-
59
- database = Relaxo.connect("test")
60
-
61
- trees = [
62
- {:name => 'Hinoki', :planted => Date.parse("2013/11/17")},
63
- {:name => 'Keyaki', :planted => Date.parse("2016/9/24")}
64
- ]
65
-
66
- class Tree
67
- include Relaxo::Model
68
-
69
- property :name
70
- property :planted, Attribute[Date]
71
-
72
- view :all, [:type], index: [:name]
73
- end
74
-
75
- database.commit(message: "Create trees") do |changeset|
76
- trees.each do |tree|
77
- Tree.insert(changeset, tree)
78
- end
79
- end
80
-
81
- database.current do |dataset|
82
- trees.each do |tree|
83
- object = Tree.fetch_all(dataset, name: tree[:name])
84
- puts object
85
- end
86
- end
87
- ```
88
-
89
- ## Contributing
90
-
91
- 1. Fork it
92
- 2. Create your feature branch (`git checkout -b my-new-feature`)
93
- 3. Commit your changes (`git commit -am 'Add some feature'`)
94
- 4. Push to the branch (`git push origin my-new-feature`)
95
- 5. Create new Pull Request
96
-
97
- ## License
98
-
99
- Released under the MIT license.
100
-
101
- Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
102
-
103
- Permission is hereby granted, free of charge, to any person obtaining a copy
104
- of this software and associated documentation files (the "Software"), to deal
105
- in the Software without restriction, including without limitation the rights
106
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
107
- copies of the Software, and to permit persons to whom the Software is
108
- furnished to do so, subject to the following conditions:
109
-
110
- The above copyright notice and this permission notice shall be included in
111
- all copies or substantial portions of the Software.
112
-
113
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
114
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
115
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
116
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
117
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
118
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
119
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- # For RSpec
5
- RSpec::Core::RakeTask.new(:spec)
6
-
7
- task :console do
8
- require 'pry'
9
-
10
- require_relative 'lib/relaxo/model'
11
-
12
- DB = Relaxo.connect(File.join(__dir__, 'testdb'))
13
-
14
- Pry.start
15
- end
16
-
17
- task :default => :spec
@@ -1,30 +0,0 @@
1
-
2
- require_relative 'lib/relaxo/model/version'
3
-
4
- Gem::Specification.new do |spec|
5
- spec.name = "relaxo-model"
6
- spec.version = Relaxo::Model::VERSION
7
- spec.authors = ["Samuel Williams"]
8
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
9
- spec.description = <<-EOF
10
- Relaxo Model provides a framework for business logic on top of
11
- Relaxo. While it supports some traditional ORM style patterns, it is
12
- primary focus is to model business processes and logic.
13
- EOF
14
- spec.summary = "A model layer for CouchDB with minimal global state."
15
- spec.homepage = "http://www.codeotaku.com/projects/relaxo/model"
16
- spec.license = "MIT"
17
-
18
- spec.files = `git ls-files`.split($/)
19
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
- spec.require_paths = ["lib"]
22
-
23
- spec.add_dependency("relaxo", "~> 1.5")
24
- spec.add_dependency("msgpack", "~> 1.0")
25
-
26
- spec.add_development_dependency "covered"
27
- spec.add_development_dependency "bundler"
28
- spec.add_development_dependency "rspec", "~> 3.4.0"
29
- spec.add_development_dependency "rake"
30
- end