mobility 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65312461ae32cbb2024100f6a3676ac28949a35b
4
- data.tar.gz: 7cebc1fb0666104ab1514beb5966ee711057a178
3
+ metadata.gz: b45f4c0840bad77be4560ae431f588df52415047
4
+ data.tar.gz: 8c455d55f69fc1fca96341d55911078512aa7aed
5
5
  SHA512:
6
- metadata.gz: 6a9962e0d3ab3fede8e8de43604435bdbfe2362a56dfaeada04a18cdf1c018060ca3e2f95e96f86eb7fc4cf4e22ed8ff5b7be713f72fe69ad4721619d248cb65
7
- data.tar.gz: 294e4a19db85fd3b7645455167f974d6995334a12582a07a3501bbecfb7e6129a0832bb7368036d49357c807c3c798976bcbab2ce4e4d8f88ac9c2109d60e9f1
6
+ metadata.gz: 8c9c1b4ca0b560cf46ffe3a6e605fffe2733f8d7bde65d5b66a88b349673adcb25b4b7a9c1ad1558368b7446304eb6a049e765b70578ecca6c433b3fe8c5e221
7
+ data.tar.gz: 376c926ede76586be12286f7d8232066be02eccd0209d1e28526a08ed88138eeebe9e807da6a97e98c2a75581441bea251a16dcf48b359da147f147fad062343
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ����k�`�,m�~�(�����GnxZlBµ���7d�́��'�/�� Y��,b�!��65��e��H��Z 2H�T���g�)r��P_��ʩ��(i���(���Ӕ�D�+L�A�:z�b�(�(�@���2e�K���ʰ�Rjg:��s� �s48`�`��Ѳ&;����Һ������b$XE�CwKX5��ڦ�M@�;=㠸O�7�=��o�Y8�1{=bjl.X�E-H+�s�
2
- =��St��
1
+ Y0n_C����q@-��Qv�Kl���&U~����h�c\2�t��E����w|k{���t!�0r�=w��`a�������� ���m�ہN3� a��J�ض�c�f�꽏�,S��JtTKnO5����Q%�ʯT��Sc>'e"י���z�
2
+ ���"�m��O�
3
+ %��:A3�G�J�u��C�?U�y��;�3���|�|)�&0[f\�.���;���3E�'\$ݙɹP�K�6�5��i�6�
@@ -1,6 +1,11 @@
1
1
  # Mobility Changelog
2
2
 
3
- ## 0.1
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))
@@ -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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mobility (0.2.0.alpha)
4
+ mobility (0.2.0)
5
5
  i18n (>= 0.6.10, < 0.9)
6
6
  request_store (~> 1.0)
7
7
 
@@ -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.0'
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, first my public key (if you haven’t already) as a trusted
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 shioyama -P MediumSecurity
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`. Other details are covered in the [Postgres
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)
@@ -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
- begin
52
- require "rails"
53
- Loaded::Rails = true
54
- require "rails/generators/mobility/generators"
55
- rescue LoadError => e
56
- raise unless e.message =~ /rails/
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
@@ -62,7 +62,7 @@ class.
62
62
 
63
63
  # @!macro backend_reader
64
64
  def write(locale, value, options = {})
65
- translation_for(locale, options).tap { |t| t.value = value }.value
65
+ translation_for(locale, options).value = value
66
66
  end
67
67
  # @!endgroup
68
68
 
@@ -2,6 +2,7 @@ require "mobility/util"
2
2
  require "mobility/backends/sequel"
3
3
  require "mobility/backends/hash_valued"
4
4
  require "mobility/backend/stringify_locale"
5
+ require "mobility/sequel/column_changes"
5
6
 
6
7
  module Mobility
7
8
  module Backends
@@ -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).tap { |t| t.send("#{attribute}=", value) }.send(attribute)
87
+ translation_for(locale, options).send("#{attribute}=", value)
85
88
  end
86
89
  # @!endgroup
87
90
 
@@ -1,3 +1,3 @@
1
1
  module Mobility
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -3,7 +3,7 @@ module Sequel
3
3
  module Mobility
4
4
  module InstanceMethods
5
5
  def self.included(base)
6
- base.include(::Mobility)
6
+ base.extend ::Mobility
7
7
  end
8
8
  end
9
9
  end
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.0
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-13 00:00:00.000000000 Z
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