rails_url_shortener 0.2.8 → 0.2.9

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
  SHA256:
3
- metadata.gz: c3d8d9dee3b53854064eb7c0c9c870c3c4c29e1d9aec303d57998583a38f1b1a
4
- data.tar.gz: 370c4f8f6ff0c5dfa73fe831d2c99e1f0b07f8e1a1aa662beb59f587eb261774
3
+ metadata.gz: eb56f22bb9dfb01fa0520b7793659d1561fc152403e6ec83b096a55c0d1caa2c
4
+ data.tar.gz: fa519f996fd694af8c1d3a9e8f35bd75d4211036cc2771fe534502d4aee7e991
5
5
  SHA512:
6
- metadata.gz: a46af0298e6877c3f5d3abe77bda82a26f1a8808164792a3b7108479e486ca2e72c7ca14effb99a74ad11baf990c201421b3c19ca6277af0663294aace67a769
7
- data.tar.gz: 7c118227b4abb2e6cb2ad6893e5693ec9124779481eed590e9c4ef7b11645ded4889a1a1380f833b1827edcfeb46e3d912fcf1268e500247935f106d61f9ed33
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.8'
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.8
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-07-01 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.8
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.8
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.