bible270 0.16.0 → 0.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3190cb926559301bfff8450c5e4f3d32867d84528c795782f33786c8f49b5a9f
4
- data.tar.gz: df04e7e7a97b995c86c3440a81bea7db90360617cb990bc60975aca5d11e1669
3
+ metadata.gz: f5518f1eb25a21f7610ea80c8cd46e1d49690716bf98b5644fb3fa443f920a0e
4
+ data.tar.gz: 384ec828a091ed3c71abeb71a1d5b5f7d1cb7ff707f997511ca5e6d411cc5095
5
5
  SHA512:
6
- metadata.gz: a535dc114386b817d3e501ebb363d52f5898e8d99b10212a414c0bb760fb1f707cc09ed24298ffbeccc7e648f87ee9afadedd2bdcf0951253a3e8aa6d3348bda
7
- data.tar.gz: 66b8697402e10bfd1ac99b6aa3b08728a1116521d93dbfbb41ecd2e979b7f34682f185786f27d5a23c154d892470ec679b3e596d01c220da99764fc545e361e6
6
+ metadata.gz: f222369a58be11fb62c8fd76be668aad9010f76f3d88e9d9820d562eefce7becbe7e9b4fd7dd4dfa5e2408c256762fdd91da44942447328fa69782698e387789
7
+ data.tar.gz: c1f881c35558530bb27636a2fcd27a0f40ebb9cdc37e9f07cc10fda04aa78ddcfff65f8b210575c10640b46400616727e28ddc3b8594fd9cfa91dd19ac658a3b
@@ -35,23 +35,28 @@ module Bible270
35
35
 
36
36
  # A mailer has no request, so the host is config.mailer_host or nothing. No
37
37
  # link is better than a broken one.
38
+ #
39
+ # The mount prefix needs no help: a mounted engine's url_helpers already
40
+ # resolve it from the real mount point in routes.rb. Passing script_name from
41
+ # config.mount_at was worse than useless — ignored when blank, and overriding
42
+ # the true prefix when not, so a config that disagreed with routes.rb would
43
+ # have produced links to nowhere.
38
44
  def day_url_for(day)
39
- host = Bible270.config.mailer_host
40
- return nil if host.blank?
41
-
42
- Bible270::Engine.routes.url_helpers.day_url(
43
- day, host: host, protocol: host.start_with?('localhost') ? 'http' : 'https'
44
- )
45
- rescue StandardError
46
- nil
45
+ engine_url(:day_url, day)
47
46
  end
48
47
 
49
48
  def admin_url_for(reader)
49
+ engine_url(:admin_reader_url, reader)
50
+ end
51
+
52
+ def engine_url(helper, *)
50
53
  host = Bible270.config.mailer_host
51
54
  return nil if host.blank?
52
55
 
53
- Bible270::Engine.routes.url_helpers.admin_reader_url(
54
- reader, host: host, protocol: host.start_with?('localhost') ? 'http' : 'https'
56
+ Bible270::Engine.routes.url_helpers.public_send(
57
+ helper, *,
58
+ host: host,
59
+ protocol: host.start_with?('localhost') ? 'http' : 'https'
55
60
  )
56
61
  rescue StandardError
57
62
  nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bible270
4
- VERSION = '0.16.0'
4
+ VERSION = '0.16.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible270
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft