prelaunch 0.0.5
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 +15 -0
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +86 -0
- data/README.md +66 -0
- data/Rakefile +28 -0
- data/app/controllers/prelaunch/prelaunch_controller.rb +31 -0
- data/app/views/prelaunch/index.html +28 -0
- data/lib/generators/prelaunch/prelaunch_generator.rb +18 -0
- data/lib/generators/prelaunch/view_generator.rb +13 -0
- data/lib/generators/templates/prelaunch.rb +20 -0
- data/lib/prelaunch/constraint.rb +7 -0
- data/lib/prelaunch/engine.rb +9 -0
- data/lib/prelaunch/helpers.rb +23 -0
- data/lib/prelaunch/routing.rb +15 -0
- data/lib/prelaunch/version.rb +3 -0
- data/lib/prelaunch.rb +36 -0
- data/prelaunch.gemspec +22 -0
- data/test/controllers/prelaunch/prelaunch_controller_test.rb +6 -0
- data/test/dummy/Rakefile +3 -0
- data/test/dummy/app/controllers/application_controller.rb +2 -0
- data/test/dummy/app/controllers/test_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +13 -0
- data/test/dummy/app/views/test/index.html.erb +1 -0
- data/test/dummy/bin/rails +3 -0
- data/test/dummy/config/application.rb +12 -0
- data/test/dummy/config/boot.rb +4 -0
- data/test/dummy/config/environment.rb +3 -0
- data/test/dummy/config/environments/development.rb +11 -0
- data/test/dummy/config/environments/test.rb +16 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +1 -0
- data/test/dummy/config/initializers/prelaunch.rb +7 -0
- data/test/dummy/config/initializers/secret_token.rb +1 -0
- data/test/dummy/config/initializers/session_store.rb +1 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/config.ru +3 -0
- data/test/dummy/public/404.html +10 -0
- data/test/dummy/public/422.html +10 -0
- data/test/dummy/public/500.html +10 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/prelaunch_test.rb +7 -0
- data/test/test_helper.rb +12 -0
- metadata +132 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
OTI3ZjY3NzNlNzM2MzUwOGYxMjZlMTlmNDE4MjlmNzdlZTY0NGIwZg==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
MTNhZTAxNGU5MzMzMmI1MzcxZWYzYTNkNzk2ZTg1NDU2MmI1NDhjNA==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
NDkxMTQ4ZGI1NGE5NGQyNWIwNGZmNDZlZjBjY2RjOTEzZWZiNjcxZDMwY2Nm
|
|
10
|
+
ZTllZWUxNGE2YTU0NTJmZjA1ZDYxNTU5NzZjNWM3ZjBjZmMzM2E0ZDgwMzVh
|
|
11
|
+
Nzk1NTZiMTE4MzhkZmUxY2Y4OTljYTA1MzFkNDE4M2U0NjQyOGM=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
M2NiNjJiYTliNTMyYjUyZGFkZmE2MGE4MzJhNzUzNjkzZWIxNGZhMzEwYTFh
|
|
14
|
+
OTFiODU0YjExOWNhY2UwYzVkNzkzNjg3M2VmNTU3OTgwMDdhZWQ4MWJlZTEx
|
|
15
|
+
MGQ5ZTQ3YWYwMmJiZTdmYzkyMmYxZWE0MzllNWU4MDBjZWM1YjU=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
prelaunch (0.0.4)
|
|
5
|
+
rails (>= 3.2.6, < 5)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
actionmailer (4.0.0)
|
|
11
|
+
actionpack (= 4.0.0)
|
|
12
|
+
mail (~> 2.5.3)
|
|
13
|
+
actionpack (4.0.0)
|
|
14
|
+
activesupport (= 4.0.0)
|
|
15
|
+
builder (~> 3.1.0)
|
|
16
|
+
erubis (~> 2.7.0)
|
|
17
|
+
rack (~> 1.5.2)
|
|
18
|
+
rack-test (~> 0.6.2)
|
|
19
|
+
activemodel (4.0.0)
|
|
20
|
+
activesupport (= 4.0.0)
|
|
21
|
+
builder (~> 3.1.0)
|
|
22
|
+
activerecord (4.0.0)
|
|
23
|
+
activemodel (= 4.0.0)
|
|
24
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
|
25
|
+
activesupport (= 4.0.0)
|
|
26
|
+
arel (~> 4.0.0)
|
|
27
|
+
activerecord-deprecated_finders (1.0.3)
|
|
28
|
+
activesupport (4.0.0)
|
|
29
|
+
i18n (~> 0.6, >= 0.6.4)
|
|
30
|
+
minitest (~> 4.2)
|
|
31
|
+
multi_json (~> 1.3)
|
|
32
|
+
thread_safe (~> 0.1)
|
|
33
|
+
tzinfo (~> 0.3.37)
|
|
34
|
+
arel (4.0.0)
|
|
35
|
+
atomic (1.1.13)
|
|
36
|
+
builder (3.1.4)
|
|
37
|
+
erubis (2.7.0)
|
|
38
|
+
hike (1.2.3)
|
|
39
|
+
i18n (0.6.5)
|
|
40
|
+
mail (2.5.4)
|
|
41
|
+
mime-types (~> 1.16)
|
|
42
|
+
treetop (~> 1.4.8)
|
|
43
|
+
mime-types (1.24)
|
|
44
|
+
minitest (4.7.5)
|
|
45
|
+
multi_json (1.7.9)
|
|
46
|
+
polyglot (0.3.3)
|
|
47
|
+
rack (1.5.2)
|
|
48
|
+
rack-test (0.6.2)
|
|
49
|
+
rack (>= 1.0)
|
|
50
|
+
rails (4.0.0)
|
|
51
|
+
actionmailer (= 4.0.0)
|
|
52
|
+
actionpack (= 4.0.0)
|
|
53
|
+
activerecord (= 4.0.0)
|
|
54
|
+
activesupport (= 4.0.0)
|
|
55
|
+
bundler (>= 1.3.0, < 2.0)
|
|
56
|
+
railties (= 4.0.0)
|
|
57
|
+
sprockets-rails (~> 2.0.0)
|
|
58
|
+
railties (4.0.0)
|
|
59
|
+
actionpack (= 4.0.0)
|
|
60
|
+
activesupport (= 4.0.0)
|
|
61
|
+
rake (>= 0.8.7)
|
|
62
|
+
thor (>= 0.18.1, < 2.0)
|
|
63
|
+
rake (10.1.0)
|
|
64
|
+
sprockets (2.10.0)
|
|
65
|
+
hike (~> 1.2)
|
|
66
|
+
multi_json (~> 1.0)
|
|
67
|
+
rack (~> 1.0)
|
|
68
|
+
tilt (~> 1.1, != 1.3.0)
|
|
69
|
+
sprockets-rails (2.0.0)
|
|
70
|
+
actionpack (>= 3.0)
|
|
71
|
+
activesupport (>= 3.0)
|
|
72
|
+
sprockets (~> 2.8)
|
|
73
|
+
thor (0.18.1)
|
|
74
|
+
thread_safe (0.1.2)
|
|
75
|
+
atomic
|
|
76
|
+
tilt (1.4.1)
|
|
77
|
+
treetop (1.4.15)
|
|
78
|
+
polyglot
|
|
79
|
+
polyglot (>= 0.3.1)
|
|
80
|
+
tzinfo (0.3.37)
|
|
81
|
+
|
|
82
|
+
PLATFORMS
|
|
83
|
+
ruby
|
|
84
|
+
|
|
85
|
+
DEPENDENCIES
|
|
86
|
+
prelaunch!
|
data/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
## Prelaunch
|
|
2
|
+
|
|
3
|
+
[](http://badge.fury.io/rb/prelaunch)
|
|
4
|
+
|
|
5
|
+
Prelaunch allows you to restrict access to the Rails app while it is still in development. It supports Rails 3.2.6 and onwards (4 included).
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
Add **Prelaunch** to your Gemfile with:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
gem 'prelaunch'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Run the bundle command to install it.
|
|
15
|
+
|
|
16
|
+
After you install prelaunch, generate routes and initializer with:
|
|
17
|
+
|
|
18
|
+
```console
|
|
19
|
+
rails generate prelaunch
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Take a second to ensure that `prelaunch_routes` is at the top of your routes table, like this:
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
Example::Application.routes.draw do
|
|
26
|
+
prelaunch_routes
|
|
27
|
+
|
|
28
|
+
...
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You can also take a look at `config/initializers/prelaunch.rb` to see configuration options.
|
|
32
|
+
|
|
33
|
+
If you want to customize placeholder page just do:
|
|
34
|
+
|
|
35
|
+
```console
|
|
36
|
+
rails generate prelaunch:view
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
and edit `app/views/prelaunch/index.html`.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Usage
|
|
43
|
+
|
|
44
|
+
Immediately after installing gem your app in production environment for every route will show:
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
Under construction
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To view contents of your app navigate to:
|
|
51
|
+
|
|
52
|
+
[http://localhost:3000/prelaunch/letmein](http://localhost:3000/prelaunch/letmein)
|
|
53
|
+
|
|
54
|
+
After doing so you can continue to use your app normally.
|
|
55
|
+
|
|
56
|
+
You can configure path prefix `prelaunch` and token `letmein` in `config/initializers/prelaunch.rb`. You can also pass `Array`, `Proc` or `lambda` instead of `String` to `config.token` for more complex token verification.
|
|
57
|
+
|
|
58
|
+
To give user ability to end the session and logout add this piece of code to some view:
|
|
59
|
+
|
|
60
|
+
```ruby
|
|
61
|
+
<%= prelaunch_logout_link 'Logout' %>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### License
|
|
65
|
+
|
|
66
|
+
Prelaunch is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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 = 'Prelaunch'
|
|
12
|
+
rdoc.options << '--line-numbers'
|
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Bundler::GemHelper.install_tasks
|
|
18
|
+
|
|
19
|
+
require 'rake/testtask'
|
|
20
|
+
|
|
21
|
+
Rake::TestTask.new(:test) do |t|
|
|
22
|
+
t.libs << 'lib'
|
|
23
|
+
t.libs << 'test'
|
|
24
|
+
t.pattern = 'test/**/*_test.rb'
|
|
25
|
+
t.verbose = false
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
task default: :test
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Prelaunch
|
|
2
|
+
class PrelaunchController < ActionController::Base
|
|
3
|
+
def index
|
|
4
|
+
if Prelaunch.redirect_url
|
|
5
|
+
redirect_to Prelaunch.redirect_url
|
|
6
|
+
else
|
|
7
|
+
render template: 'prelaunch/index'
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def redirect
|
|
12
|
+
redirect_to '/'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def verify
|
|
16
|
+
if Prelaunch::valid? params[:token]
|
|
17
|
+
session[:prelaunch_token] = params[:token]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
redirect_to '/'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def logout
|
|
24
|
+
if Prelaunch::valid? session[:prelaunch_token]
|
|
25
|
+
session[:prelaunch_token] = nil
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
redirect_to '/'
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<title>Under construction</title>
|
|
6
|
+
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
.text {
|
|
9
|
+
color: #444444;
|
|
10
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
11
|
+
font-size : 30px;
|
|
12
|
+
line-height: 40px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
display: block;
|
|
15
|
+
width: 280px;
|
|
16
|
+
position: absolute;
|
|
17
|
+
left: 50%;
|
|
18
|
+
top: 50%;
|
|
19
|
+
margin-left: -140px;
|
|
20
|
+
margin-top: -20px;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body>
|
|
26
|
+
<span class='text'>Under construction</span>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Prelaunch
|
|
2
|
+
module Generators
|
|
3
|
+
class PrelaunchGenerator < ::Rails::Generators::Base
|
|
4
|
+
source_root File.expand_path('../../templates', __FILE__)
|
|
5
|
+
|
|
6
|
+
namespace 'prelaunch'
|
|
7
|
+
desc "Description:\n Generate route and initializer for prelaunch"
|
|
8
|
+
|
|
9
|
+
def copy_initializer
|
|
10
|
+
template 'prelaunch.rb', 'config/initializers/prelaunch.rb'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def create_route
|
|
14
|
+
route 'prelaunch_routes'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Prelaunch
|
|
2
|
+
module Generators
|
|
3
|
+
class ViewGenerator < ::Rails::Generators::Base
|
|
4
|
+
source_root File.expand_path('../../../../app/views', __FILE__)
|
|
5
|
+
|
|
6
|
+
desc "Description:\n Copy Prelaunch view for customization"
|
|
7
|
+
|
|
8
|
+
def copy_views
|
|
9
|
+
copy_file 'prelaunch/index.html', 'app/views/prelaunch/index.html'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Use this hook to configure prelaunch
|
|
2
|
+
Prelaunch.setup do |config|
|
|
3
|
+
# The prefix for prelaunch routes. Prelaunch creates two routes:
|
|
4
|
+
# * '<path>/:token' for token verification.
|
|
5
|
+
# * '<path>/logout' for erasing current session.
|
|
6
|
+
config.path = 'prelaunch'
|
|
7
|
+
|
|
8
|
+
# The authentication token to use. This could either be a:
|
|
9
|
+
# * String to compare to. You can put it in the ENV so you can change token without redeploy.
|
|
10
|
+
# * Proc which will be called every time authentication of the token is needed.
|
|
11
|
+
config.token = 'letmein'
|
|
12
|
+
|
|
13
|
+
# Environments prelaunch will add routes to and render helper in.
|
|
14
|
+
# For all other environments it would look nonexistent.
|
|
15
|
+
config.environments = ['production']
|
|
16
|
+
|
|
17
|
+
# You can optionally redirect users to other path when they query the homepage
|
|
18
|
+
# or try to authenticate with invalid token instead of rendering prelaunch page.
|
|
19
|
+
# config.redirect_url = 'http://example.com'
|
|
20
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Prelaunch
|
|
2
|
+
module Helpers
|
|
3
|
+
def prelaunch_logout_link name = nil, html_options = nil, &block
|
|
4
|
+
return unless Prelaunch::valid_env?
|
|
5
|
+
|
|
6
|
+
url = "#{strip_slashes(Prelaunch.path)}/logout"
|
|
7
|
+
|
|
8
|
+
html_options = name if block_given?
|
|
9
|
+
html_options ||= {}
|
|
10
|
+
html_options[:rel] = 'nofollow'
|
|
11
|
+
html_options['href'] ||= url
|
|
12
|
+
|
|
13
|
+
content_tag(:a, name || url, html_options, &block)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
def strip_slashes string
|
|
18
|
+
result = string.gsub(/^(\/|\\)+/, '').gsub(/(\/|\\)+$/, '')
|
|
19
|
+
|
|
20
|
+
result.length > 0 ? '/' + result : result
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module ActionDispatch::Routing
|
|
2
|
+
class Mapper
|
|
3
|
+
def prelaunch_routes
|
|
4
|
+
return unless Prelaunch.valid_env?
|
|
5
|
+
|
|
6
|
+
contraint = Prelaunch::Constraint.new
|
|
7
|
+
|
|
8
|
+
get "#{Prelaunch.path}/logout", to: 'prelaunch/prelaunch#logout', as: ''
|
|
9
|
+
get "#{Prelaunch.path}/:token", to: 'prelaunch/prelaunch#verify', constraints: contraint
|
|
10
|
+
|
|
11
|
+
get '*path', to: 'prelaunch/prelaunch#redirect', constraints: contraint
|
|
12
|
+
get '/' , to: 'prelaunch/prelaunch#index' , constraints: contraint
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/prelaunch.rb
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require 'prelaunch/routing'
|
|
2
|
+
require 'prelaunch/constraint'
|
|
3
|
+
require 'prelaunch/engine'
|
|
4
|
+
require 'prelaunch/helpers'
|
|
5
|
+
|
|
6
|
+
module Prelaunch
|
|
7
|
+
mattr_accessor :path
|
|
8
|
+
@@path = 'prelaunch'
|
|
9
|
+
|
|
10
|
+
mattr_accessor :token
|
|
11
|
+
@@token = 'letmein'
|
|
12
|
+
|
|
13
|
+
mattr_accessor :redirect_url
|
|
14
|
+
@@redirect_url = nil
|
|
15
|
+
|
|
16
|
+
mattr_accessor :environments
|
|
17
|
+
@@environments = ['production']
|
|
18
|
+
|
|
19
|
+
def self.valid? token
|
|
20
|
+
if @@token.is_a? Proc
|
|
21
|
+
@@token.call token
|
|
22
|
+
elsif @@token.is_a? Array
|
|
23
|
+
@@token.include? token
|
|
24
|
+
else
|
|
25
|
+
@@token == token
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.valid_env?
|
|
30
|
+
@@environments.include? Rails.env
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.setup
|
|
34
|
+
yield self
|
|
35
|
+
end
|
|
36
|
+
end
|
data/prelaunch.gemspec
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
$:.push File.expand_path('../lib', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'prelaunch/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.platform = Gem::Platform::RUBY
|
|
7
|
+
s.name = 'prelaunch'
|
|
8
|
+
s.version = Prelaunch::VERSION
|
|
9
|
+
s.license = 'MIT'
|
|
10
|
+
s.authors = ['Alexey Chernetsov']
|
|
11
|
+
s.email = ['alexey.chernetsov@forbinde.net']
|
|
12
|
+
s.summary = 'Development environment access restriction Rails plugin.'
|
|
13
|
+
s.description = 'Prelaunch allows you to restrict access to the Rails app while it is still in development.'
|
|
14
|
+
|
|
15
|
+
s.required_ruby_version = '>= 1.9.3'
|
|
16
|
+
s.required_rubygems_version = '>= 1.8.11'
|
|
17
|
+
|
|
18
|
+
s.files = `git ls-files`.split("\n")
|
|
19
|
+
s.test_files = `git ls-files -- test/*`.split("\n")
|
|
20
|
+
|
|
21
|
+
s.add_dependency 'rails', '>= 3.2.6', '< 5'
|
|
22
|
+
end
|
data/test/dummy/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
And also this. <%= prelaunch_logout_link 'Logout from Prelaunch' %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Dummy::Application.configure do
|
|
2
|
+
config.cache_classes = false
|
|
3
|
+
config.eager_load = false
|
|
4
|
+
|
|
5
|
+
config.consider_all_requests_local = true
|
|
6
|
+
config.action_controller.perform_caching = false
|
|
7
|
+
|
|
8
|
+
config.active_support.deprecation = :log
|
|
9
|
+
|
|
10
|
+
config.assets.debug = true
|
|
11
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Dummy::Application.configure do
|
|
2
|
+
config.cache_classes = true
|
|
3
|
+
config.eager_load = false
|
|
4
|
+
|
|
5
|
+
config.consider_all_requests_local = true
|
|
6
|
+
|
|
7
|
+
config.serve_static_assets = true
|
|
8
|
+
config.static_cache_control = "public, max-age=3600"
|
|
9
|
+
|
|
10
|
+
config.action_controller.allow_forgery_protection = false
|
|
11
|
+
config.action_controller.perform_caching = false
|
|
12
|
+
|
|
13
|
+
config.action_dispatch.show_exceptions = false
|
|
14
|
+
|
|
15
|
+
config.active_support.deprecation = :stderr
|
|
16
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Rails.application.config.filter_parameters += [:password]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Dummy::Application.config.secret_key_base = '5effa3a4e08517426cde2ee5dfd4a1590ef5432c600b4216ac07f4927cb025366fb5cc92f3d87a433b22522ce13d75a011a0f9363c34396e3cc34c36508c1780'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
|
File without changes
|
data/test/test_helper.rb
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
|
2
|
+
|
|
3
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
|
4
|
+
require 'rails/test_help'
|
|
5
|
+
|
|
6
|
+
Rails.backtrace_cleaner.remove_silencers!
|
|
7
|
+
|
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
9
|
+
|
|
10
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
|
11
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__)
|
|
12
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: prelaunch
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.5
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Alexey Chernetsov
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2013-08-26 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rails
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ! '>='
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 3.2.6
|
|
20
|
+
- - <
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '5'
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ! '>='
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 3.2.6
|
|
30
|
+
- - <
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '5'
|
|
33
|
+
description: Prelaunch allows you to restrict access to the Rails app while it is
|
|
34
|
+
still in development.
|
|
35
|
+
email:
|
|
36
|
+
- alexey.chernetsov@forbinde.net
|
|
37
|
+
executables: []
|
|
38
|
+
extensions: []
|
|
39
|
+
extra_rdoc_files: []
|
|
40
|
+
files:
|
|
41
|
+
- .gitignore
|
|
42
|
+
- Gemfile
|
|
43
|
+
- Gemfile.lock
|
|
44
|
+
- README.md
|
|
45
|
+
- Rakefile
|
|
46
|
+
- app/controllers/prelaunch/prelaunch_controller.rb
|
|
47
|
+
- app/views/prelaunch/index.html
|
|
48
|
+
- lib/generators/prelaunch/prelaunch_generator.rb
|
|
49
|
+
- lib/generators/prelaunch/view_generator.rb
|
|
50
|
+
- lib/generators/templates/prelaunch.rb
|
|
51
|
+
- lib/prelaunch.rb
|
|
52
|
+
- lib/prelaunch/constraint.rb
|
|
53
|
+
- lib/prelaunch/engine.rb
|
|
54
|
+
- lib/prelaunch/helpers.rb
|
|
55
|
+
- lib/prelaunch/routing.rb
|
|
56
|
+
- lib/prelaunch/version.rb
|
|
57
|
+
- prelaunch.gemspec
|
|
58
|
+
- test/controllers/prelaunch/prelaunch_controller_test.rb
|
|
59
|
+
- test/dummy/Rakefile
|
|
60
|
+
- test/dummy/app/controllers/application_controller.rb
|
|
61
|
+
- test/dummy/app/controllers/test_controller.rb
|
|
62
|
+
- test/dummy/app/helpers/application_helper.rb
|
|
63
|
+
- test/dummy/app/views/layouts/application.html.erb
|
|
64
|
+
- test/dummy/app/views/test/index.html.erb
|
|
65
|
+
- test/dummy/bin/rails
|
|
66
|
+
- test/dummy/config.ru
|
|
67
|
+
- test/dummy/config/application.rb
|
|
68
|
+
- test/dummy/config/boot.rb
|
|
69
|
+
- test/dummy/config/environment.rb
|
|
70
|
+
- test/dummy/config/environments/development.rb
|
|
71
|
+
- test/dummy/config/environments/test.rb
|
|
72
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
|
73
|
+
- test/dummy/config/initializers/prelaunch.rb
|
|
74
|
+
- test/dummy/config/initializers/secret_token.rb
|
|
75
|
+
- test/dummy/config/initializers/session_store.rb
|
|
76
|
+
- test/dummy/config/routes.rb
|
|
77
|
+
- test/dummy/public/404.html
|
|
78
|
+
- test/dummy/public/422.html
|
|
79
|
+
- test/dummy/public/500.html
|
|
80
|
+
- test/dummy/public/favicon.ico
|
|
81
|
+
- test/prelaunch_test.rb
|
|
82
|
+
- test/test_helper.rb
|
|
83
|
+
homepage:
|
|
84
|
+
licenses:
|
|
85
|
+
- MIT
|
|
86
|
+
metadata: {}
|
|
87
|
+
post_install_message:
|
|
88
|
+
rdoc_options: []
|
|
89
|
+
require_paths:
|
|
90
|
+
- lib
|
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ! '>='
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: 1.9.3
|
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - ! '>='
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: 1.8.11
|
|
101
|
+
requirements: []
|
|
102
|
+
rubyforge_project:
|
|
103
|
+
rubygems_version: 2.0.7
|
|
104
|
+
signing_key:
|
|
105
|
+
specification_version: 4
|
|
106
|
+
summary: Development environment access restriction Rails plugin.
|
|
107
|
+
test_files:
|
|
108
|
+
- test/controllers/prelaunch/prelaunch_controller_test.rb
|
|
109
|
+
- test/dummy/Rakefile
|
|
110
|
+
- test/dummy/app/controllers/application_controller.rb
|
|
111
|
+
- test/dummy/app/controllers/test_controller.rb
|
|
112
|
+
- test/dummy/app/helpers/application_helper.rb
|
|
113
|
+
- test/dummy/app/views/layouts/application.html.erb
|
|
114
|
+
- test/dummy/app/views/test/index.html.erb
|
|
115
|
+
- test/dummy/bin/rails
|
|
116
|
+
- test/dummy/config.ru
|
|
117
|
+
- test/dummy/config/application.rb
|
|
118
|
+
- test/dummy/config/boot.rb
|
|
119
|
+
- test/dummy/config/environment.rb
|
|
120
|
+
- test/dummy/config/environments/development.rb
|
|
121
|
+
- test/dummy/config/environments/test.rb
|
|
122
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
|
123
|
+
- test/dummy/config/initializers/prelaunch.rb
|
|
124
|
+
- test/dummy/config/initializers/secret_token.rb
|
|
125
|
+
- test/dummy/config/initializers/session_store.rb
|
|
126
|
+
- test/dummy/config/routes.rb
|
|
127
|
+
- test/dummy/public/404.html
|
|
128
|
+
- test/dummy/public/422.html
|
|
129
|
+
- test/dummy/public/500.html
|
|
130
|
+
- test/dummy/public/favicon.ico
|
|
131
|
+
- test/prelaunch_test.rb
|
|
132
|
+
- test/test_helper.rb
|