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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +22 -4
- data/lib/repolho/version.rb +1 -1
- data/lib/repolho.rb +5 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3e4934d30d047214771997a27514e112e4fdeb21f7eed8aacb708780faef774
|
|
4
|
+
data.tar.gz: 0c3a81c167092259ca264d0b79187223686ad1057a42bd09c619539d8822f2a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
|
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
|
|
data/lib/repolho/version.rb
CHANGED
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
|
|
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
metadata.gz.sig
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
�/
|