mina_maintenance 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +20 -0
- data/LICENSE +21 -0
- data/MIT-LICENSE +20 -0
- data/README.md +35 -0
- data/Rakefile +21 -0
- data/lib/mina_maintenance.rb +4 -0
- data/lib/mina_maintenance/tasks.rb +47 -0
- data/lib/mina_maintenance/templates/maintenance.html +22 -0
- data/lib/mina_maintenance/version.rb +3 -0
- data/mina_maintenance.gemspec +22 -0
- metadata +69 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 30b72d4034c4eb6f181fb96df08913523461fb66
|
4
|
+
data.tar.gz: 23541e53f02dee948d4499e1537dbb00a4bf0dd3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4434bcf20eda27d1c33d56cf5df4a256f28836a7b7b8cf7e505eb50771e995ee0601eaab93e7e2d6b2f63abe3fd5d121ca8693abc401f0a751ce65d27d267be5
|
7
|
+
data.tar.gz: 9e61d1b0168b8780eb09c1ae961ddd39a37b1d2eae592d276a104a855309aec4cf4517b5e44c1663c8f5bd95bfc0b0d646703171a1dc67a2aa959b559c705c25
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Declare your gem's dependencies in mina_slack.gemspec.
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
+
# development dependencies will be added by default to the :development group.
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
# Declare any dependencies that are still in development here instead of in
|
9
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
10
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
11
|
+
# your gem to rubygems.org.
|
12
|
+
|
13
|
+
# To use debugger
|
14
|
+
# gem 'debugger'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mina_maintenance (0.0.1)
|
5
|
+
mina
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
mina (0.3.1)
|
11
|
+
open4 (~> 1.3.4)
|
12
|
+
rake
|
13
|
+
open4 (1.3.4)
|
14
|
+
rake (10.4.2)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
mina_maintenance!
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Mike Bajur
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
mina_maintenance <a href="http://badge.fury.io/rb/mina_maintenance"><img src="https://badge.fury.io/rb/mina_maintenance.svg" alt="Gem Version" height="18"></a>
|
2
|
+
============
|
3
|
+
|
4
|
+
Maintenance Page Support For [Mina](http://nadarei.co/mina). Heavily inspired by [Capistrano::Maintenance](https://github.com/capistrano/maintenance)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
gem install mina_maintenance
|
9
|
+
|
10
|
+
## Usage example
|
11
|
+
|
12
|
+
require 'mina_maintenance/tasks'
|
13
|
+
|
14
|
+
## Available Tasks
|
15
|
+
|
16
|
+
* `maintenance:on`
|
17
|
+
* `maintenance:off`
|
18
|
+
|
19
|
+
## Available Options
|
20
|
+
|
21
|
+
| Option | Description |
|
22
|
+
| ------------------------- | ------------------------------------------------------------------------------------ |
|
23
|
+
| maintenance_template | Sets a local file with maintenance page template. If it's not specified, the default one will be used.|
|
24
|
+
| maintenance_basename | Sets the basename of server's file used to display maintenance message. <br> _default:_ `maintenance`|
|
25
|
+
| maintenance_path | Sets a path to the server's mainenance file on server. <br> _default:_ `/public/system/`|
|
26
|
+
|
27
|
+
## Todo
|
28
|
+
|
29
|
+
* Write some tests
|
30
|
+
|
31
|
+
## Copyright
|
32
|
+
|
33
|
+
Copyright (c) 2014 Mike Bajur http://github.com/mbajur
|
34
|
+
|
35
|
+
See LICENSE for further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'MinaSlack'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# ## Settings
|
2
|
+
# Any and all of these settings can be overriden in your `deploy.rb`.
|
3
|
+
|
4
|
+
# ### maintenance_template
|
5
|
+
# Sets a file with maintenance page template.
|
6
|
+
set_default :maintenance_template, File.join(File.expand_path('../templates', __FILE__), 'maintenance.html')
|
7
|
+
|
8
|
+
# ### maintenance_basename
|
9
|
+
# Sets the basename of server's file used to display maintenance message.
|
10
|
+
# Default: maintenance
|
11
|
+
set_default :maintenance_basename, 'maintenance'
|
12
|
+
|
13
|
+
# ### maintenance_path
|
14
|
+
# Sets a path to the server's mainenance file on server.
|
15
|
+
# Default: /public/system/
|
16
|
+
set_default :maintenance_path, '/public/system/'
|
17
|
+
|
18
|
+
# ## Control Tasks
|
19
|
+
namespace :maintenance do
|
20
|
+
desc "Turn on maintenance mode"
|
21
|
+
task :on do
|
22
|
+
queue %[echo "-----> Turning maintenance mode ON"]
|
23
|
+
|
24
|
+
template = settings.maintenance_template
|
25
|
+
result = File.open(template).read
|
26
|
+
|
27
|
+
rendered_path = "#{deploy_to}/#{shared_path}/#{settings.maintenance_path}"
|
28
|
+
rendered_name = "#{settings.maintenance_basename}.html"
|
29
|
+
|
30
|
+
queue %[
|
31
|
+
if [ ! -e '#{rendered_path}' ]; then
|
32
|
+
echo "-----> Creating missing directories"
|
33
|
+
mkdir -pv #{rendered_path}
|
34
|
+
fi
|
35
|
+
]
|
36
|
+
|
37
|
+
queue! %[echo "#{result}" > #{rendered_path + rendered_name};]
|
38
|
+
queue! %[chmod 644 #{rendered_path + rendered_name}]
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Turn off maintenance mode"
|
42
|
+
task :off do
|
43
|
+
queue %[echo "-----> Turning maintenance mode OFF"]
|
44
|
+
|
45
|
+
queue! %[rm -f #{deploy_to}/#{shared_path}/public/system/#{settings.maintenance_basename}.html]
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Maintenance</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body {
|
7
|
+
width: 400px;
|
8
|
+
margin: 100px auto;
|
9
|
+
font: 300 120% "OpenSans", "Helvetica Neue", "Helvetica", Arial, Verdana, sans-serif;
|
10
|
+
}
|
11
|
+
|
12
|
+
h1 {
|
13
|
+
font-weight: 300;
|
14
|
+
}
|
15
|
+
</style>
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1>Maintenance</h1>
|
19
|
+
<p>This site is under maintenance.</p>
|
20
|
+
<p>We should be back shortly. Thank you for your patience.</p>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
|
3
|
+
# Maintain your gem's version:
|
4
|
+
require "mina_maintenance/version"
|
5
|
+
|
6
|
+
# Describe your gem and declare its dependencies:
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "mina_maintenance"
|
9
|
+
s.version = MinaMaintenance::VERSION
|
10
|
+
s.authors = ["Mike Bajur"]
|
11
|
+
s.email = ["mbajur@gmail.com"]
|
12
|
+
s.homepage = "https://github.com/mbajur/mina_maintenance"
|
13
|
+
s.summary = "Maintenance Page Support For Mina"
|
14
|
+
s.description = "Maintenance Page Support For Mina"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency "mina"
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina_maintenance
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mike Bajur
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mina
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Maintenance Page Support For Mina
|
28
|
+
email:
|
29
|
+
- mbajur@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- .gitignore
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
37
|
+
- LICENSE
|
38
|
+
- MIT-LICENSE
|
39
|
+
- README.md
|
40
|
+
- Rakefile
|
41
|
+
- lib/mina_maintenance.rb
|
42
|
+
- lib/mina_maintenance/tasks.rb
|
43
|
+
- lib/mina_maintenance/templates/maintenance.html
|
44
|
+
- lib/mina_maintenance/version.rb
|
45
|
+
- mina_maintenance.gemspec
|
46
|
+
homepage: https://github.com/mbajur/mina_maintenance
|
47
|
+
licenses: []
|
48
|
+
metadata: {}
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.0.14
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Maintenance Page Support For Mina
|
69
|
+
test_files: []
|