redirect_conf 0.7 → 0.8
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/bin/redirect_conf +9 -19
- data/redirect_conf.gemspec +1 -1
- metadata +28 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85a59a18288eeb884068ef4ad68958fe44fa81b6
|
|
4
|
+
data.tar.gz: 6a7f700853177e49f566fbbd0646ff4683934416
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ffbd42c5cbe3bef268273e9e5cd63018a2db246fe6ac61da08e75234aba741de2d0d80e8c630da1632535f9b645c669c9cd6e38d95060d16aaf41ba854ec04b
|
|
7
|
+
data.tar.gz: 2df9a28cebac3ca243756586e8e121183c262483b3438228768ecb28da0d257e62688a620f86e30334ffbefa7ddc242f26dbb97f96ce7da7fabf0a561956ff64
|
data/bin/redirect_conf
CHANGED
|
@@ -8,38 +8,28 @@ require 'ostruct'
|
|
|
8
8
|
|
|
9
9
|
class RedirectConfig < Thor
|
|
10
10
|
|
|
11
|
-
desc "csv_to_apache <CSVFILE",
|
|
12
|
-
|
|
13
|
-
Creates RewriteRules for Apache web server from given CSVFILE as complementary to apache_to_csv.
|
|
14
|
-
EOT
|
|
11
|
+
desc "csv_to_apache <CSVFILE", "Creates RewriteRules for Apache web server from given CSVFILE as complementary to apache_to_csv."
|
|
12
|
+
method_option :format, default: 'dos', aliases:'-f', enum: %w{unix dos}
|
|
15
13
|
def csv_to_apache
|
|
16
14
|
line_no = 0
|
|
15
|
+
row_sep = case options[:format] when 'dos' then "\r\n" else "\n" end
|
|
17
16
|
|
|
18
|
-
CSV($stdin, row_sep:
|
|
17
|
+
CSV($stdin, row_sep: row_sep, headers: true).each do |in_row|
|
|
19
18
|
line_no += 1
|
|
20
19
|
|
|
21
20
|
pattern = in_row['Pattern']
|
|
21
|
+
pattern = "^#{Regexp.escape(pattern)}$" unless boolean(in_row['re'])
|
|
22
22
|
destination = in_row['Destination']
|
|
23
23
|
condition = in_row['Condition']
|
|
24
|
-
r = in_row['R']
|
|
25
|
-
l = boolean in_row['L']
|
|
26
|
-
nc = boolean in_row['NC']
|
|
27
|
-
ne = boolean in_row['NE']
|
|
28
|
-
re = boolean in_row['RE']
|
|
29
|
-
qsa = boolean in_row['QSA']
|
|
30
|
-
qsd = boolean in_row['QSD']
|
|
31
24
|
|
|
32
25
|
f = []
|
|
26
|
+
r = in_row['R']
|
|
33
27
|
f << "r=#{r}" if r
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
f << "qsa" if qsa
|
|
38
|
-
f << "qsd" if qsd
|
|
28
|
+
%w{NE NC L QSA QSD}.each do |n|
|
|
29
|
+
f << n.downcase if boolean(in_row[n])
|
|
30
|
+
end
|
|
39
31
|
flags = "[#{f.join(',')}]" unless f.empty?
|
|
40
32
|
|
|
41
|
-
pattern = "^#{Regexp.escape(pattern)}$" unless re
|
|
42
|
-
|
|
43
33
|
puts "RewriteCond\t#{condition}" if condition
|
|
44
34
|
puts "RewriteRule\t#{pattern} #{destination} #{flags}"
|
|
45
35
|
end
|
data/redirect_conf.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redirect_conf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.8'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Ehrenberg
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2015-08-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
|
-
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - ~>
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '1.8'
|
|
20
|
-
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
21
23
|
requirements:
|
|
22
|
-
- - ~>
|
|
24
|
+
- - "~>"
|
|
23
25
|
- !ruby/object:Gem::Version
|
|
24
26
|
version: '1.8'
|
|
25
|
-
prerelease: false
|
|
26
|
-
type: :development
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
|
-
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - ~>
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '10.0'
|
|
34
|
-
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
35
37
|
requirements:
|
|
36
|
-
- - ~>
|
|
38
|
+
- - "~>"
|
|
37
39
|
- !ruby/object:Gem::Version
|
|
38
40
|
version: '10.0'
|
|
39
|
-
prerelease: false
|
|
40
|
-
type: :development
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: thor
|
|
43
|
-
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - ~>
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0'
|
|
48
|
-
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
49
51
|
requirements:
|
|
50
|
-
- - ~>
|
|
52
|
+
- - "~>"
|
|
51
53
|
- !ruby/object:Gem::Version
|
|
52
54
|
version: '0'
|
|
53
|
-
prerelease: false
|
|
54
|
-
type: :runtime
|
|
55
55
|
description: Creates Apache mod_rewrite RedirectRules from CSVFILE.
|
|
56
56
|
email:
|
|
57
57
|
- pe@dipe.de
|
|
@@ -60,7 +60,7 @@ executables:
|
|
|
60
60
|
extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
|
62
62
|
files:
|
|
63
|
-
- .gitignore
|
|
63
|
+
- ".gitignore"
|
|
64
64
|
- CODE_OF_CONDUCT.md
|
|
65
65
|
- Gemfile
|
|
66
66
|
- LICENSE.txt
|
|
@@ -69,28 +69,28 @@ files:
|
|
|
69
69
|
- bin/redirect_conf
|
|
70
70
|
- lib/redirect_conf.rb
|
|
71
71
|
- redirect_conf.gemspec
|
|
72
|
-
homepage:
|
|
72
|
+
homepage:
|
|
73
73
|
licenses:
|
|
74
74
|
- MIT
|
|
75
75
|
metadata: {}
|
|
76
|
-
post_install_message:
|
|
76
|
+
post_install_message:
|
|
77
77
|
rdoc_options: []
|
|
78
78
|
require_paths:
|
|
79
79
|
- lib
|
|
80
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
requirements:
|
|
82
|
-
- -
|
|
82
|
+
- - ">="
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
84
|
version: '0'
|
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '0'
|
|
90
90
|
requirements: []
|
|
91
|
-
rubyforge_project:
|
|
92
|
-
rubygems_version: 2.
|
|
93
|
-
signing_key:
|
|
91
|
+
rubyforge_project:
|
|
92
|
+
rubygems_version: 2.4.6
|
|
93
|
+
signing_key:
|
|
94
94
|
specification_version: 4
|
|
95
95
|
summary: Creates Apache mod_rewrite RedirectRules from CSVFILE.
|
|
96
96
|
test_files: []
|