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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb56f22bb9dfb01fa0520b7793659d1561fc152403e6ec83b096a55c0d1caa2c
|
4
|
+
data.tar.gz: fa519f996fd694af8c1d3a9e8f35bd75d4211036cc2771fe534502d4aee7e991
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
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
|
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.
|
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:
|
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.
|
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.
|
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.
|
109
|
+
rubygems_version: 3.4.14
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Rails url shortener engine.
|