redirectly 0.1.2 → 0.2.0
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 +4 -4
- data/README.md +2 -2
- data/lib/redirectly/app.rb +2 -2
- data/lib/redirectly/command.rb +3 -2
- data/lib/redirectly/version.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: dee36588a0b7625818f348fdaa4afefa27e0f16c1987a5656dd70397114d4989
|
|
4
|
+
data.tar.gz: 3e6a9704b9cfd7730d13d84002add38e2d350b6409176833d8861e7e3489f567
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 205afe31c98f93b7269f95fc6ebac5729c5070107547e5ff8d160ed5de742f67e633c14ab7072bf5328b9bc4968fa73b0bbca7a9e520b747b63d49409c5b2678
|
|
7
|
+
data.tar.gz: 7115a8ae99fb4a59b18a198851f10266035504f9473aa06cf85dd8ef26b5fd9723990d957b2263a628405f504a90fff8125a54acfe61b192c0697eba0fdc47b0
|
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,7 @@ 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
98
|
```
|
|
99
99
|
|
|
100
100
|
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
|
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,14 @@ 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}
|
|
46
47
|
TEMPLATE
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def start_server
|
|
50
51
|
raise ArgumentError, "Cannot find config file #{config_path}" unless File.exist? config_path
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
Rackup::Server.start(app: app, Port: port, environment: 'production')
|
|
53
54
|
end
|
|
54
55
|
|
|
55
56
|
def app
|
data/lib/redirectly/version.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.2.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-07 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: []
|