relaxo-model 0.13.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +11 -17
- data/.rspec +4 -0
- data/.travis.yml +16 -13
- data/Gemfile +1 -6
- data/README.md +9 -9
- data/Rakefile +4 -5
- data/lib/relaxo/model.rb +1 -1
- data/lib/relaxo/model/base.rb +2 -2
- data/lib/relaxo/model/component.rb +19 -11
- data/lib/relaxo/model/document.rb +11 -10
- data/lib/relaxo/model/properties.rb +1 -1
- data/lib/relaxo/model/properties/attribute.rb +1 -1
- data/lib/relaxo/model/properties/bcrypt.rb +1 -1
- data/lib/relaxo/model/properties/bigdecimal.rb +1 -1
- data/lib/relaxo/model/properties/composite.rb +1 -1
- data/lib/relaxo/model/properties/latinum.rb +1 -1
- data/lib/relaxo/model/recordset.rb +1 -1
- data/lib/relaxo/model/version.rb +2 -2
- data/relaxo-model.gemspec +5 -6
- data/spec/relaxo/model/attribute_spec.rb +19 -0
- data/spec/relaxo/model/document_spec.rb +19 -0
- data/spec/relaxo/model/model_context.rb +19 -1
- data/spec/relaxo/model/properties/bcrypt_spec.rb +19 -0
- data/spec/relaxo/model/recordset_spec.rb +19 -0
- data/spec/spec_helper.rb +31 -0
- metadata +26 -11
- data/.simplecov +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 126822058c0a3d4105b8c908ef9b1e5199bd40e9d5d81020a98db4e9ae8e583b
|
4
|
+
data.tar.gz: b8c9a8ebfb4dd13e34d5f3c2145a65ebf87a778dfd7fa1d7e77b520bfe26857e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6be3ce5ffa697b9bae243d57df54ad0054114ff4b30e3f450f81603010bc7590992c8651a49d8746d889b30cc40849866d00db43217d8bf2f047b81ce89a912
|
7
|
+
data.tar.gz: 02af703b22d3da40fae898725c47aad4ed1a1778ab49afb413797fe9679bcf797a6ffd0476a5589fc953d1d28c875f8b964247f3bd469ce9d4fb9b55f70d89ea
|
data/.gitignore
CHANGED
@@ -1,18 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
6
10
|
Gemfile.lock
|
7
|
-
|
8
|
-
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
spec/relaxo/model/test
|
16
|
-
test/tmp
|
17
|
-
test/version_tmp
|
18
|
-
tmp
|
11
|
+
.rspec_status
|
12
|
+
.covered.db
|
data/.rspec
ADDED
data/.travis.yml
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
- git config --global user.name "Samuel Williams"
|
6
|
-
- git config --global user.email "samuel@oriontransfer.net"
|
7
|
-
rvm:
|
8
|
-
- 2.1.8
|
9
|
-
- 2.2.4
|
10
|
-
- 2.3.1
|
11
|
-
- 2.4.0
|
12
|
-
- rbx-2
|
13
|
-
env: COVERAGE=true
|
2
|
+
dist: xenial
|
3
|
+
cache: bundler
|
4
|
+
|
14
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
|
15
16
|
allow_failures:
|
17
|
+
- rvm: truffleruby
|
16
18
|
- rvm: ruby-head
|
17
|
-
- rvm:
|
19
|
+
- rvm: jruby-head
|
20
|
+
- rvm: truffleruby
|
data/Gemfile
CHANGED
@@ -3,14 +3,9 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in relaxo-model.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'rugged', git: '
|
6
|
+
gem 'rugged', git: 'https://github.com/libgit2/rugged.git', submodules: true
|
7
7
|
|
8
8
|
group :development do
|
9
9
|
gem "pry"
|
10
10
|
gem "bcrypt"
|
11
11
|
end
|
12
|
-
|
13
|
-
group :test do
|
14
|
-
gem 'simplecov'
|
15
|
-
gem 'coveralls', require: false
|
16
|
-
end
|
data/README.md
CHANGED
@@ -59,23 +59,23 @@ require 'relaxo/model'
|
|
59
59
|
database = Relaxo.connect("test")
|
60
60
|
|
61
61
|
trees = [
|
62
|
-
|
63
|
-
|
62
|
+
{:name => 'Hinoki', :planted => Date.parse("2013/11/17")},
|
63
|
+
{:name => 'Keyaki', :planted => Date.parse("2016/9/24")}
|
64
64
|
]
|
65
65
|
|
66
66
|
class Tree
|
67
|
-
|
67
|
+
include Relaxo::Model
|
68
68
|
|
69
|
-
|
70
|
-
|
69
|
+
property :name
|
70
|
+
property :planted, Attribute[Date]
|
71
71
|
|
72
|
-
|
72
|
+
view :all, [:type], index: [:name]
|
73
73
|
end
|
74
74
|
|
75
75
|
database.commit(message: "Create trees") do |changeset|
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
trees.each do |tree|
|
77
|
+
Tree.insert(changeset, tree)
|
78
|
+
end
|
79
79
|
end
|
80
80
|
|
81
81
|
database.current do |dataset|
|
data/Rakefile
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
task :default => :spec
|
4
|
+
# For RSpec
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
6
|
|
10
7
|
task :console do
|
11
8
|
require 'pry'
|
@@ -16,3 +13,5 @@ task :console do
|
|
16
13
|
|
17
14
|
Pry.start
|
18
15
|
end
|
16
|
+
|
17
|
+
task :default => :spec
|
data/lib/relaxo/model.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
data/lib/relaxo/model/base.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -78,7 +78,7 @@ module Relaxo
|
|
78
78
|
|
79
79
|
def view(name, *path, klass: self, index: nil)
|
80
80
|
# Support array as 2nd argument, e.g.
|
81
|
-
# view :by_owner, [:type, 'by_owner', ]
|
81
|
+
# view :by_owner, [:type, 'by_owner', ...]
|
82
82
|
if path.empty?
|
83
83
|
path = [:type, name.to_s, name.to_s.split('_', 2).last.to_sym]
|
84
84
|
elsif path.count == 1 and path.first.is_a? Array
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -22,6 +22,9 @@ require 'relaxo/model/base'
|
|
22
22
|
|
23
23
|
module Relaxo
|
24
24
|
module Model
|
25
|
+
class SerializationError < RuntimeError
|
26
|
+
end
|
27
|
+
|
25
28
|
# Represents an underlying object with changes which can be persisted.
|
26
29
|
module Component
|
27
30
|
def self.included(child)
|
@@ -51,7 +54,8 @@ module Relaxo
|
|
51
54
|
# Attributes that have been changed or de-serialized from the dataset:
|
52
55
|
attr :changed
|
53
56
|
|
54
|
-
def reload
|
57
|
+
def reload(dataset = @dataset)
|
58
|
+
@dataset = dataset
|
55
59
|
@changed.clear
|
56
60
|
self.load_object
|
57
61
|
end
|
@@ -102,11 +106,11 @@ module Relaxo
|
|
102
106
|
end
|
103
107
|
end
|
104
108
|
|
105
|
-
def validate
|
109
|
+
def validate(changeset)
|
106
110
|
# Do nothing :)
|
107
111
|
end
|
108
112
|
|
109
|
-
def
|
113
|
+
def to_h
|
110
114
|
@attributes
|
111
115
|
end
|
112
116
|
|
@@ -131,14 +135,18 @@ module Relaxo
|
|
131
135
|
# Moves values from `@changed` into `@attributes`.
|
132
136
|
def flatten!
|
133
137
|
self.class.properties.each do |key, klass|
|
134
|
-
|
135
|
-
if
|
136
|
-
|
137
|
-
|
138
|
-
|
138
|
+
begin
|
139
|
+
if @changed.include?(key)
|
140
|
+
if klass
|
141
|
+
@attributes[key] = klass.convert_to_primative(@changed.delete(key))
|
142
|
+
else
|
143
|
+
@attributes[key] = @changed.delete(key)
|
144
|
+
end
|
145
|
+
elsif !@attributes.include?(key) and klass.respond_to?(:default)
|
146
|
+
@attributes[key] = klass.default
|
139
147
|
end
|
140
|
-
|
141
|
-
|
148
|
+
rescue
|
149
|
+
raise SerializationError, "Failed to flatten #{key.inspect} of type #{klass.inspect}!"
|
142
150
|
end
|
143
151
|
end
|
144
152
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -24,7 +24,7 @@ require 'msgpack'
|
|
24
24
|
|
25
25
|
module Relaxo
|
26
26
|
module Model
|
27
|
-
class
|
27
|
+
class ValidationFailure < StandardError
|
28
28
|
def initialize(document, errors)
|
29
29
|
@document = document
|
30
30
|
@errors = errors
|
@@ -79,7 +79,7 @@ module Relaxo
|
|
79
79
|
# Fetch a record or create a model object from a hash of attributes.
|
80
80
|
def fetch(dataset, path = nil, **attributes)
|
81
81
|
if path and object = dataset.read(path)
|
82
|
-
instance = self.new(dataset, object, attributes)
|
82
|
+
instance = self.new(dataset, object, **attributes)
|
83
83
|
|
84
84
|
instance.load_object
|
85
85
|
|
@@ -132,11 +132,12 @@ module Relaxo
|
|
132
132
|
"\#<#{self.class}:#{self.id} #{self.attributes.inspect}>"
|
133
133
|
end
|
134
134
|
|
135
|
-
#
|
136
|
-
def dup
|
137
|
-
|
135
|
+
# Make a copy of the record, as if calling create.
|
136
|
+
def dup(dataset = @dataset)
|
137
|
+
# Splat already calls dup internally I guess.
|
138
|
+
clone = self.class.new(dataset, nil, @changed.dup, **@attributes)
|
138
139
|
|
139
|
-
clone.
|
140
|
+
clone.after_create
|
140
141
|
|
141
142
|
return clone
|
142
143
|
end
|
@@ -146,7 +147,7 @@ module Relaxo
|
|
146
147
|
|
147
148
|
self.class.keys.each do |name, key|
|
148
149
|
# @attributes is not modified until we call self.dump (which flattens @attributes into @changes). When we generate paths, we want to ensure these are done based on the non-mutable state of the object.
|
149
|
-
yield key.object_path(self,
|
150
|
+
yield key.object_path(self, **@attributes)
|
150
151
|
end
|
151
152
|
end
|
152
153
|
|
@@ -156,7 +157,7 @@ module Relaxo
|
|
156
157
|
|
157
158
|
before_save
|
158
159
|
|
159
|
-
if errors = self.validate
|
160
|
+
if errors = self.validate(dataset)
|
160
161
|
return errors
|
161
162
|
end
|
162
163
|
|
@@ -190,7 +191,7 @@ module Relaxo
|
|
190
191
|
result = self.save(dataset)
|
191
192
|
|
192
193
|
if result != true
|
193
|
-
raise
|
194
|
+
raise ValidationFailure.new(self, result)
|
194
195
|
end
|
195
196
|
|
196
197
|
return self
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright, 2017, by Samuel G. D. Williams. <http://www.
|
1
|
+
# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
data/lib/relaxo/model/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -20,6 +20,6 @@
|
|
20
20
|
|
21
21
|
module Relaxo
|
22
22
|
module Model
|
23
|
-
VERSION = "0.
|
23
|
+
VERSION = "0.17.1"
|
24
24
|
end
|
25
25
|
end
|
data/relaxo-model.gemspec
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'relaxo/model/version'
|
1
|
+
|
2
|
+
require_relative 'lib/relaxo/model/version'
|
5
3
|
|
6
4
|
Gem::Specification.new do |spec|
|
7
5
|
spec.name = "relaxo-model"
|
@@ -22,10 +20,11 @@ Gem::Specification.new do |spec|
|
|
22
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
21
|
spec.require_paths = ["lib"]
|
24
22
|
|
25
|
-
spec.add_dependency("relaxo", "~> 1.
|
23
|
+
spec.add_dependency("relaxo", "~> 1.5")
|
26
24
|
spec.add_dependency("msgpack", "~> 1.0")
|
27
25
|
|
28
|
-
spec.add_development_dependency "
|
26
|
+
spec.add_development_dependency "covered"
|
27
|
+
spec.add_development_dependency "bundler"
|
29
28
|
spec.add_development_dependency "rspec", "~> 3.4.0"
|
30
29
|
spec.add_development_dependency "rake"
|
31
30
|
end
|
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
1
20
|
|
2
21
|
require 'relaxo/model'
|
3
22
|
|
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
1
20
|
|
2
21
|
require_relative 'model_context'
|
3
22
|
|
@@ -1,6 +1,24 @@
|
|
1
|
+
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
1
20
|
|
2
21
|
require 'relaxo/model'
|
3
|
-
|
4
22
|
require 'relaxo/model/properties/bcrypt'
|
5
23
|
|
6
24
|
class Invoice
|
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
1
20
|
|
2
21
|
require_relative '../model_context'
|
3
22
|
|
@@ -1,3 +1,22 @@
|
|
1
|
+
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
1
20
|
|
2
21
|
require_relative 'model_context'
|
3
22
|
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
20
|
+
|
21
|
+
require "bundler/setup"
|
22
|
+
require "covered/rspec"
|
23
|
+
|
24
|
+
RSpec.configure do |config|
|
25
|
+
# Enable flags like --only-failures and --next-failure
|
26
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
27
|
+
|
28
|
+
config.expect_with :rspec do |c|
|
29
|
+
c.syntax = :expect
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaxo-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaxo
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.5'
|
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.
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: msgpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,20 +38,34 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: covered
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +104,7 @@ extensions: []
|
|
90
104
|
extra_rdoc_files: []
|
91
105
|
files:
|
92
106
|
- ".gitignore"
|
93
|
-
- ".
|
107
|
+
- ".rspec"
|
94
108
|
- ".travis.yml"
|
95
109
|
- Gemfile
|
96
110
|
- README.md
|
@@ -115,6 +129,7 @@ files:
|
|
115
129
|
- spec/relaxo/model/model_context.rb
|
116
130
|
- spec/relaxo/model/properties/bcrypt_spec.rb
|
117
131
|
- spec/relaxo/model/recordset_spec.rb
|
132
|
+
- spec/spec_helper.rb
|
118
133
|
homepage: http://www.codeotaku.com/projects/relaxo/model
|
119
134
|
licenses:
|
120
135
|
- MIT
|
@@ -134,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
149
|
- !ruby/object:Gem::Version
|
135
150
|
version: '0'
|
136
151
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.6.12
|
152
|
+
rubygems_version: 3.1.2
|
139
153
|
signing_key:
|
140
154
|
specification_version: 4
|
141
155
|
summary: A model layer for CouchDB with minimal global state.
|
@@ -145,3 +159,4 @@ test_files:
|
|
145
159
|
- spec/relaxo/model/model_context.rb
|
146
160
|
- spec/relaxo/model/properties/bcrypt_spec.rb
|
147
161
|
- spec/relaxo/model/recordset_spec.rb
|
162
|
+
- spec/spec_helper.rb
|