rails_url_shortener 0.2.7 → 0.2.9

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: 8d569d3fd17542a9fd16a932d904e6fab08bf27e75ad45bd331a4d2baebfd8e9
4
- data.tar.gz: ef092c5b80463d59f1597c3a3914024e5fe444d98c0908f5559a65baf51b06bd
3
+ metadata.gz: eb56f22bb9dfb01fa0520b7793659d1561fc152403e6ec83b096a55c0d1caa2c
4
+ data.tar.gz: fa519f996fd694af8c1d3a9e8f35bd75d4211036cc2771fe534502d4aee7e991
5
5
  SHA512:
6
- metadata.gz: 3ab36211b6978eec32353b155fe1232b9d81933d943a7c283a93709c8d9978c529c556eb88988b06c02f3b9f0f7766e215978f628ba156902d1a91bfd538932b
7
- data.tar.gz: 36d43a73060aa771d85cbb3765cde7f18d741e899fd42617a2ae740e2efe8b8f2b1286e34839cdeaf3acb0601b3f83ce3af3bf3ba4a591543097e51428f8e51a
6
+ metadata.gz: 8cc0b73eec14701368de967c3bf20e96cfc9c3fa53342c80d474329b723f27451d7235f7a2ed30d5656540af1eb746bd2148700804ac2d7ab10805568e80165e
7
+ data.tar.gz: 2a3cf586ac8ee40b56ae28cae470e66f0214b5037e129013ab99ab56a3bcf418bf973fbb14ddf1ff2eaaa79fe2086f53c61e264e9132485ec71c3a4151313785
data/README.md CHANGED
@@ -108,7 +108,7 @@ Then execute:
108
108
  bundle
109
109
  ```
110
110
 
111
- And finally install the migrations on your project and migrate:
111
+ And finally install & run the migrations on your project and migrate:
112
112
  ```bash
113
113
  bin/rails rails_url_shortener:install:migrations db:migrate
114
114
  ```
@@ -69,6 +69,13 @@ module RailsUrlShortener
69
69
  )
70
70
  end
71
71
 
72
+ ##
73
+ # Function for help to build the full short url when you have the object.
74
+ #
75
+ def to_short_url
76
+ RailsUrlShortener.host + Rails.application.routes.url_helpers.rails_url_shortener_path + "/#{key}"
77
+ end
78
+
72
79
  private
73
80
 
74
81
  def key_candidate
@@ -6,7 +6,7 @@ CHARSETS = {
6
6
  alphanumcase: ('A'..'Z').to_a + ('a'..'z').to_a + (0..9).to_a
7
7
  }.freeze
8
8
 
9
- RailsUrlShortener.host = 'localhost:3000' # the host used for the helper
9
+ RailsUrlShortener.host = ENV['HOST'] || 'localhost:3000' # the host used for the helper.
10
10
  RailsUrlShortener.default_redirect = '/' # where the users are redirect if the link is not found.
11
11
  RailsUrlShortener.charset = CHARSETS[:alphanumcase] # used for generate the keys, better long.
12
12
  RailsUrlShortener.key_length = 6 # Key length for random generator
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsUrlShortener
4
- VERSION = '0.2.7'
4
+ VERSION = '0.2.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_url_shortener
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-23 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser
@@ -87,9 +87,9 @@ licenses:
87
87
  - GPL-3.0
88
88
  metadata:
89
89
  bug_tracker_uri: https://www.github.com/a-chacon/rails-url-shortener/issues
90
- changelog_uri: https://www.github.com/a-chacon/rails-url-shortener/releases/tag/v0.2.7
90
+ changelog_uri: https://www.github.com/a-chacon/rails-url-shortener/releases/tag/v0.2.9
91
91
  documentation_uri: https://github.com/a-chacon/rails-url-shortener/blob/main/README.md
92
- source_code_uri: https://github.com/a-chacon/rails-url-shortener/tree/v0.2.7
92
+ source_code_uri: https://github.com/a-chacon/rails-url-shortener/tree/v0.2.9
93
93
  rubygems_mfa_required: 'true'
94
94
  post_install_message:
95
95
  rdoc_options: []
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: 1.8.11
108
108
  requirements: []
109
- rubygems_version: 3.2.22
109
+ rubygems_version: 3.4.14
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Rails url shortener engine.