prelaunch 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/generators/templates/prelaunch.rb +5 -4
- data/lib/prelaunch.rb +5 -2
- data/lib/prelaunch/constraints.rb +1 -1
- data/lib/prelaunch/helpers.rb +3 -4
- data/lib/prelaunch/routing.rb +2 -2
- data/lib/prelaunch/version.rb +1 -1
- data/prelaunch.gemspec +1 -1
- data/test/dummy/config/initializers/prelaunch.rb +0 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmVlMjgyYWExNmVhYjIxZDViMDg3OThhN2U0ZDMyZjFjOGFjMGQxNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTYwMjE1ZjJjNzliOGQ3MTVmNmIwODY2NjlhNTE0N2JmMjI5NGQzYQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzMzODIzYmFmM2I0MDU5YWVlNmU5Njg4ZTlhYjc5ZDNiZTBlOTI3YzkzOGI3
|
10
|
+
NjliNGU4MTBkMjlmNTQ4OWZiNjY4OGExZTRjOTk4YmRlYWNlM2IyNjJlNzYx
|
11
|
+
NGFmNWFlYzgzZTUwNjRmNWMzZTZkN2Y2OGRmMmI0OGJmMmNiNTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODViNzQ3YjU0ZjhkYjg3MWVmOTMxYWI0N2E5OTY3OWNlNmEzYWRmY2IyYmY5
|
14
|
+
YzNlYTI4NTZkNzdiODdhMzMyZmYzMzBiN2Y0YzJiZjFlMzg5YzRmZmM2MGE1
|
15
|
+
MzQ4NDU4M2FjZWVjOTI0NWRkMWJkODlkYzE1ZjJlYzljNGVkZTI=
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# Use this hook to configure prelaunch
|
2
2
|
Prelaunch.setup do |config|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
# Route '<verify_path>/:token' will be used for token verification.
|
4
|
+
config.verify_path = 'prelaunch'
|
5
|
+
|
6
|
+
# Route '<logout_path>/' will be used for discarding token and logout.
|
7
|
+
config.logout_path = 'prelaunch/logout'
|
7
8
|
|
8
9
|
# The authentication token to use. This could either be a:
|
9
10
|
# * String to compare to. You can put it in the ENV so you can change token without redeploy.
|
data/lib/prelaunch.rb
CHANGED
@@ -5,8 +5,11 @@ require 'prelaunch/routing'
|
|
5
5
|
require 'prelaunch/helpers'
|
6
6
|
|
7
7
|
module Prelaunch
|
8
|
-
mattr_accessor :
|
9
|
-
@@
|
8
|
+
mattr_accessor :verify_path
|
9
|
+
@@verify_path = 'prelaunch'
|
10
|
+
|
11
|
+
mattr_accessor :logout_path
|
12
|
+
@@logout_path = 'prelaunch/logout'
|
10
13
|
|
11
14
|
mattr_accessor :token
|
12
15
|
@@token = 'letmein'
|
@@ -7,7 +7,7 @@ module Prelaunch
|
|
7
7
|
|
8
8
|
class TokenConstraint
|
9
9
|
def matches? request
|
10
|
-
path = Prelaunch::strip_slashes(Prelaunch.
|
10
|
+
path = Prelaunch::strip_slashes(Prelaunch.verify_path)
|
11
11
|
match = request.fullpath.match(/^#{path}\/([A-Za-z0-9]*)([\/\?])?/)
|
12
12
|
|
13
13
|
return false if match.nil?
|
data/lib/prelaunch/helpers.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
module Prelaunch
|
2
2
|
module Helpers
|
3
|
-
def prelaunch_logout_link name = nil, html_options =
|
3
|
+
def prelaunch_logout_link name = nil, html_options = {}, &block
|
4
4
|
return unless Prelaunch::valid_env?
|
5
5
|
|
6
|
-
path = Prelaunch::strip_slashes(Prelaunch.
|
7
|
-
url =
|
6
|
+
path = Prelaunch::strip_slashes(Prelaunch.logout_path)
|
7
|
+
url = path
|
8
8
|
|
9
9
|
html_options = name if block_given?
|
10
|
-
html_options ||= {}
|
11
10
|
html_options[:rel] = 'nofollow'
|
12
11
|
html_options['href'] ||= url
|
13
12
|
|
data/lib/prelaunch/routing.rb
CHANGED
@@ -5,8 +5,8 @@ module ActionDispatch::Routing
|
|
5
5
|
|
6
6
|
token = Prelaunch::TokenConstraint.new
|
7
7
|
|
8
|
-
get "#{Prelaunch.
|
9
|
-
get "#{Prelaunch.
|
8
|
+
get "#{Prelaunch.logout_path}" , to: 'prelaunch/prelaunch#logout', as: ''
|
9
|
+
get "#{Prelaunch.verify_path}/:token", to: 'prelaunch/prelaunch#verify', constraints: token
|
10
10
|
|
11
11
|
contraint = Prelaunch::SessionConstraint.new
|
12
12
|
|
data/lib/prelaunch/version.rb
CHANGED
data/prelaunch.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = Prelaunch::VERSION
|
9
9
|
s.license = 'MIT'
|
10
10
|
s.authors = ['Alexey Chernetsov']
|
11
|
-
s.email = ['alexey
|
11
|
+
s.email = ['alexey@chernetsov.net']
|
12
12
|
s.summary = 'Development environment access restriction Rails plugin.'
|
13
13
|
s.description = 'Prelaunch allows you to restrict access to the Rails app while it is still in development.'
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prelaunch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Chernetsov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
description: Prelaunch allows you to restrict access to the Rails app while it is
|
34
34
|
still in development.
|
35
35
|
email:
|
36
|
-
- alexey
|
36
|
+
- alexey@chernetsov.net
|
37
37
|
executables: []
|
38
38
|
extensions: []
|
39
39
|
extra_rdoc_files: []
|