capistrano-simple-htaccess 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -19
- data/.rubocop.yml +7 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -1
- data/Gemfile.lock +58 -0
- data/LICENSE +1 -1
- data/README.md +15 -3
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/capistrano-simple-htaccess.gemspec +12 -5
- data/lib/capistrano/simple_htaccess/version.rb +1 -1
- data/lib/capistrano/tasks/simple_htaccess.rake +8 -5
- metadata +33 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ddc60528f1bed0b05195d15e22c42455be872af1a0a938cb94e340588672bf3
|
4
|
+
data.tar.gz: d8a6a396a4e4ea89fede3af95fb9999d5124728d320263fd72750384a945f22f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37b051405bbf85f447e89971bcb86ddd1f353f30e186c9facbcfb3f06127b97599188074f50bbdb35a35a2989207ed30bffd54ac8bc0fda34fe311441b689bd1
|
7
|
+
data.tar.gz: 14247d574c48e9410dc0e183375e1668c7232bfb38d6dfcf71472edf4ae4824dd8013460fc3763c17af0a3719e82f85e3c3653c64b882202e3266499d8c75d0a
|
data/.gitignore
CHANGED
@@ -1,19 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
/vendor/ruby
|
19
|
-
.idea
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
.idea
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
### master
|
4
4
|
|
5
|
+
### v1.0.0, 2020-11-10
|
6
|
+
|
7
|
+
- Refactor default `.htaccess` file to externally redirect out of capistrano's 'current' directory
|
8
|
+
- This requires setting a new `:document_root` variable so the new `.htaccess` file can function
|
9
|
+
- `:document_root` should be set to what your Apache's `DocumentRoot` is set to. The rake task will use this to dynamically build the `.htaccess`
|
10
|
+
|
5
11
|
### v0.1.1, 2020-03-17
|
6
12
|
|
7
13
|
- Run Rubocop formatters on source
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-simple-htaccess (1.0.0)
|
5
|
+
capistrano (~> 3.14)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
airbrussh (1.4.0)
|
11
|
+
sshkit (>= 1.6.1, != 1.7.0)
|
12
|
+
ast (2.4.1)
|
13
|
+
capistrano (3.14.1)
|
14
|
+
airbrussh (>= 1.0.0)
|
15
|
+
i18n
|
16
|
+
rake (>= 10.0.0)
|
17
|
+
sshkit (>= 1.9.0)
|
18
|
+
concurrent-ruby (1.1.7)
|
19
|
+
i18n (1.8.5)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
net-scp (3.0.0)
|
22
|
+
net-ssh (>= 2.6.5, < 7.0.0)
|
23
|
+
net-ssh (6.1.0)
|
24
|
+
parallel (1.20.0)
|
25
|
+
parser (2.7.2.0)
|
26
|
+
ast (~> 2.4.1)
|
27
|
+
rainbow (3.0.0)
|
28
|
+
rake (13.0.1)
|
29
|
+
regexp_parser (1.8.2)
|
30
|
+
rexml (3.2.4)
|
31
|
+
rubocop (1.2.0)
|
32
|
+
parallel (~> 1.10)
|
33
|
+
parser (>= 2.7.1.5)
|
34
|
+
rainbow (>= 2.2.2, < 4.0)
|
35
|
+
regexp_parser (>= 1.8)
|
36
|
+
rexml
|
37
|
+
rubocop-ast (>= 1.0.1)
|
38
|
+
ruby-progressbar (~> 1.7)
|
39
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
40
|
+
rubocop-ast (1.1.1)
|
41
|
+
parser (>= 2.7.1.5)
|
42
|
+
ruby-progressbar (1.10.1)
|
43
|
+
sshkit (1.21.0)
|
44
|
+
net-scp (>= 1.1.2)
|
45
|
+
net-ssh (>= 2.8.0)
|
46
|
+
unicode-display_width (1.7.0)
|
47
|
+
|
48
|
+
PLATFORMS
|
49
|
+
ruby
|
50
|
+
|
51
|
+
DEPENDENCIES
|
52
|
+
bundler (~> 2.1)
|
53
|
+
capistrano-simple-htaccess!
|
54
|
+
rake (~> 13.0)
|
55
|
+
rubocop (>= 1.2)
|
56
|
+
|
57
|
+
BUNDLED WITH
|
58
|
+
2.1.4
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -38,17 +38,29 @@ Found as a HEREDOC string in `lib/capistrano/tasks/simple_htaccess.rake`, but al
|
|
38
38
|
Options +FollowSymLinks
|
39
39
|
|
40
40
|
RewriteEngine On
|
41
|
-
|
42
|
-
RewriteRule ^(.*)$
|
41
|
+
RewriteBase "%<base>s"
|
42
|
+
RewriteRule ^current(.*) %<base>s$1 [NC,R,END]
|
43
|
+
RewriteRule ^((?!current/).*)$ current/$1 [NC,END]
|
43
44
|
</IfModule>
|
44
45
|
```
|
45
46
|
|
47
|
+
The `%<base>s` template strings are replaced with the value of your `:deploy_to` directory, with the `:document_root` variable removed from the string's prefix. This creates a base directory string.
|
48
|
+
|
49
|
+
Ex:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
set :deploy_to, '/var/www/html/example1/public'
|
53
|
+
set :document_root, '/var/www/html'
|
54
|
+
|
55
|
+
# %<base>s would then be replaced with: /example1/public
|
56
|
+
```
|
57
|
+
|
46
58
|
## Configuration
|
47
59
|
|
48
60
|
If you want a different .htaccess uploaded, just change the `:HTACCESS` variable as part of your deploy config. Ex:
|
49
61
|
|
50
62
|
```ruby
|
51
|
-
set
|
63
|
+
set :HTACCESS, <<HTACCESS
|
52
64
|
# Put your .htaccess config here
|
53
65
|
HTACCESS
|
54
66
|
```
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'capistrano/simple_htaccess'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'capistrano/simple_htaccess/version'
|
3
|
+
require_relative 'lib/capistrano/simple_htaccess/version'
|
6
4
|
|
7
5
|
Gem::Specification.new do |spec|
|
8
6
|
spec.name = 'capistrano-simple-htaccess'
|
@@ -13,15 +11,24 @@ Gem::Specification.new do |spec|
|
|
13
11
|
spec.summary = 'Capistrano task for including a simple apache .htaccess file for redirects on deploy'
|
14
12
|
spec.homepage = 'https://github.com/da-moo/capistrano-simple-htaccess'
|
15
13
|
spec.license = 'MIT'
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5')
|
16
15
|
|
17
|
-
spec.
|
16
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
+
spec.metadata['source_code_uri'] = 'https://github.com/da-moo/capistrano-simple-htaccess'
|
18
|
+
spec.metadata['changelog_uri'] = 'https://github.com/da-moo/capistrano-simple-htaccess/blob/master/CHANGELOG.md'
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
23
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
24
|
end
|
25
|
+
spec.bindir = 'exe'
|
20
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
27
|
spec.require_paths = ['lib']
|
22
28
|
|
23
|
-
spec.add_dependency 'capistrano', '~> 3.
|
29
|
+
spec.add_dependency 'capistrano', '~> 3.14'
|
24
30
|
|
25
31
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
26
32
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
33
|
+
spec.add_development_dependency 'rubocop', '>= 1.2'
|
27
34
|
end
|
@@ -3,13 +3,15 @@
|
|
3
3
|
namespace :load do
|
4
4
|
task :defaults do
|
5
5
|
set :redirect_OK, false
|
6
|
+
set :document_root, '/var/www/html'
|
6
7
|
set :HTACCESS, <<~HTACCESS
|
7
8
|
<IfModule mod_rewrite.c>
|
8
9
|
Options +FollowSymLinks
|
9
10
|
|
10
11
|
RewriteEngine On
|
11
|
-
|
12
|
-
RewriteRule ^(.*)$
|
12
|
+
RewriteBase "%<base>s"
|
13
|
+
RewriteRule ^current(.*) %<base>s$1 [NC,R,END]
|
14
|
+
RewriteRule ^((?!current/).*)$ current/$1 [NC,END]
|
13
15
|
</IfModule>
|
14
16
|
|
15
17
|
HTACCESS
|
@@ -20,9 +22,10 @@ namespace :deploy do
|
|
20
22
|
namespace :simple_htaccess do
|
21
23
|
task :create_htaccess do
|
22
24
|
on roles :web do
|
23
|
-
|
24
|
-
|
25
|
-
|
25
|
+
document_root = fetch :document_root
|
26
|
+
base_dir = deploy_to.delete_prefix(document_root)
|
27
|
+
filled_template = format(fetch(:HTACCESS), base: base_dir)
|
28
|
+
upload! StringIO.new(filled_template), "#{deploy_to}/.htaccess" unless fetch(:redirect_OK)
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-simple-htaccess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DaMoo
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.14'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.14'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,7 +52,21 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 12.3.3
|
55
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.2'
|
69
|
+
description:
|
56
70
|
email:
|
57
71
|
- git@damoo.zone
|
58
72
|
executables: []
|
@@ -60,11 +74,15 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- ".gitignore"
|
77
|
+
- ".rubocop.yml"
|
63
78
|
- CHANGELOG.md
|
64
79
|
- Gemfile
|
80
|
+
- Gemfile.lock
|
65
81
|
- LICENSE
|
66
82
|
- README.md
|
67
83
|
- Rakefile
|
84
|
+
- bin/console
|
85
|
+
- bin/setup
|
68
86
|
- capistrano-simple-htaccess.gemspec
|
69
87
|
- lib/capistrano/simple_htaccess.rb
|
70
88
|
- lib/capistrano/simple_htaccess/version.rb
|
@@ -72,8 +90,11 @@ files:
|
|
72
90
|
homepage: https://github.com/da-moo/capistrano-simple-htaccess
|
73
91
|
licenses:
|
74
92
|
- MIT
|
75
|
-
metadata:
|
76
|
-
|
93
|
+
metadata:
|
94
|
+
homepage_uri: https://github.com/da-moo/capistrano-simple-htaccess
|
95
|
+
source_code_uri: https://github.com/da-moo/capistrano-simple-htaccess
|
96
|
+
changelog_uri: https://github.com/da-moo/capistrano-simple-htaccess/blob/master/CHANGELOG.md
|
97
|
+
post_install_message:
|
77
98
|
rdoc_options: []
|
78
99
|
require_paths:
|
79
100
|
- lib
|
@@ -81,15 +102,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
102
|
requirements:
|
82
103
|
- - ">="
|
83
104
|
- !ruby/object:Gem::Version
|
84
|
-
version: '
|
105
|
+
version: '2.5'
|
85
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
107
|
requirements:
|
87
108
|
- - ">="
|
88
109
|
- !ruby/object:Gem::Version
|
89
110
|
version: '0'
|
90
111
|
requirements: []
|
91
|
-
rubygems_version: 3.1.
|
92
|
-
signing_key:
|
112
|
+
rubygems_version: 3.1.4
|
113
|
+
signing_key:
|
93
114
|
specification_version: 4
|
94
115
|
summary: Capistrano task for including a simple apache .htaccess file for redirects
|
95
116
|
on deploy
|