prelaunch 0.0.6 → 0.1.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTMxMGRmMWZjZTYyODJhMzFkZmE1N2NiMmEzZTYxYzMyNjU2NGEzYQ==
4
+ YmVlMjgyYWExNmVhYjIxZDViMDg3OThhN2U0ZDMyZjFjOGFjMGQxNw==
5
5
  data.tar.gz: !binary |-
6
- YWEzYTA2Mjk0OWZjMDg1NjFhNWVlNzc2ODkzZjA4NGYwOGM1YWVlNQ==
6
+ NTYwMjE1ZjJjNzliOGQ3MTVmNmIwODY2NjlhNTE0N2JmMjI5NGQzYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDMxYjUyOTM3YzNjM2E4M2U2ODAyNmY4YmFlNmEwOTg5YWRlYWI1NmIwMzhk
10
- N2I3M2QxMTk3N2M5ZDVkNTk5MTkyMDkyZTgxYTdmZmY1ODQyNWNmOGQ5MzZj
11
- YWUyM2RlMGFkYWIxZTUwMDk4NTY4NjRmZmRjNzBmNzM5ODUzNDM=
9
+ MzMzODIzYmFmM2I0MDU5YWVlNmU5Njg4ZTlhYjc5ZDNiZTBlOTI3YzkzOGI3
10
+ NjliNGU4MTBkMjlmNTQ4OWZiNjY4OGExZTRjOTk4YmRlYWNlM2IyNjJlNzYx
11
+ NGFmNWFlYzgzZTUwNjRmNWMzZTZkN2Y2OGRmMmI0OGJmMmNiNTI=
12
12
  data.tar.gz: !binary |-
13
- MDM0ZmUxN2FmNTM4NTdlMmQ0MDYyMWE0MTYwNzJkODAxOGVkOWE2MmNjNjk3
14
- NTA4NzM5ZjRiODgwMjJmMjhjOTIzNTA2YWNiZGViYjg2MDg5YjhkMTkyNWI4
15
- OWRmYzc1YjRlZDhkYzhlZGRiYWY0YzFjNTM3OGNhMzdhYzViODY=
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
- # 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'
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.
@@ -5,8 +5,11 @@ require 'prelaunch/routing'
5
5
  require 'prelaunch/helpers'
6
6
 
7
7
  module Prelaunch
8
- mattr_accessor :path
9
- @@path = 'prelaunch'
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.path)
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?
@@ -1,13 +1,12 @@
1
1
  module Prelaunch
2
2
  module Helpers
3
- def prelaunch_logout_link name = nil, html_options = nil, &block
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.path)
7
- url = "#{path}/logout"
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
 
@@ -5,8 +5,8 @@ module ActionDispatch::Routing
5
5
 
6
6
  token = Prelaunch::TokenConstraint.new
7
7
 
8
- get "#{Prelaunch.path}/logout", to: 'prelaunch/prelaunch#logout', as: ''
9
- get "#{Prelaunch.path}/:token", to: 'prelaunch/prelaunch#verify', constraints: token
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
 
@@ -1,3 +1,3 @@
1
1
  module Prelaunch
2
- VERSION = '0.0.6'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -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.chernetsov@forbinde.net']
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
 
@@ -1,7 +1,3 @@
1
1
  Prelaunch.setup do |config|
2
- config.path = 'prelaunch'
3
- config.token = 'letmein'
4
-
5
2
  config.environments = ['development']
6
- config.redirect_url = nil
7
3
  end
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.6
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-08-26 00:00:00.000000000 Z
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.chernetsov@forbinde.net
36
+ - alexey@chernetsov.net
37
37
  executables: []
38
38
  extensions: []
39
39
  extra_rdoc_files: []