mobility 0.2.0 → 0.2.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -2
- data/CHANGELOG.md +8 -1
- data/CONTRIBUTING.md +4 -0
- data/Gemfile.lock +1 -1
- data/ISSUE_TEMPLATE.md +17 -0
- data/README.md +11 -5
- data/lib/mobility.rb +14 -9
- data/lib/mobility/backends/active_record/table.rb +0 -3
- data/lib/mobility/backends/key_value.rb +1 -1
- data/lib/mobility/backends/sequel/pg_hash.rb +1 -0
- data/lib/mobility/backends/sequel/table.rb +0 -3
- data/lib/mobility/backends/table.rb +4 -1
- data/lib/mobility/version.rb +1 -1
- data/lib/sequel/plugins/mobility.rb +1 -1
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b45f4c0840bad77be4560ae431f588df52415047
|
4
|
+
data.tar.gz: 8c455d55f69fc1fca96341d55911078512aa7aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c9c1b4ca0b560cf46ffe3a6e605fffe2733f8d7bde65d5b66a88b349673adcb25b4b7a9c1ad1558368b7446304eb6a049e765b70578ecca6c433b3fe8c5e221
|
7
|
+
data.tar.gz: 376c926ede76586be12286f7d8232066be02eccd0209d1e28526a08ed88138eeebe9e807da6a97e98c2a75581441bea251a16dcf48b359da147f147fad062343
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
����k
|
2
|
-
|
1
|
+
Y0n_C����q@-��Qv�Kl���&U~����h�c\2�t��E����w|k{���t!�0r�=w��`a�����������m�ہN�3�a��J�ض�c�f�꽏�,S��Jt�TK�nO5����Q%�ʯT��S�c>'e"י���z�
|
2
|
+
���"�m��O�
|
3
|
+
%��:A3�G�J�u��C�?U�y��;�3���|�|)�&0[f\�.���;���3E�'\$ݙɹP�K�6�5��i�6�
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Mobility Changelog
|
2
2
|
|
3
|
-
## 0.
|
3
|
+
## 0.2
|
4
|
+
|
5
|
+
### 0.2.1 (August 20, 2017)
|
6
|
+
|
7
|
+
* Fix missing requires in `Mobility::Backends::Sequel::PgHash` ([22df29](https://github.com/shioyama/mobility/commit/22df2946bcccadd7dff0880539ac828c42111adc))
|
8
|
+
* Only require Rails generators if both Rails and ActiveRecord are loaded ([03a9ff](https://github.com/shioyama/mobility/commit/03a9ffe7009332f81ea7197dbce00c357e8d4b0c))
|
4
9
|
|
5
10
|
### 0.2.0 (August 13, 2017)
|
6
11
|
|
@@ -19,6 +24,8 @@ post](http://dejimata.com/2017/8/13/mobility-0-2-now-with-plugins).
|
|
19
24
|
* Gem is now signed ([#73](https://github.com/shioyama/mobility/pull/73))
|
20
25
|
* Minimum Ruby version: 2.2.7
|
21
26
|
|
27
|
+
## 0.1
|
28
|
+
|
22
29
|
### 0.1.20 (July 23, 2017)
|
23
30
|
* Fix location of Rails generators to work with plugins
|
24
31
|
([#56](https://github.com/shioyama/mobility/pull/56))
|
data/CONTRIBUTING.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Thanks for your interest in contributing to Mobility! Contributions are welcomed and encouraged. Bug reports, feature requests, and refactoring are all a great help, but please follow the instructions below to ensure things go as smoothly as possible.
|
4
4
|
|
5
|
+
## Questions
|
6
|
+
|
7
|
+
If you have a question about *usage* which is not covered in the [readme](https://github.com/shioyama/mobility/blob/master/README.md), [wiki](https://github.com/shioyama/mobility/wiki) or [API documentation](http://www.rubydoc.info/gems/mobility), please post a question to StackOverflow tagged with the [mobility tag](https://stackoverflow.com/questions/tagged/mobility). Questions will not be answered in Github issues, which are reserved for actual bugs and feature requests.
|
8
|
+
|
5
9
|
## Bugs
|
6
10
|
|
7
11
|
Notice a bug or something that seems not to be working correctly? Great, that's valuable information. First off, make sure you go through the [Github issues](https://github.com/shioyama/mobility/issues?utf8=%E2%9C%93&q=is%3Aissue) to see if what you're experiencing has already been reported.
|
data/Gemfile.lock
CHANGED
data/ISSUE_TEMPLATE.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!--- Provide a general summary of the issue in the Title above -->
|
2
|
+
|
3
|
+
## Context
|
4
|
+
<!--- Provide a more detailed introduction to the issue itself, including what -->
|
5
|
+
<!--- backend/ORM you are using, what version of Mobility you are using, and -->
|
6
|
+
<!--- any other relevant configuration details. (Consider pasting your -->
|
7
|
+
<!--- Gemfile.lock in the issue text.) -->
|
8
|
+
|
9
|
+
## Expected Behavior
|
10
|
+
<!--- Tell us what should happen, preferably with a reproducible code example. -->
|
11
|
+
|
12
|
+
## Actual Behavior
|
13
|
+
<!--- Tell us what happens instead, with steps in code and actual output. -->
|
14
|
+
|
15
|
+
## Possible Fix
|
16
|
+
<!--- If you have an idea what is wrong and what would fix the issue, please -->
|
17
|
+
<!--- describe this possible fix. -->
|
data/README.md
CHANGED
@@ -47,16 +47,15 @@ Installation
|
|
47
47
|
Add this line to your application's Gemfile:
|
48
48
|
|
49
49
|
```ruby
|
50
|
-
gem 'mobility', '~> 0.2.
|
50
|
+
gem 'mobility', '~> 0.2.1'
|
51
51
|
```
|
52
52
|
|
53
53
|
Mobility is cryptographically signed. To be sure the gem you install hasn't
|
54
|
-
been tampered with,
|
55
|
-
certificate:
|
54
|
+
been tampered with, add my public key as a trusted certificate and install:
|
56
55
|
|
57
56
|
```
|
58
57
|
gem cert --add <(curl -Ls https://raw.github.com/shioyama/mobility/master/certs/shioyama.pem)
|
59
|
-
gem install
|
58
|
+
gem install mobility -P MediumSecurity
|
60
59
|
```
|
61
60
|
|
62
61
|
The MediumSecurity trust profile will verify signed gems, but allow the
|
@@ -733,7 +732,14 @@ class](http://www.rubydoc.info/gems/mobility/Mobility/Backend/Column).
|
|
733
732
|
Mobility also supports jsonb and Hstore storage options, if you are using
|
734
733
|
PostgreSQL as your database. To use this option, create column(s) on the model
|
735
734
|
table for each translated attribute, and set your backend to `:jsonb` or
|
736
|
-
`:hstore`.
|
735
|
+
`:hstore`. If you are using Sequel, note that you will need to enable the
|
736
|
+
[pg_json](http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_json_rb.html)
|
737
|
+
or
|
738
|
+
[pg_hstore](http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_hstore_rb.html)
|
739
|
+
extensions with `DB.extension :pg_json` or `DB.extension :pg_hstore` (where
|
740
|
+
`DB` is your database instance).
|
741
|
+
|
742
|
+
Other details are covered in the [Postgres
|
737
743
|
Backend](https://github.com/shioyama/mobility/wiki/Postgres-Backends) page of
|
738
744
|
the wiki and in the API documentation
|
739
745
|
([`Mobility::Backend::Jsonb`](http://www.rubydoc.info/gems/mobility/Mobility/Backend/Jsonb)
|
data/lib/mobility.rb
CHANGED
@@ -37,24 +37,29 @@ module Mobility
|
|
37
37
|
# General error for version compatibility conflicts
|
38
38
|
class VersionNotSupportedError < ArgumentError; end
|
39
39
|
|
40
|
+
begin
|
41
|
+
require "rails"
|
42
|
+
Loaded::Rails = true
|
43
|
+
rescue LoadError => e
|
44
|
+
raise unless e.message =~ /rails/
|
45
|
+
Loaded::Rails = false
|
46
|
+
end
|
47
|
+
|
40
48
|
begin
|
41
49
|
require "active_record"
|
42
50
|
raise VersionNotSupportedError, "Mobility is only compatible with ActiveRecord 4.2 and greater" if ::ActiveRecord::VERSION::STRING < "4.2"
|
43
|
-
require "mobility/active_model"
|
44
|
-
require "mobility/active_record"
|
45
51
|
Loaded::ActiveRecord = true
|
46
52
|
rescue LoadError => e
|
47
53
|
raise unless e.message =~ /active_record/
|
48
54
|
Loaded::ActiveRecord = false
|
49
55
|
end
|
50
56
|
|
51
|
-
|
52
|
-
require "
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
Loaded::Rails = false
|
57
|
+
if Loaded::ActiveRecord
|
58
|
+
require "mobility/active_model"
|
59
|
+
require "mobility/active_record"
|
60
|
+
if Loaded::Rails
|
61
|
+
require "rails/generators/mobility/generators"
|
62
|
+
end
|
58
63
|
end
|
59
64
|
|
60
65
|
begin
|
@@ -92,9 +92,6 @@ columns to that table.
|
|
92
92
|
|
93
93
|
require 'mobility/backends/active_record/table/query_methods'
|
94
94
|
|
95
|
-
# @return [Symbol] name of the association method
|
96
|
-
attr_reader :association_name
|
97
|
-
|
98
95
|
# @!group Backend Configuration
|
99
96
|
# @option options [Symbol] association_name (:translations)
|
100
97
|
# Name of association method
|
@@ -17,9 +17,6 @@ Implements the {Mobility::Backends::Table} backend for Sequel models.
|
|
17
17
|
|
18
18
|
require 'mobility/backends/sequel/table/query_methods'
|
19
19
|
|
20
|
-
# @return [Symbol] name of the association method
|
21
|
-
attr_reader :association_name
|
22
|
-
|
23
20
|
# @return [Symbol] class for translations
|
24
21
|
attr_reader :translation_class
|
25
22
|
|
@@ -66,6 +66,9 @@ set.
|
|
66
66
|
module Table
|
67
67
|
extend Backend::OrmDelegator
|
68
68
|
|
69
|
+
# @return [Symbol] name of the association method
|
70
|
+
attr_reader :association_name
|
71
|
+
|
69
72
|
# @!macro backend_constructor
|
70
73
|
# @option options [Symbol] association_name Name of association
|
71
74
|
def initialize(model, attribute, options = {})
|
@@ -81,7 +84,7 @@ set.
|
|
81
84
|
|
82
85
|
# @!macro backend_writer
|
83
86
|
def write(locale, value, options = {})
|
84
|
-
translation_for(locale, options).
|
87
|
+
translation_for(locale, options).send("#{attribute}=", value)
|
85
88
|
end
|
86
89
|
# @!endgroup
|
87
90
|
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Salzberg
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
eGDROPZoL5RXwiOnRbexxa7dcAxMrDfGB/hpiunIPWPsi4n5P7K/6OO/sGVMl9xv
|
31
31
|
SZBPXjzrHdyOFLBYXB+PG7s3F/4=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2017-08-
|
33
|
+
date: 2017-08-20 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: request_store
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- Gemfile
|
156
156
|
- Gemfile.lock
|
157
157
|
- Guardfile
|
158
|
+
- ISSUE_TEMPLATE.md
|
158
159
|
- LICENSE.txt
|
159
160
|
- README.md
|
160
161
|
- Rakefile
|
metadata.gz.sig
CHANGED
Binary file
|