mobility 0.8.11 → 0.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +15 -1
- data/Gemfile +46 -17
- data/Gemfile.lock +2 -64
- data/README.md +1 -1
- data/Rakefile +6 -4
- data/lib/mobility/plugins/fallthrough_accessors.rb +8 -4
- data/lib/mobility/version.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd73c4e94757a4138786f7ebfeb2ac7bbdbcb219030af3319043232b696d70c2
|
4
|
+
data.tar.gz: c05a86a128d80fb859b531c25745474a561f92bf1c610a6d41250c4995f8b0a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfcddf59bc7a203fd00508bbcb32c8e59658eded31cbf637fb5fe9e9ccfd4cde3b59f762113b1f32c1427d5e2fecfa67e9c91d6c9d8b58c05928cf90356370be
|
7
|
+
data.tar.gz: 887fbb7bb02fa80fc421b45f8f434972c4d163e11e0d6d5dc2618f94e7f86307feb2fc4801c988fd86d19735edb863519b60addacaebebb49d2cb27490af0210
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -2,8 +2,22 @@
|
|
2
2
|
|
3
3
|
## 0.8
|
4
4
|
|
5
|
+
### 0.8.13 (May 27, 2020)
|
6
|
+
|
7
|
+
* Fix fallthrough accessor method_missing not passing all options to super
|
8
|
+
([#364](https://github.com/shioyama/mobility/pull/364),
|
9
|
+
[#384](https://github.com/shioyama/mobility/pull/384),
|
10
|
+
[#377](https://github.com/shioyama/mobility/pull/377), thanks
|
11
|
+
[doits](https://github.com/doits)!)
|
12
|
+
|
13
|
+
### 0.8.12 (May 15, 2020)
|
14
|
+
|
15
|
+
(yanked)
|
16
|
+
|
5
17
|
### 0.8.11 (May 14, 2020)
|
6
|
-
* Handle select with block
|
18
|
+
* Handle select with block
|
19
|
+
([#359](https://github.com/shioyama/mobility/pull/359), thanks
|
20
|
+
[dlcmh](https://github.com/dlcmh)!)
|
7
21
|
|
8
22
|
### 0.8.10 (February 11, 2020)
|
9
23
|
* Enforce case_sensitive comparison for Rails 6.1
|
data/Gemfile
CHANGED
@@ -3,41 +3,70 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in mobility.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
orm, orm_version = ENV['ORM'], ENV['ORM_VERSION']
|
7
|
+
|
6
8
|
group :development, :test do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
case orm
|
10
|
+
when 'active_record'
|
11
|
+
orm_version ||= '6.0'
|
12
|
+
case orm_version
|
13
|
+
when '4.2'
|
11
14
|
gem 'activerecord', '>= 4.2.6', '< 5.0'
|
12
|
-
|
15
|
+
when '5.0'
|
16
|
+
gem 'activerecord', '>= 5.0', '< 5.1'
|
17
|
+
when '5.1'
|
13
18
|
gem 'activerecord', '>= 5.1', '< 5.2'
|
14
|
-
|
19
|
+
when '5.2'
|
15
20
|
gem 'activerecord', '>= 5.2.0', '< 5.3'
|
16
21
|
gem 'railties', '>= 5.2.0.rc2', '< 5.3'
|
17
|
-
|
22
|
+
when '6.0'
|
18
23
|
gem 'activerecord', '>= 6.0.0', '< 6.1'
|
24
|
+
when '6.1'
|
25
|
+
git 'https://github.com/rails/rails.git' do
|
26
|
+
gem 'activerecord'
|
27
|
+
gem 'activesupport'
|
28
|
+
end
|
29
|
+
else
|
30
|
+
raise ArgumentError, 'Invalid ActiveRecord version'
|
19
31
|
end
|
32
|
+
|
20
33
|
gem "generator_spec", '~> 0.9.4'
|
21
|
-
|
22
|
-
|
34
|
+
when 'sequel'
|
35
|
+
orm_version ||= '5'
|
36
|
+
case orm_version
|
37
|
+
when '4'
|
23
38
|
gem 'sequel', '>= 4.46.0', '< 5.0'
|
24
|
-
|
39
|
+
when '5'
|
25
40
|
gem 'sequel', '>= 5.0.0', '< 6.0.0'
|
41
|
+
else
|
42
|
+
raise ArgumentError, 'Invalid Sequel version'
|
26
43
|
end
|
44
|
+
when nil, ''
|
45
|
+
else
|
46
|
+
raise ArgumentError, "Invalid ORM: #{orm}"
|
27
47
|
end
|
28
48
|
|
29
|
-
gem 'allocation_stats' if ENV['
|
49
|
+
gem 'allocation_stats' if ENV['FEATURE'] == 'performance'
|
30
50
|
|
31
51
|
platforms :ruby do
|
32
52
|
gem 'guard-rspec'
|
33
53
|
gem 'pry-byebug'
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
54
|
+
case ENV['DB']
|
55
|
+
when 'sqlite3'
|
56
|
+
if orm == 'active_record' && orm_version < '5.2'
|
57
|
+
gem 'sqlite3', '~> 1.3.13'
|
58
|
+
else
|
59
|
+
gem 'sqlite3', '~> 1.4.1'
|
60
|
+
end
|
61
|
+
when 'mysql'
|
62
|
+
gem 'mysql2'
|
63
|
+
when 'postgres'
|
64
|
+
if orm == 'active_record' && orm_version < '5.0'
|
65
|
+
gem 'pg', '< 1.0'
|
66
|
+
else
|
67
|
+
gem 'pg'
|
68
|
+
end
|
38
69
|
end
|
39
|
-
gem 'mysql2', '~> 0.4.9'
|
40
|
-
gem 'pg', '< 1.0'
|
41
70
|
end
|
42
71
|
end
|
43
72
|
|
data/Gemfile.lock
CHANGED
@@ -1,51 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mobility (0.
|
4
|
+
mobility (1.0.alpha.1)
|
5
5
|
i18n (>= 0.6.10, < 2)
|
6
6
|
request_store (~> 1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionpack (6.0.3)
|
12
|
-
actionview (= 6.0.3)
|
13
|
-
activesupport (= 6.0.3)
|
14
|
-
rack (~> 2.0, >= 2.0.8)
|
15
|
-
rack-test (>= 0.6.3)
|
16
|
-
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
-
actionview (6.0.3)
|
19
|
-
activesupport (= 6.0.3)
|
20
|
-
builder (~> 3.1)
|
21
|
-
erubi (~> 1.4)
|
22
|
-
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
-
activemodel (6.0.3)
|
25
|
-
activesupport (= 6.0.3)
|
26
|
-
activerecord (6.0.3)
|
27
|
-
activemodel (= 6.0.3)
|
28
|
-
activesupport (= 6.0.3)
|
29
|
-
activesupport (6.0.3)
|
30
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
31
|
-
i18n (>= 0.7, < 2)
|
32
|
-
minitest (~> 5.1)
|
33
|
-
tzinfo (~> 1.1)
|
34
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
35
11
|
benchmark-ips (2.8.2)
|
36
|
-
builder (3.2.4)
|
37
12
|
byebug (11.1.3)
|
38
13
|
coderay (1.1.2)
|
39
14
|
concurrent-ruby (1.1.6)
|
40
|
-
crass (1.0.6)
|
41
15
|
database_cleaner (1.8.5)
|
42
16
|
diff-lcs (1.3)
|
43
|
-
erubi (1.9.0)
|
44
17
|
ffi (1.12.2)
|
45
18
|
formatador (0.2.5)
|
46
|
-
generator_spec (0.9.4)
|
47
|
-
activesupport (>= 3.0.0)
|
48
|
-
railties (>= 3.0.0)
|
49
19
|
guard (2.16.2)
|
50
20
|
formatador (>= 0.2.4)
|
51
21
|
listen (>= 2.7, < 4.0)
|
@@ -65,21 +35,12 @@ GEM
|
|
65
35
|
listen (3.2.1)
|
66
36
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
67
37
|
rb-inotify (~> 0.9, >= 0.9.10)
|
68
|
-
loofah (2.5.0)
|
69
|
-
crass (~> 1.0.2)
|
70
|
-
nokogiri (>= 1.5.9)
|
71
38
|
lumberjack (1.2.4)
|
72
39
|
method_source (1.0.0)
|
73
|
-
mini_portile2 (2.4.0)
|
74
|
-
minitest (5.14.0)
|
75
|
-
mysql2 (0.4.10)
|
76
40
|
nenv (0.3.0)
|
77
|
-
nokogiri (1.10.9)
|
78
|
-
mini_portile2 (~> 2.4.0)
|
79
41
|
notiffany (0.1.3)
|
80
42
|
nenv (~> 0.1)
|
81
43
|
shellany (~> 0.0)
|
82
|
-
pg (0.21.0)
|
83
44
|
pry (0.13.1)
|
84
45
|
coderay (~> 1.1)
|
85
46
|
method_source (~> 1.0)
|
@@ -87,19 +48,6 @@ GEM
|
|
87
48
|
byebug (~> 11.0)
|
88
49
|
pry (~> 0.13.0)
|
89
50
|
rack (2.2.2)
|
90
|
-
rack-test (1.1.0)
|
91
|
-
rack (>= 1.0, < 3)
|
92
|
-
rails-dom-testing (2.0.3)
|
93
|
-
activesupport (>= 4.2.0)
|
94
|
-
nokogiri (>= 1.6)
|
95
|
-
rails-html-sanitizer (1.3.0)
|
96
|
-
loofah (~> 2.3)
|
97
|
-
railties (6.0.3)
|
98
|
-
actionpack (= 6.0.3)
|
99
|
-
activesupport (= 6.0.3)
|
100
|
-
method_source
|
101
|
-
rake (>= 0.8.7)
|
102
|
-
thor (>= 0.20.3, < 2.0)
|
103
51
|
rake (12.3.3)
|
104
52
|
rb-fsevent (0.10.4)
|
105
53
|
rb-inotify (0.10.1)
|
@@ -120,31 +68,21 @@ GEM
|
|
120
68
|
rspec-support (~> 3.9.0)
|
121
69
|
rspec-support (3.9.3)
|
122
70
|
shellany (0.0.1)
|
123
|
-
sqlite3 (1.4.2)
|
124
71
|
thor (1.0.1)
|
125
|
-
thread_safe (0.3.6)
|
126
|
-
tzinfo (1.2.7)
|
127
|
-
thread_safe (~> 0.1)
|
128
72
|
yard (0.9.25)
|
129
|
-
zeitwerk (2.3.0)
|
130
73
|
|
131
74
|
PLATFORMS
|
132
75
|
ruby
|
133
76
|
|
134
77
|
DEPENDENCIES
|
135
|
-
activerecord (>= 6.0.0, < 6.1)
|
136
78
|
benchmark-ips
|
137
79
|
database_cleaner (~> 1.5, >= 1.5.3)
|
138
|
-
generator_spec (~> 0.9.4)
|
139
80
|
guard-rspec
|
140
81
|
mobility!
|
141
|
-
mysql2 (~> 0.4.9)
|
142
|
-
pg (< 1.0)
|
143
82
|
pry-byebug
|
144
83
|
rake (~> 12, >= 12.2.1)
|
145
84
|
rspec (~> 3.0)
|
146
|
-
sqlite3 (~> 1.4.1)
|
147
85
|
yard (~> 0.9.0)
|
148
86
|
|
149
87
|
BUNDLED WITH
|
150
|
-
1.
|
88
|
+
2.1.4
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,9 @@ require "bundler/gem_tasks"
|
|
2
2
|
require "rspec/core/rake_task"
|
3
3
|
require "yaml"
|
4
4
|
|
5
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
RSpec::Core::RakeTask.new(:spec) do |task|
|
6
|
+
task.rspec_opts = '-f p'
|
7
|
+
end
|
6
8
|
|
7
9
|
task :default => :spec
|
8
10
|
|
@@ -18,7 +20,7 @@ namespace :db do
|
|
18
20
|
desc "Create the database"
|
19
21
|
task create: :setup do
|
20
22
|
commands = {
|
21
|
-
"mysql" => "mysql -u #{config['username']} -e 'create database #{config["database"]} default character set #{config["encoding"]} default collate #{config["collation"]};' >/dev/null",
|
23
|
+
"mysql" => "mysql -h #{config['host']} -P #{config['port']} -u #{config['username']} --password=#{config['password']} -e 'create database #{config["database"]} default character set #{config["encoding"]} default collate #{config["collation"]};' >/dev/null",
|
22
24
|
"postgres" => "psql -c 'create database #{config['database']};' -U #{config['username']} >/dev/null"
|
23
25
|
}
|
24
26
|
%x{#{commands[driver] || true}}
|
@@ -28,7 +30,7 @@ namespace :db do
|
|
28
30
|
desc "Drop the database"
|
29
31
|
task drop: :setup do
|
30
32
|
commands = {
|
31
|
-
"mysql" => "mysql -u #{config['username']} -e 'drop database #{config["database"]};' >/dev/null",
|
33
|
+
"mysql" => "mysql -h #{config['host']} -P #{config['port']} -u #{config['username']} --password=#{config['password']} -e 'drop database #{config["database"]};' >/dev/null",
|
32
34
|
"postgres" => "psql -c 'drop database #{config['database']};' -U #{config['username']} >/dev/null"
|
33
35
|
}
|
34
36
|
%x{#{commands[driver] || true}}
|
@@ -42,8 +44,8 @@ namespace :db do
|
|
42
44
|
|
43
45
|
require orm
|
44
46
|
require "database"
|
45
|
-
require "#{orm}/schema"
|
46
47
|
DB = Mobility::Test::Database.connect(orm)
|
48
|
+
require "#{orm}/schema"
|
47
49
|
Mobility::Test::Schema.up
|
48
50
|
end
|
49
51
|
|
@@ -46,14 +46,18 @@ model class is generated.
|
|
46
46
|
def initialize(*attributes)
|
47
47
|
method_name_regex = /\A(#{attributes.join('|')})_([a-z]{2}(_[a-z]{2})?)(=?|\??)\z/.freeze
|
48
48
|
|
49
|
-
define_method :method_missing do |method_name, *
|
49
|
+
define_method :method_missing do |method_name, *args, &block|
|
50
50
|
if method_name =~ method_name_regex
|
51
|
-
|
51
|
+
attribute_method = "#{$1}#{$4}"
|
52
52
|
locale, suffix = $2.split('_')
|
53
53
|
locale = "#{locale}-#{suffix.upcase}" if suffix
|
54
|
-
|
54
|
+
if $4 == '=' # writer
|
55
|
+
public_send(attribute_method, args[0], **(args[1] || {}), locale: locale.to_sym)
|
56
|
+
else # reader
|
57
|
+
public_send(attribute_method, **(args[0] || {}), locale: locale.to_sym)
|
58
|
+
end
|
55
59
|
else
|
56
|
-
super(method_name, *
|
60
|
+
super(method_name, *args, &block)
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
data/lib/mobility/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Salzberg
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
gSQml7TqcC6dZRsZRwYqzD9kUwdAJoCqno2CBUKs2l0yQAjFT36lRrVJznb7uWwa
|
35
35
|
xpPFnsrtyaZW6Dty8TSG3qzmeGpmpIotA8x1VA==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2020-05-
|
37
|
+
date: 2020-05-27 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: request_store
|
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
rubygems_version: 3.0.
|
276
|
+
rubygems_version: 3.0.3
|
277
277
|
signing_key:
|
278
278
|
specification_version: 4
|
279
279
|
summary: Pluggable Ruby translation framework
|
metadata.gz.sig
CHANGED
Binary file
|