mobility 1.0.0 → 1.0.1
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 +4 -2
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +23 -7
- data/Gemfile +5 -16
- data/Gemfile.lock +4 -4
- data/README.md +3 -6
- data/lib/mobility/plugin.rb +2 -2
- data/lib/mobility/plugins/active_record/query.rb +5 -5
- data/lib/mobility/version.rb +1 -1
- data/lib/rails/generators/mobility/templates/initializer.rb +1 -1
- metadata +2 -2
- 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: cf9b852c3efdabe4bf4bd64e29a036f93b02169614965e37621f3f8b54315c7a
|
4
|
+
data.tar.gz: 3f4b71f87943fabcb6eae21c1960ffb20cb555cbb487c16a213ec4a5bb4f4824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49c5b97f0f2c4d1e260fa49b663334aca25fd8c0bbe5aa958a104d6cbbba31a6a6ea4403bb930f315258f2b07ef533fae0891f9fb189645ed2f1be56ff6e86ff
|
7
|
+
data.tar.gz: d132e09bc34036fdf7fe8cda20a7c337e714415b1999fdfd9319148e8584d3567a7f1fc494842bacbaebdb0881fc9b46b49a86b7de6a6ff8cc791f4feaf5192c
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
'ʧ˷���r�&ROt&K7�*�HXiNz[��6M��>�vZi��n?� �u����M �k�t��k�
|
2
|
+
�.����ͻ�>�h��`<�{��t�t7]��
|
3
|
+
_~.�!�TC�"77��?��ܞ3tz5G9UI��j�i�A�
|
4
|
+
|D7E�4F"L{ �5�?�|�̸�<�me�4�v�U<d��������US�h!���6~�;���m}�VE�4q^�g��um�XgY�bK�ی��KtX��pj���X*��
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,31 +1,47 @@
|
|
1
1
|
# Mobility Changelog
|
2
2
|
|
3
|
+
### Unreleased
|
4
|
+
- Remove `Mobility::Plugins::Attributes#each`
|
5
|
+
([#475](https://github.com/shioyama/mobility/pull/475))
|
6
|
+
- Add public method `Mobility::Plugins::ActiveRecord::Query.build_query`
|
7
|
+
([#471](https://github.com/shioyama/mobility/pull/471))
|
8
|
+
|
3
9
|
## 1.0
|
4
10
|
|
5
|
-
1.0 is a rewrite of many internals of the gem. Please see the [wiki page on
|
11
|
+
1.0 is a rewrite of many internals of the gem. Please see the [wiki page on
|
12
|
+
v1.0](https://github.com/shioyama/mobility/wiki/Introduction-to-Mobility-v1.0)
|
13
|
+
for more details on how to upgrade.
|
14
|
+
|
15
|
+
### 1.0.1
|
16
|
+
|
17
|
+
- Make `Mobility::Plugins::ActiveRecord::Query::VirtualRow` and
|
18
|
+
`Mobility::Plugins::ActiveRecord::Query::QueryExtension`
|
19
|
+
([#471](https://github.com/shioyama/mobility/pull/471)) public
|
20
|
+
- Fix typo in initializer template
|
21
|
+
([#474](https://github.com/shioyama/mobility/pull/474))
|
6
22
|
|
7
|
-
|
23
|
+
### 1.0.0
|
8
24
|
|
9
25
|
- Fix setting a locale from Rails config
|
10
26
|
([#468](https://github.com/shioyama/mobility/pull/468)) thanks
|
11
27
|
[sergey-alekseev](https://github.com/sergey-alekseev)!
|
12
28
|
- Fixes validations with validates_uniqueness_of
|
13
29
|
([#470](https://github.com/shioyama/mobility/pull/470)) thanks
|
14
|
-
[artplan1](https://github.com/
|
30
|
+
[artplan1](https://github.com/artplan1)!
|
15
31
|
|
16
|
-
|
32
|
+
### 1.0.0.rc1 (pre-release)
|
17
33
|
|
18
34
|
- Remove `Mobility::ActiveRecord`, `Mobility::Sequel` and `Mobility::Arel`, and
|
19
35
|
general cleanup ([#464](https://github.com/shioyama/mobility/pull/464))
|
20
36
|
|
21
|
-
|
37
|
+
### 1.0.0.beta2 (pre-release)
|
22
38
|
|
23
39
|
- Refactor attributes & backend plugins and make `mobility_attributes` public
|
24
40
|
([#462](https://github.com/shioyama/mobility/pull/462))
|
25
41
|
- Make attribute_methods plugin depend on attributes
|
26
42
|
([#461](https://github.com/shioyama/mobility/pull/461))
|
27
43
|
|
28
|
-
|
44
|
+
### 1.0.0.beta1 (pre-release)
|
29
45
|
|
30
46
|
- Remove `Mobility::Backend#apply_plugin`
|
31
47
|
([#454](https://github.com/shioyama/mobility/pull/454))
|
@@ -36,7 +52,7 @@
|
|
36
52
|
- Fix Ruby 2.7 deprecation warnings
|
37
53
|
([#460](https://github.com/shioyama/mobility/pull/460))
|
38
54
|
|
39
|
-
|
55
|
+
### 1.0.0.alpha (pre-release)
|
40
56
|
|
41
57
|
- Default fallbacks plugin to `true` when enabled
|
42
58
|
([#447](https://github.com/shioyama/mobility/pull/447))
|
data/Gemfile
CHANGED
@@ -8,20 +8,11 @@ orm, orm_version = ENV['ORM'], ENV['ORM_VERSION']
|
|
8
8
|
group :development, :test do
|
9
9
|
case orm
|
10
10
|
when 'active_record'
|
11
|
-
orm_version ||= '6.
|
11
|
+
orm_version ||= '6.1'
|
12
12
|
case orm_version
|
13
|
-
when '4.2'
|
14
|
-
gem 'activerecord',
|
15
|
-
when '
|
16
|
-
gem 'activerecord', '>= 5.0', '< 5.1'
|
17
|
-
when '5.1'
|
18
|
-
gem 'activerecord', '>= 5.1', '< 5.2'
|
19
|
-
when '5.2'
|
20
|
-
gem 'activerecord', '>= 5.2.0', '< 5.3'
|
21
|
-
gem 'railties', '>= 5.2.0.rc2', '< 5.3'
|
22
|
-
when '6.0'
|
23
|
-
gem 'activerecord', '>= 6.0.0', '< 6.1'
|
24
|
-
when '6.1'
|
13
|
+
when '4.2', '5.0', '5.1', '5.2', '6.0', '6.1'
|
14
|
+
gem 'activerecord', "~> #{orm_version}.0"
|
15
|
+
when '6.2'
|
25
16
|
git 'https://github.com/rails/rails.git' do
|
26
17
|
gem 'activerecord'
|
27
18
|
gem 'activesupport'
|
@@ -32,10 +23,8 @@ group :development, :test do
|
|
32
23
|
when 'sequel'
|
33
24
|
orm_version ||= '5'
|
34
25
|
case orm_version
|
35
|
-
when '4'
|
36
|
-
gem 'sequel', '>= 4.46.0', '< 5.0'
|
37
26
|
when '5'
|
38
|
-
gem 'sequel',
|
27
|
+
gem 'sequel', "~> #{orm_version}.0"
|
39
28
|
else
|
40
29
|
raise ArgumentError, 'Invalid Sequel version'
|
41
30
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mobility (1.0.0
|
4
|
+
mobility (1.0.0)
|
5
5
|
i18n (>= 0.6.10, < 2)
|
6
6
|
request_store (~> 1.0)
|
7
7
|
|
@@ -83,16 +83,16 @@ GEM
|
|
83
83
|
shellany (0.0.1)
|
84
84
|
thor (1.0.1)
|
85
85
|
thread_safe (0.3.6)
|
86
|
-
tzinfo (1.2.
|
86
|
+
tzinfo (1.2.9)
|
87
87
|
thread_safe (~> 0.1)
|
88
88
|
yard (0.9.25)
|
89
|
-
zeitwerk (2.4.
|
89
|
+
zeitwerk (2.4.2)
|
90
90
|
|
91
91
|
PLATFORMS
|
92
92
|
ruby
|
93
93
|
|
94
94
|
DEPENDENCIES
|
95
|
-
activerecord (
|
95
|
+
activerecord (~> 6.0.0)
|
96
96
|
benchmark-ips
|
97
97
|
database_cleaner (~> 1.5, >= 1.5.3)
|
98
98
|
guard-rspec
|
data/README.md
CHANGED
@@ -13,8 +13,8 @@ Mobility
|
|
13
13
|
[wiki]: https://github.com/shioyama/mobility/wiki
|
14
14
|
|
15
15
|
**This is the readme for version 1.0 of Mobility. If you are using an earlier
|
16
|
-
version (0.8.x or earlier), you probably want the readme on the [0-8
|
17
|
-
branch](https://github.com/shioyama/mobility/tree/0-8
|
16
|
+
version (0.8.x or earlier), you probably want the readme on the [0-8
|
17
|
+
branch](https://github.com/shioyama/mobility/tree/0-8).**
|
18
18
|
|
19
19
|
Mobility is a gem for storing and retrieving translations as attributes on a
|
20
20
|
class. These translations could be the content of blog posts, captions on
|
@@ -56,12 +56,9 @@ To use the latest pre-version of Mobility 1.0, add this line to your
|
|
56
56
|
application's Gemfile:
|
57
57
|
|
58
58
|
```ruby
|
59
|
-
gem 'mobility', '~> 1.0.
|
59
|
+
gem 'mobility', '~> 1.0.1'
|
60
60
|
```
|
61
61
|
|
62
|
-
For the latest stable version of Mobility, see the readme on the
|
63
|
-
[0-8-stable](https://github.com/shioyama/mobility/tree/0-8-stable) branch.
|
64
|
-
|
65
62
|
### ActiveRecord (Rails)
|
66
63
|
|
67
64
|
Requirements:
|
data/lib/mobility/plugin.rb
CHANGED
@@ -121,8 +121,8 @@ Also includes a +configure+ class method to apply plugins to a pluggable
|
|
121
121
|
# Does this class include all plugins this plugin depends (directly) on?
|
122
122
|
# @param [Class] klass Pluggable class
|
123
123
|
def dependencies_satisfied?(klass)
|
124
|
-
|
125
|
-
(
|
124
|
+
plugin_keys = klass.included_plugins.map { |plugin| Plugins.lookup_name(plugin) }
|
125
|
+
(dependencies.keys - plugin_keys).none?
|
126
126
|
end
|
127
127
|
|
128
128
|
# Specifies a dependency of this plugin.
|
@@ -67,9 +67,9 @@ enabled for any one attribute on the model.
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
70
|
+
# Creates a "clean room" for manipulating translated attribute nodes in
|
71
|
+
# an instance-eval'ed block. Inspired by Sequel's (much more
|
72
|
+
# sophisticated) virtual rows.
|
73
73
|
class VirtualRow < BasicObject
|
74
74
|
attr_reader :__backends
|
75
75
|
|
@@ -108,7 +108,7 @@ enabled for any one attribute on the model.
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
111
|
-
private_constant :QueryMethod
|
111
|
+
private_constant :QueryMethod
|
112
112
|
|
113
113
|
module QueryExtension
|
114
114
|
def where!(opts, *rest)
|
@@ -273,7 +273,7 @@ enabled for any one attribute on the model.
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
|
-
private_constant :
|
276
|
+
private_constant :FindByMethods
|
277
277
|
end
|
278
278
|
|
279
279
|
class MissingBackend < Mobility::Error; end
|
data/lib/mobility/version.rb
CHANGED
@@ -108,7 +108,7 @@ Mobility.configure do
|
|
108
108
|
#
|
109
109
|
# Adds translated attributes to +attributes+ hash, and defines methods
|
110
110
|
# +translated_attributes+ and +untranslated_attributes+ which return hashes
|
111
|
-
# with
|
111
|
+
# with translated and untranslated attributes, respectively. Be aware that
|
112
112
|
# this plugin can create conflicts with other gems.
|
113
113
|
#
|
114
114
|
# attribute_methods
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
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-12-
|
37
|
+
date: 2020-12-21 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: request_store
|
metadata.gz.sig
CHANGED
Binary file
|