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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d11d303417a59a9ef3a9fd2c970233c31d2810ae52ca945600bd42ee129c8d5a
4
- data.tar.gz: 82076365bdb96e6486a099573155fba968ddf2d6a03a6b1547d72afcb903bf7f
3
+ metadata.gz: 63b305a59fc4d5381391df73f884b91f59c815dc970559828cc5712be4df530f
4
+ data.tar.gz: 70bbd12337717b1df14f3ece87f638a0e629e24949b8788b468ca3ab6dbd9387
5
5
  SHA512:
6
- metadata.gz: 8edef52f11f59f8f06cd76b36e9d7d8e293620f8e49c94183895c643c74d2d399b228a3a4b39b713e0cbc3b8d7a4e33aaeaac6c6b5e8ceac3f831b1642e6cb7a
7
- data.tar.gz: 95cbace8f96efe12fa38f08347fd4565b7ab68c798829bcf39bd0919d2f99906a218474c73867fce9d726ebe8ca0fa0e7d0f5d24d5dcca17a4ceaa966ec56633
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.lvh.me:3000
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.lvh.me/* = http://it-works.com/%{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:
@@ -33,11 +33,11 @@ module Redirectly
33
33
  target = target[1..]
34
34
  end
35
35
 
36
- [code, { 'Location' => target }, []]
36
+ [code, { 'location' => target }, []]
37
37
  end
38
38
 
39
39
  def not_found
40
- [404, { 'Content-Type' => 'text/plain' }, ['Not Found']]
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
@@ -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.lvh.me/* = http://it-works.com/%{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
- Rack::Server.start(app: app, Port: port, environment: 'production')
54
+ Rackup::Server.start(app: app, Port: port, environment: 'production')
53
55
  end
54
56
 
55
57
  def app
@@ -1,3 +1,3 @@
1
1
  module Redirectly
2
- VERSION = '0.1.2'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/redirectly.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'byebug' if ENV['BYEBUG']
1
+ require 'debug' if ENV['DEBUGGER']
2
2
 
3
3
  require 'redirectly/refinements'
4
4
  require 'redirectly/version'
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.1.2
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: 2023-03-19 00:00:00.000000000 Z
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: '2.2'
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: '2.2'
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: 2.6.0
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.4.8
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: []