repolho 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7315e78763de32bb1edec0e9ad337fd3ce360d189bee8ad978b4305120b181bd
4
- data.tar.gz: 50f94f0d3227d78d60da48b6e808161aae2a6445a9dbc911f3e6c4b300fb97e5
3
+ metadata.gz: a3e4934d30d047214771997a27514e112e4fdeb21f7eed8aacb708780faef774
4
+ data.tar.gz: 0c3a81c167092259ca264d0b79187223686ad1057a42bd09c619539d8822f2a4
5
5
  SHA512:
6
- metadata.gz: 6e77ee42e3d53fd9cbab4183159810e54ec3f5422ed224ec74c4e6302bdf3f41b878046e393ec5e4df536aba9322d552a20a29aa4802402224892a716a85f8c2
7
- data.tar.gz: aa3025ab2b9e9437b0bd56307deb39215c068b65857926a1fddac26d72e87243665812e34c7ede99fea32c12f8c450246e3d5b7e1edc9af0d446dcf4a2a77eb7
6
+ metadata.gz: 628f99c9f6b261d09197974030b9d9e733914fe531762bed01ec524ed1c7f803d84efb5726dd67965aa7fbf3e3e87b80677eede46e941e7ef12e25a6f5046114
7
+ data.tar.gz: 891ede10e5b285ac7bd809b805fc7a3cbaecf432f5ed9c737cf63a986ef59ced396fa35b6172128d50bc696e13bbabdf580ef77210733ea120311a4572147314
checksums.yaml.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -262,18 +262,35 @@ Repolho.include_rails_helpers!(
262
262
 
263
263
  ### Outside Rails
264
264
 
265
- You need the corresponding gems and must require them before calling the method:
265
+ You need the corresponding gems. Directly requiring the individual helper file
266
+ triggers an autoload problem in recent Rails versions, so load the helpers
267
+ framework first:
266
268
 
267
269
  ```ruby
268
270
  # Gemfile
269
271
  gem "actionview"
270
- # or, if you prefer the lower-level helpers:
271
- # gem "activesupport"
272
272
 
273
- require "action_view/helpers/number_helper"
273
+ require "action_view"
274
+ require "action_view/helpers" # loads NumberHelper and the rest
274
275
  Repolho.include_rails_helpers!
275
276
  ```
276
277
 
278
+ Alternatively (and often simpler), use `ActiveSupport::NumberHelper`, which is
279
+ designed to be used outside of a view context. The method names are almost the
280
+ same (`number_to_currency`, `number_to_rounded`, etc.):
281
+
282
+ ```ruby
283
+ # Gemfile
284
+ gem "activesupport"
285
+
286
+ require "active_support/number_helper"
287
+ Repolho.include_rails_helpers!(ActiveSupport::NumberHelper)
288
+ ```
289
+
290
+ Note: some method names differ slightly between the two modules
291
+ (`number_with_delimiter` vs `number_to_delimited`). Prefer the ActiveSupport
292
+ version when you are not inside Rails.
293
+
277
294
  Instance variables from the Rails view (such as `@current_template`) are not
278
295
  automatically copied. Pass them explicitly through the `locals` hash:
279
296
 
@@ -283,6 +300,7 @@ Repolho::Main.new(path, data, current_template: @current_template, user: current
283
300
 
284
301
  They become `@current_template` and `@user` inside the templates.
285
302
 
303
+
286
304
  ## Signing
287
305
 
288
306
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Repolho
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/repolho.rb CHANGED
@@ -19,6 +19,10 @@ module Repolho
19
19
  # Repolho.include_rails_helpers!(ActionView::Helpers::NumberHelper, ActionView::Helpers::TextHelper)
20
20
  def self.include_rails_helpers!(*modules)
21
21
  modules = [ActionView::Helpers::NumberHelper] if modules.empty?
22
- modules.each { |mod| Container.include(mod) }
22
+ modules.each do |mod|
23
+ next if Container.include?(mod)
24
+
25
+ Container.include(mod)
26
+ end
23
27
  end
24
28
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repolho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eustáquio Rangel
metadata.gz.sig CHANGED
@@ -1,3 +1,5 @@
1
-
2
- G�X�]��� Rr��Ʒݠ�<O�"�>.g<��2�hd�@U?W�B^!c��K�a��[/"�+� V�C�/KY0ջ�L�a�S�=9��5䰿�,+nl�
3
- ���Q���52���m'�_q.�x"<(�ySb��80hBQUT�3�E��!~f��?���F��Ϸ�]uَ�t�3��G����D��U�,�,;MY@�Q�V�"�e�@���;��)�5�w�m��vQ�9� R���m��~
1
+ {�A���2VVQ���u��3�j�r����c=ed)A�h�rqs��d�|�3�a:|�Ck�v�r�z��0�g18\�)�d��b�Aۻ�rrk'ٞ/;yB��-�n){\�zd��b�O�H�ZN��������q��~R���0��� 2���|h�/�~�KY�ڍI�Rx��/d�����f�x&�I�3)����x��?�z�������?�6^�
2
+ f����i��Ĕ�6;h�K���1Y'����
3
+ ��8s<NB|��
4
+ �X�0��q|��� c�.0P8����
5
+ �/