sand 0.1.1 → 0.1.2

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: 523619603e1b71cf742f43ad0bd260198a774803
4
- data.tar.gz: bfc7a879a937a37a8af61afa37a7e3d3b2b44c5d
3
+ metadata.gz: c5a9e7385667a8ea61ee1cf926d8efffc8592895
4
+ data.tar.gz: c0d622bad1f642e2bf6c03e8a0b61bc0e8f9b29b
5
5
  SHA512:
6
- metadata.gz: 9aa7265fa2e6945ae7db1d5d5be3a02391958f3f59fa09a1440ca310ef8a0c9f78d03f57a5a9adb15ca97a51a3abf40b4238d30f73c714daeacef16123b138f9
7
- data.tar.gz: c56f52dfc583c474305af46d183c6dd0d6d4cdc660f5959438e8da9dcaea7578d84eb6895acb60b4aeb4a88b0b7dde4891ea66b95c0d5dac783632fff885757e
6
+ metadata.gz: 24d2c4ed4eaef6e09ab3c5b50e85f83b6b6d265832a79d3d8618ec01cd8aa9fda320867c075fe62cef64645fde8c97ba9ad87a5912989ce9ab89c836d8da20d8
7
+ data.tar.gz: 0967885c0dbdb324236638c09ea3f3d466b3ae6d63f141893133b28989513b57462959c2b45cb6f47ee9a9d385ebc01a4d169c176ebd361c5b3547993bb6889d
@@ -9,31 +9,29 @@ module Sand
9
9
  end
10
10
 
11
11
  class Middleware
12
- attr_reader :app, :env, :options, :response
12
+ attr_reader :app, :options, :response
13
13
 
14
14
  DEFAULT_OPTIONS = {
15
15
  pass: []
16
16
  }.freeze
17
17
 
18
18
  def initialize(app, options = {})
19
- @env = nil
20
19
  @app = app
21
20
  @options = DEFAULT_OPTIONS.merge(options)
22
21
  end
23
22
 
24
- def passed?
23
+ def passed?(env)
25
24
  return true if options[:pass].any? { |r| r =~ env['PATH_INFO'] }
26
25
  return true if env['sand.pass'] == true || env['sand.scoped'] || env['sand.authorized'] == true # rubocop:disable Metrics/LineLength
27
26
  false
28
27
  end
29
28
 
30
29
  def call(env)
31
- @env = env
32
30
  env['sand'] = RequestMethods.new(env)
33
31
 
34
32
  result = app.call(env)
35
33
 
36
- return result if passed?
34
+ return result if passed?(env)
37
35
  raise Sand::AuthorizationNotPerformed
38
36
  end
39
37
  end
@@ -1,3 +1,3 @@
1
1
  module Sand
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Tomlin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler