lockup 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,14 +9,14 @@
9
9
  1. Add this line to your application's Gemfile:
10
10
 
11
11
  gem 'lockup'
12
+
13
+ 2. Define a codeword (see Usage below).
12
14
 
13
- 2. Next, add this line to your routes.rb:**
15
+ 3. That's it!**
14
16
 
15
- mount Lockup::Engine, at: '/lockup'
17
+ **If you're passing parameters right at your root (i.e. somedomain.com/:parameter), you'll want to place this mount statement in your routes.rb file, _before_ your other route statements:
16
18
 
17
- **This step may be unnecessary—depends on your config/routes.rb setup.
18
-
19
- 3. Define a codeword (see Usage below).
19
+ mount Lockup::Engine, at: '/lockup'
20
20
 
21
21
  ## Usage
22
22
 
data/config/routes.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  Rails.application.routes.draw do
2
- mount Lockup::Engine, at: '/lockup'
2
+ mount Lockup::Engine, at: '/lockup', :as => 'lockup'
3
3
  end
4
4
 
5
5
  Lockup::Engine.routes.draw do
6
- match 'unlock' => 'lockup#unlock'
6
+ get 'unlock' => 'lockup#unlock', :as => 'unlock'
7
+ post 'unlock' => 'lockup#unlock'
7
8
  end
data/lib/lockup.rb CHANGED
@@ -9,10 +9,10 @@ module Lockup
9
9
  if cookies[:lockup] == ENV["LOCKUP_CODEWORD"].to_s.downcase
10
10
  return
11
11
  else
12
- redirect_to :controller => '/lockup', :action => 'unlock', :return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword]
12
+ redirect_to lockup.unlock_path(:return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword])
13
13
  end
14
14
  else
15
- redirect_to :controller => '/lockup', :action => 'unlock', :return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword]
15
+ redirect_to lockup.unlock_path(:return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword])
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module Lockup
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockup
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - gb Studio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-08-09 00:00:00 Z
18
+ date: 2013-08-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -31,26 +31,12 @@ dependencies:
31
31
  version: "3"
32
32
  - - <
33
33
  - !ruby/object:Gem::Version
34
- hash: 9
34
+ hash: 15
35
35
  segments:
36
- - 5
37
- version: "5"
36
+ - 6
37
+ version: "6"
38
38
  type: :runtime
39
39
  version_requirements: *id001
40
- - !ruby/object:Gem::Dependency
41
- name: sqlite3
42
- prerelease: false
43
- requirement: &id002 !ruby/object:Gem::Requirement
44
- none: false
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- hash: 3
49
- segments:
50
- - 0
51
- version: "0"
52
- type: :development
53
- version_requirements: *id002
54
40
  description: "A simple gem to more elegantly place a staging server or other in-progress application behind a basic codeword. It\xE2\x80\x99s easy to implement, share with clients/collaborators, and more beautiful than the typical password-protection sheet."
55
41
  email:
56
42
  - hello@grantblakeman.com