mappd 6.0.3 → 6.1.4.3
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 +4 -4
- data/.rubocop.yml +2 -1
- data/Dockerfile +1 -1
- data/Gemfile +0 -1
- data/Gemfile.lock +60 -62
- data/Makefile +2 -0
- data/README.md +9 -3
- data/lib/mappd/mappd.rb +5 -3
- data/lib/mappd/version.rb +1 -1
- data/lib/mappd.rb +1 -1
- data/mappd.gemspec +6 -1
- data/spec/mappd_spec.rb +2 -1
- data/spec/models.rb +3 -2
- metadata +10 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 836816d08a636e161503d6e68e7b7eda29c3d59b6c975207e33777ac38910a13
|
|
4
|
+
data.tar.gz: d15e29aaec58bd74b4191a626348ad39f316643d76f23a86de22ad6b34fa9b02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6116d8c74334178959a8fb6487dfe4c047f0d95394418af536ea5b9702cf34e2ae671e47f0823989f1c19fc637c631f231b4e5efc05d5487c1340c4ff3c43bba
|
|
7
|
+
data.tar.gz: c4d85789a22f30ab1bc7ae10b6207878ad0c2f434b2ec6f39bdd74ac25888dc2cf9424475f99f40e3c6765f2f657a049c221871c68da1c8de1557bf4119368d5
|
data/.rubocop.yml
CHANGED
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mappd (6.
|
|
5
|
-
activerecord (
|
|
4
|
+
mappd (6.1.4.2)
|
|
5
|
+
activerecord (~> 6.1.4.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: http://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (6.
|
|
11
|
-
activesupport (= 6.
|
|
12
|
-
activerecord (6.
|
|
13
|
-
activemodel (= 6.
|
|
14
|
-
activesupport (= 6.
|
|
15
|
-
activesupport (6.
|
|
10
|
+
activemodel (6.1.4.1)
|
|
11
|
+
activesupport (= 6.1.4.1)
|
|
12
|
+
activerecord (6.1.4.1)
|
|
13
|
+
activemodel (= 6.1.4.1)
|
|
14
|
+
activesupport (= 6.1.4.1)
|
|
15
|
+
activesupport (6.1.4.1)
|
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
17
|
-
i18n (>=
|
|
18
|
-
minitest (
|
|
19
|
-
tzinfo (~>
|
|
20
|
-
zeitwerk (~> 2.
|
|
21
|
-
ast (2.4.
|
|
17
|
+
i18n (>= 1.6, < 2)
|
|
18
|
+
minitest (>= 5.1)
|
|
19
|
+
tzinfo (~> 2.0)
|
|
20
|
+
zeitwerk (~> 2.3)
|
|
21
|
+
ast (2.4.2)
|
|
22
22
|
byebug (11.1.3)
|
|
23
23
|
coderay (1.1.3)
|
|
24
|
-
concurrent-ruby (1.1.
|
|
25
|
-
diff-lcs (1.
|
|
26
|
-
ffi (1.
|
|
27
|
-
formatador (0.
|
|
28
|
-
guard (2.
|
|
24
|
+
concurrent-ruby (1.1.9)
|
|
25
|
+
diff-lcs (1.4.4)
|
|
26
|
+
ffi (1.15.4)
|
|
27
|
+
formatador (0.3.0)
|
|
28
|
+
guard (2.18.0)
|
|
29
29
|
formatador (>= 0.2.4)
|
|
30
30
|
listen (>= 2.7, < 4.0)
|
|
31
31
|
lumberjack (>= 1.0.12, < 2.0)
|
|
32
32
|
nenv (~> 0.1)
|
|
33
33
|
notiffany (~> 0.0)
|
|
34
|
-
pry (>= 0.
|
|
34
|
+
pry (>= 0.13.0)
|
|
35
35
|
shellany (~> 0.0)
|
|
36
36
|
thor (>= 0.18.1)
|
|
37
37
|
guard-compat (1.2.1)
|
|
@@ -39,75 +39,73 @@ GEM
|
|
|
39
39
|
guard (~> 2.1)
|
|
40
40
|
guard-compat (~> 1.1)
|
|
41
41
|
rspec (>= 2.99.0, < 4.0)
|
|
42
|
-
guard-rubocop (1.
|
|
42
|
+
guard-rubocop (1.5.0)
|
|
43
43
|
guard (~> 2.0)
|
|
44
|
-
rubocop (
|
|
45
|
-
i18n (1.8.
|
|
44
|
+
rubocop (< 2.0)
|
|
45
|
+
i18n (1.8.11)
|
|
46
46
|
concurrent-ruby (~> 1.0)
|
|
47
|
-
listen (3.
|
|
47
|
+
listen (3.7.0)
|
|
48
48
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
49
49
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
50
|
-
lumberjack (1.2.
|
|
50
|
+
lumberjack (1.2.8)
|
|
51
51
|
method_source (1.0.0)
|
|
52
|
-
minitest (5.14.
|
|
52
|
+
minitest (5.14.4)
|
|
53
53
|
nenv (0.3.0)
|
|
54
54
|
notiffany (0.1.3)
|
|
55
55
|
nenv (~> 0.1)
|
|
56
56
|
shellany (~> 0.0)
|
|
57
|
-
parallel (1.
|
|
58
|
-
parser (
|
|
59
|
-
ast (~> 2.4.
|
|
60
|
-
pry (0.
|
|
57
|
+
parallel (1.21.0)
|
|
58
|
+
parser (3.0.2.0)
|
|
59
|
+
ast (~> 2.4.1)
|
|
60
|
+
pry (0.14.1)
|
|
61
61
|
coderay (~> 1.1)
|
|
62
62
|
method_source (~> 1.0)
|
|
63
63
|
rainbow (3.0.0)
|
|
64
|
-
rake (13.0.
|
|
65
|
-
rb-fsevent (0.
|
|
64
|
+
rake (13.0.6)
|
|
65
|
+
rb-fsevent (0.11.0)
|
|
66
66
|
rb-inotify (0.10.1)
|
|
67
67
|
ffi (~> 1.0)
|
|
68
|
-
regexp_parser (1.
|
|
69
|
-
rexml (3.2.
|
|
70
|
-
rspec (3.
|
|
71
|
-
rspec-core (~> 3.
|
|
72
|
-
rspec-expectations (~> 3.
|
|
73
|
-
rspec-mocks (~> 3.
|
|
74
|
-
rspec-core (3.
|
|
75
|
-
rspec-support (~> 3.
|
|
76
|
-
rspec-expectations (3.
|
|
68
|
+
regexp_parser (2.1.1)
|
|
69
|
+
rexml (3.2.5)
|
|
70
|
+
rspec (3.10.0)
|
|
71
|
+
rspec-core (~> 3.10.0)
|
|
72
|
+
rspec-expectations (~> 3.10.0)
|
|
73
|
+
rspec-mocks (~> 3.10.0)
|
|
74
|
+
rspec-core (3.10.1)
|
|
75
|
+
rspec-support (~> 3.10.0)
|
|
76
|
+
rspec-expectations (3.10.1)
|
|
77
77
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
78
|
-
rspec-support (~> 3.
|
|
79
|
-
rspec-mocks (3.
|
|
78
|
+
rspec-support (~> 3.10.0)
|
|
79
|
+
rspec-mocks (3.10.2)
|
|
80
80
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
81
|
-
rspec-support (~> 3.
|
|
82
|
-
rspec-support (3.
|
|
83
|
-
rubocop (
|
|
81
|
+
rspec-support (~> 3.10.0)
|
|
82
|
+
rspec-support (3.10.3)
|
|
83
|
+
rubocop (1.23.0)
|
|
84
84
|
parallel (~> 1.10)
|
|
85
|
-
parser (>=
|
|
85
|
+
parser (>= 3.0.0.0)
|
|
86
86
|
rainbow (>= 2.2.2, < 4.0)
|
|
87
|
-
regexp_parser (>= 1.
|
|
87
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
88
88
|
rexml
|
|
89
|
-
rubocop-ast (>= 0.0
|
|
89
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
|
90
90
|
ruby-progressbar (~> 1.7)
|
|
91
|
-
unicode-display_width (>= 1.4.0, <
|
|
92
|
-
rubocop-ast (
|
|
93
|
-
parser (>=
|
|
94
|
-
ruby-progressbar (1.
|
|
91
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
92
|
+
rubocop-ast (1.13.0)
|
|
93
|
+
parser (>= 3.0.1.1)
|
|
94
|
+
ruby-progressbar (1.11.0)
|
|
95
95
|
shellany (0.0.1)
|
|
96
|
-
shoulda-matchers (
|
|
97
|
-
activesupport (>=
|
|
96
|
+
shoulda-matchers (5.0.0)
|
|
97
|
+
activesupport (>= 5.2.0)
|
|
98
98
|
sqlite3 (1.4.2)
|
|
99
|
-
thor (1.0
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
zeitwerk (2.3.0)
|
|
99
|
+
thor (1.1.0)
|
|
100
|
+
tzinfo (2.0.4)
|
|
101
|
+
concurrent-ruby (~> 1.0)
|
|
102
|
+
unicode-display_width (2.1.0)
|
|
103
|
+
zeitwerk (2.5.1)
|
|
105
104
|
|
|
106
105
|
PLATFORMS
|
|
107
106
|
ruby
|
|
108
107
|
|
|
109
108
|
DEPENDENCIES
|
|
110
|
-
activerecord (>= 6.0.1)
|
|
111
109
|
byebug
|
|
112
110
|
guard-rspec
|
|
113
111
|
guard-rubocop
|
|
@@ -119,4 +117,4 @@ DEPENDENCIES
|
|
|
119
117
|
sqlite3 (~> 1.4.0)
|
|
120
118
|
|
|
121
119
|
BUNDLED WITH
|
|
122
|
-
1.17.
|
|
120
|
+
1.17.2
|
data/Makefile
CHANGED
data/README.md
CHANGED
|
@@ -30,9 +30,9 @@ class Person < ActiveRecord::Base
|
|
|
30
30
|
|
|
31
31
|
# Rename a field - the old field and rename could be removed after
|
|
32
32
|
# migrate! is called
|
|
33
|
-
field :external_id, :string,
|
|
33
|
+
field :external_id, :string, limit: 10
|
|
34
34
|
rename :external_id, :e_id
|
|
35
|
-
field :e_id, :string,
|
|
35
|
+
field :e_id, :string, limit: 10
|
|
36
36
|
# Delete a field - the old field and drop could be removed after
|
|
37
37
|
# migrate! is called
|
|
38
38
|
drop :name
|
|
@@ -99,7 +99,7 @@ You may use a type not in this list as long as it is supported by your database
|
|
|
99
99
|
|
|
100
100
|
Available options are (none of these exists by default):
|
|
101
101
|
|
|
102
|
-
```:limit``` - Requests a maximum column
|
|
102
|
+
```:limit``` - Requests a maximum column limit. This is the number of characters for a :string column and number of bytes for :text, :binary and :integer columns. This option is ignored by some backends.
|
|
103
103
|
|
|
104
104
|
```:default``` - The column's default value. Use nil for NULL.
|
|
105
105
|
|
|
@@ -123,3 +123,9 @@ Create a `mappd.rb` initializer inside `config/initializers` and add the followi
|
|
|
123
123
|
clazz.migrate! if clazz.ancestors.include?(ActiveRecord::Base)
|
|
124
124
|
end
|
|
125
125
|
```
|
|
126
|
+
|
|
127
|
+
## Donations
|
|
128
|
+
|
|
129
|
+
Mappd is free to all, but donations are welcome.
|
|
130
|
+
|
|
131
|
+
Bitcoin: 3EQRmXmkuje2Ww75Tp47RdinsPusCTLavx
|
data/lib/mappd/mappd.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'active_record'
|
|
2
|
+
|
|
1
3
|
module Mappd
|
|
2
4
|
def self.included(base)
|
|
3
5
|
base.extend(ClassMethods)
|
|
@@ -5,7 +7,7 @@ module Mappd
|
|
|
5
7
|
|
|
6
8
|
module ClassMethods
|
|
7
9
|
def index(name, options = {})
|
|
8
|
-
commands << [:add_index, [table_name, name, options]]
|
|
10
|
+
commands << [:add_index, [table_name, name, { **options }]]
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
def rename(from, to)
|
|
@@ -17,11 +19,11 @@ module Mappd
|
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
def field(name, type = :string, options = {})
|
|
20
|
-
commands << [:add_column, [table_name, name, type, options]]
|
|
22
|
+
commands << [:add_column, [table_name, name, type, { **options }]]
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
def timestamps
|
|
24
|
-
commands << [:add_timestamps, [table_name, null: true]]
|
|
26
|
+
commands << [:add_timestamps, [table_name, { null: true }]]
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
def associations!
|
data/lib/mappd/version.rb
CHANGED
data/lib/mappd.rb
CHANGED
data/mappd.gemspec
CHANGED
|
@@ -22,5 +22,10 @@ at you just know in others projects like DataMapper or MongoMapper.
|
|
|
22
22
|
.split("\n").map { |f| File.basename(f) }
|
|
23
23
|
s.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
s.add_dependency 'activerecord', '
|
|
25
|
+
s.add_dependency 'activerecord', '~>6.1.4.1'
|
|
26
|
+
|
|
27
|
+
s.required_ruby_version = '>= 2.6.0'
|
|
28
|
+
s.metadata = {
|
|
29
|
+
'rubygems_mfa_required' => 'true'
|
|
30
|
+
}
|
|
26
31
|
end
|
data/spec/mappd_spec.rb
CHANGED
|
@@ -9,6 +9,7 @@ context '#create table' do
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
RSpec.describe Person, type: :model do
|
|
12
|
+
it { should have_db_column(:title).of_type(:string) }
|
|
12
13
|
it { should have_db_column(:name).of_type(:string) }
|
|
13
14
|
it { should have_db_column(:age).of_type(:integer) }
|
|
14
15
|
it {
|
|
@@ -20,7 +21,7 @@ RSpec.describe Person, type: :model do
|
|
|
20
21
|
it { should_not have_db_column(:external_id) }
|
|
21
22
|
it {
|
|
22
23
|
should have_db_column(:e_id).of_type(:string)
|
|
23
|
-
.with_options(
|
|
24
|
+
.with_options(limit: 10)
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
it { should have_db_column(:country_id).of_type(:integer) }
|
data/spec/models.rb
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
require 'active_record'
|
|
2
2
|
|
|
3
3
|
class Person < ActiveRecord::Base
|
|
4
|
+
field :title, :string
|
|
4
5
|
field :name, :string, null: false, default: ''
|
|
5
6
|
field :age, :integer
|
|
6
7
|
field :score, :decimal, precision: 10, scale: 10, null: true
|
|
7
8
|
|
|
8
|
-
field :external_id, :string,
|
|
9
|
+
field :external_id, :string, limit: 10
|
|
9
10
|
rename :external_id, :e_id
|
|
10
|
-
field :e_id, :string,
|
|
11
|
+
field :e_id, :string, limit: 10
|
|
11
12
|
|
|
12
13
|
belongs_to :country
|
|
13
14
|
has_many :pictures, as: :imageable
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mappd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.1.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dan Watson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 6.
|
|
19
|
+
version: 6.1.4.1
|
|
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: 6.
|
|
26
|
+
version: 6.1.4.1
|
|
27
27
|
description: "With it you can add the ability to create columns\noutside the default
|
|
28
28
|
schema, directly in your model in a similar way t\nat you just know in others projects
|
|
29
29
|
like DataMapper or MongoMapper.\n "
|
|
@@ -55,7 +55,8 @@ files:
|
|
|
55
55
|
- spec/spec_helper.rb
|
|
56
56
|
homepage: https://github.com/dan-watson/mappd
|
|
57
57
|
licenses: []
|
|
58
|
-
metadata:
|
|
58
|
+
metadata:
|
|
59
|
+
rubygems_mfa_required: 'true'
|
|
59
60
|
post_install_message:
|
|
60
61
|
rdoc_options: []
|
|
61
62
|
require_paths:
|
|
@@ -64,14 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
64
65
|
requirements:
|
|
65
66
|
- - ">="
|
|
66
67
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
68
|
+
version: 2.6.0
|
|
68
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
70
|
requirements:
|
|
70
71
|
- - ">="
|
|
71
72
|
- !ruby/object:Gem::Version
|
|
72
73
|
version: '0'
|
|
73
74
|
requirements: []
|
|
74
|
-
rubygems_version: 3.0.3
|
|
75
|
+
rubygems_version: 3.0.3.1
|
|
75
76
|
signing_key:
|
|
76
77
|
specification_version: 4
|
|
77
78
|
summary: Mappd is a micro gem that allow you to write schema inside your model as
|