Skip to content

Commit

Permalink
Stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuzanna Stolińska committed Aug 3, 2017
1 parent 553303d commit ee8d19b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
11 changes: 0 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
source 'https://rubygems.org'

# Declare your gem's dependencies in swagger_ui_engine.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

# To use debugger
# gem 'debugger'
2 changes: 1 addition & 1 deletion app/controllers/swagger_ui_engine/docs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def single_doc_url?
end

def single_doc_url_hash?
@swagger_url.is_a?(Hash) && @swagger_url.size == 1
@swagger_url.is_a?(Hash) && @swagger_url.size.eql?(1)
end
end
end
4 changes: 2 additions & 2 deletions app/helpers/swagger_ui_engine/config_parser.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module SwaggerUiEngine
module ConfigParser
SwaggerUiEngine::DEFAULTS.each do |default|
next if default.first.to_s == 'validator_url'
next if default.first.to_s.eql?('validator_url')

define_method("set_#{default.first}") do
# set_swagger_url set_doc_expansion
# set_json_editor set_model_rendering
Expand Down
34 changes: 17 additions & 17 deletions lib/swagger_ui_engine/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module SwaggerUiEngine
class Configuration
# Configurable options
OPTIONS = [
:admin_username,
:admin_password,
:doc_expansion,
:json_editor,
:model_rendering,
:oauth_client_id,
:oauth_client_secret,
:oauth_realm,
:oauth_app_name,
:oauth_scope_separator,
:oauth_query_string_params,
:request_headers,
:swagger_url,
:translator_enabled,
:validator_enabled,
].freeze
OPTIONS = %i(
admin_username
admin_password
doc_expansion
json_editor
model_rendering
oauth_client_id
oauth_client_secret
oauth_realm
oauth_app_name
oauth_scope_separator
oauth_query_string_params
request_headers
swagger_url
translator_enabled
validator_enabled
).freeze

attr_accessor(*OPTIONS)
end
Expand Down

0 comments on commit ee8d19b

Please sign in to comment.