tanshuku 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/tanshuku/url.rb +7 -0
- data/lib/tanshuku/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 797579e31bb1b82be39ee3e1e9b47cab79bd93db8088ef07f2a442c0f843b71b
|
4
|
+
data.tar.gz: 96fde025c079c4253338bc58bd487075f93b50262247e1349eb2c56d3fc26a16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32be6ddbfd71a34393bb100f8a5382ef456e3c856598f5b9947a8fa8aa292b6578e4150cda40aec4125c022ad8a55449b71df00916a0b1c9c42a5aac8fe578ab
|
7
|
+
data.tar.gz: 5becf84144a9a733310fd8d7a871f7e66921d6ef9f84400c618ee1a3c6ad43413693f30090f80ecca293dabe513927f3f81638dc98066d03a46ff1d0ebd512c6
|
data/app/models/tanshuku/url.rb
CHANGED
@@ -41,6 +41,13 @@ module Tanshuku
|
|
41
41
|
original_url
|
42
42
|
end
|
43
43
|
|
44
|
+
def self.find_by_url(url)
|
45
|
+
normalized_url = normalize_url(url)
|
46
|
+
hashed_url = hash_url(normalized_url)
|
47
|
+
|
48
|
+
find_by(hashed_url:)
|
49
|
+
end
|
50
|
+
|
44
51
|
# Normalize a trailing slash, `?` for an empty query, and so on, and sort query keys.
|
45
52
|
def self.normalize_url(url)
|
46
53
|
parsed_url = Addressable::URI.parse(url)
|
data/lib/tanshuku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tanshuku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kg8m
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|