Skip to content

Commit

Permalink
trying out reek
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Feb 25, 2016
1 parent e356f75 commit 2fc1ae3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
23 changes: 23 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ GEM
specs:
ast (2.2.0)
awesome_print (1.6.1)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
backports (3.6.8)
better_errors (2.1.1)
coderay (>= 1.0.0)
Expand All @@ -23,7 +27,11 @@ GEM
bundler-audit (0.4.0)
bundler (~> 1.2)
thor (~> 0.18)
codeclimate-engine-rb (0.3.1)
virtus (~> 1.0)
coderay (1.1.0)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coveralls (0.8.10)
json (~> 1.8)
rest-client (>= 1.6.8, < 2)
Expand All @@ -32,11 +40,14 @@ GEM
thor (~> 0.19.1)
tins (~> 1.6.0)
deep_merge (1.0.1)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.1.0)
equalizer (0.0.11)
erubis (2.7.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
Expand All @@ -49,6 +60,7 @@ GEM
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
ice_nine (0.11.2)
json (1.8.3)
jwt (1.5.1)
mime-types (2.99)
Expand All @@ -72,6 +84,10 @@ GEM
rack (>= 1.0)
rainbow (2.1.0)
rake (10.4.2)
reek (3.11)
codeclimate-engine-rb (~> 0.3.1)
parser (~> 2.3, >= 2.3.0.6)
rainbow (~> 2.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
Expand Down Expand Up @@ -119,12 +135,18 @@ GEM
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.2)
tins (1.6.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
unicode-display_width (0.3.1)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
yajl-ruby (1.2.1)

PLATFORMS
Expand All @@ -137,6 +159,7 @@ DEPENDENCIES
coveralls
hieraviz!
rake (~> 10.0)
reek
rspec
rubocop
shotgun
Expand Down
1 change: 1 addition & 0 deletions hieraviz.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'better_errors'
spec.add_development_dependency 'bundler-audit'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'reek'
end
11 changes: 7 additions & 4 deletions lib/hieraviz/auth_gitlab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ def login_url(request)
end

def authorized?(token)
if @settings['resource_required']
resp = get_response(@settings['resource_required'], token)
resource_required = @settings['resource_required']
if resource_required
resp = get_response(resource_required, token)
resp_required_response_key = resp[@settings['required_response_key']]
resp_required_response_value = resp[@settings['required_response_value']]
if resp['error'] ||
(resp[@settings['required_response_key']] &&
resp[@settings['required_response_key']] != resp[@settings['required_response_value']])
(resp_required_response_key &&
resp_required_response_key != resp_required_response_value)
return false
end
end
Expand Down

0 comments on commit 2fc1ae3

Please sign in to comment.