redirectly 0.1.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/redirectly/app.rb +3 -4
- data/lib/redirectly/command.rb +4 -2
- data/lib/redirectly/version.rb +1 -1
- data/lib/redirectly.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63b305a59fc4d5381391df73f884b91f59c815dc970559828cc5712be4df530f
|
4
|
+
data.tar.gz: 70bbd12337717b1df14f3ece87f638a0e629e24949b8788b468ca3ab6dbd9387
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 290704128855a3587277ba607737f27701860e9ad0760c1c6f6bfed91c44670ed826deff7cad7a6120f3c3b0b1fcd23f2d620edb88f588e8cbb263524f4d8b0e
|
7
|
+
data.tar.gz: 8122538c649f2a946ba6b70fbbe5218d8761511c13f7ed0bde8202eb52727bd089650d403588f1d996f9d54bc919c29f4fe6043d1fdf9415713a7c8959b917bc
|
data/README.md
CHANGED
@@ -64,7 +64,7 @@ $ redirectly --init
|
|
64
64
|
$ redirectly
|
65
65
|
|
66
66
|
# In another terminal, access the server using one of the configured rules
|
67
|
-
$ curl -v something.
|
67
|
+
$ curl -v something.localhost:3000
|
68
68
|
```
|
69
69
|
|
70
70
|
You should receive a redirect header:
|
@@ -94,7 +94,8 @@ example.com = https://other-site.com/
|
|
94
94
|
*.mygoogle.com/:anything = https://google.com/?q=%{anything}
|
95
95
|
example.org/* = https://other-site.com/
|
96
96
|
*.old-site.com = !https://permanent.redirect.com
|
97
|
-
:sub.
|
97
|
+
:sub.app.localhost/* = http://it-works.com/%{sub}
|
98
|
+
(*)old-domain.com/*rest = http://new-domain.com/%{rest}
|
98
99
|
```
|
99
100
|
|
100
101
|
For additional server options, see:
|
data/lib/redirectly/app.rb
CHANGED
@@ -33,11 +33,11 @@ module Redirectly
|
|
33
33
|
target = target[1..]
|
34
34
|
end
|
35
35
|
|
36
|
-
[code, { '
|
36
|
+
[code, { 'location' => target }, []]
|
37
37
|
end
|
38
38
|
|
39
39
|
def not_found
|
40
|
-
[404, { '
|
40
|
+
[404, { 'content-type' => 'text/plain' }, ['Not Found']]
|
41
41
|
end
|
42
42
|
|
43
43
|
def redirects
|
@@ -45,7 +45,7 @@ module Redirectly
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def ini_read(path)
|
48
|
-
content = File.readlines(path, chomp: true).reject(&:comment?)
|
48
|
+
content = File.readlines(path, chomp: true).reject(&:comment?).reject(&:empty?)
|
49
49
|
content.to_h { |line| line.split(/\s*=\s*/, 2) }
|
50
50
|
end
|
51
51
|
|
@@ -72,7 +72,6 @@ module Redirectly
|
|
72
72
|
if params
|
73
73
|
params.transform_keys!(&:to_sym)
|
74
74
|
params.delete :splat
|
75
|
-
params.transform_values! { |v| CGI.escape v }
|
76
75
|
end
|
77
76
|
|
78
77
|
params
|
data/lib/redirectly/command.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'colsole'
|
2
2
|
require 'mister_bin'
|
3
|
+
require 'rackup'
|
3
4
|
|
4
5
|
module Redirectly
|
5
6
|
class Command < MisterBin::Command
|
@@ -42,14 +43,15 @@ module Redirectly
|
|
42
43
|
*.mygoogle.com/:anything = https://google.com/?q=%{anything}
|
43
44
|
example.org/* = https://other-site.com/
|
44
45
|
*.old-site.com = !https://permanent.redirect.com
|
45
|
-
:sub.
|
46
|
+
:sub.app.localhost/* = http://it-works.com/%{sub}
|
47
|
+
(*)old-domain.com/*rest = http://new-domain.com/%{rest}
|
46
48
|
TEMPLATE
|
47
49
|
end
|
48
50
|
|
49
51
|
def start_server
|
50
52
|
raise ArgumentError, "Cannot find config file #{config_path}" unless File.exist? config_path
|
51
53
|
|
52
|
-
|
54
|
+
Rackup::Server.start(app: app, Port: port, environment: 'production')
|
53
55
|
end
|
54
56
|
|
55
57
|
def app
|
data/lib/redirectly/version.rb
CHANGED
data/lib/redirectly.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redirectly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mister_bin
|
@@ -70,14 +70,28 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
73
|
+
version: '3.0'
|
74
74
|
type: :runtime
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
80
|
+
version: '3.0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rackup
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '2.1'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '2.1'
|
81
95
|
description: Redirect server with dynamic URL and hostname support
|
82
96
|
email: db@dannyben.com
|
83
97
|
executables:
|
@@ -100,7 +114,7 @@ metadata:
|
|
100
114
|
bug_tracker_uri: https://github.com/DannyBen/redirectly/issues
|
101
115
|
source_code_uri: https://github.com/dannyben/redirectly
|
102
116
|
rubygems_mfa_required: 'true'
|
103
|
-
post_install_message:
|
117
|
+
post_install_message:
|
104
118
|
rdoc_options: []
|
105
119
|
require_paths:
|
106
120
|
- lib
|
@@ -108,15 +122,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
122
|
requirements:
|
109
123
|
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
125
|
+
version: '3.0'
|
112
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
127
|
requirements:
|
114
128
|
- - ">="
|
115
129
|
- !ruby/object:Gem::Version
|
116
130
|
version: '0'
|
117
131
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
119
|
-
signing_key:
|
132
|
+
rubygems_version: 3.5.6
|
133
|
+
signing_key:
|
120
134
|
specification_version: 4
|
121
135
|
summary: Redirectly redirect server
|
122
136
|
test_files: []
|