guard_dog 0.1.2 → 0.1.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40b08d957abe19c8755a05b1db541431abe15f27
4
- data.tar.gz: 9371deab5691e00619b1f2ea723222c1d49dbaf3
3
+ metadata.gz: 57ce842c017fda60c8d5ab05c7194409561015fa
4
+ data.tar.gz: 562c96af7d7b27cf93b2c95528ba175f6ece8428
5
5
  SHA512:
6
- metadata.gz: 1d6f48ed2d66914d318e2a3a160cdc18c39e61a4f7af58341b7852c7fdfd28cf97d3bd1b8c8cad0e81eef6ca87db77ecd7fcabb5d301afff9c9b9a7311b90d6f
7
- data.tar.gz: a769f731a228224bfb2fe3f121b64a595e038e231788c8c3a8f2703ea4600b6e24e2268423c3c802a8889362b1fb2e3ce854f3ad37c90f47fb8f76b62411a990
6
+ metadata.gz: a61544f2dbc3958c91e05078093172919239e4ef28a6816fc617f4b38a40be46853057707e152d7386c591cff1c38e33e3dcff265152b018212679f9dafd33c4
7
+ data.tar.gz: 88d4fc6a1a0faff5579e60be147eb3664a8cda111d85ddab3a5acf65ec6a4c4a6c6fb7023fce5956b902c8517f7a25fb37ac6fcecedd040733f3dc6db11ce1b0
@@ -6,14 +6,11 @@ module GuardDog
6
6
  skip_before_filter :guard_dog_authentication
7
7
 
8
8
  def authentication
9
- unless passwords = ENV['GUARD_DOG_PASSWORD']
9
+ passwords = ENV['GUARD_DOG_PASSWORD'].try(:split, /\s*,\s*/) || []
10
+ if passwords.empty? || passwords.include?(params[:password])
10
11
  allow_access
11
12
  else
12
- if passwords.split(/\s*,\s*/).include? params[:password]
13
- allow_access
14
- else
15
- deny_access
16
- end
13
+ deny_access
17
14
  end
18
15
  end
19
16
 
@@ -34,3 +31,4 @@ module GuardDog
34
31
  end
35
32
  end
36
33
  end
34
+
@@ -5,8 +5,8 @@ class ApplicationController < ActionController::Base
5
5
  protected
6
6
 
7
7
  def guard_dog_authentication
8
- unless session[:guard_dog_password] || Rails.env.test?
8
+ if !ENV['GUARD_DOG_PASSWORD'].blank? && !session[:guard_dog_password]
9
9
  redirect_to guard_dog.root_url
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module GuardDog
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard_dog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Endri Gjiri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-05 00:00:00.000000000 Z
11
+ date: 2013-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails