Skip to content

Commit

Permalink
Remove unused settings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-gomez committed Jul 18, 2017
1 parent d01c0ef commit d520bb6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
6 changes: 0 additions & 6 deletions lib/generators/swaggard/templates/swaggard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
# Specify the API formats.
# config.api_formats = [:xml, :json]

# TODO: Add note about what this is for...
# config.api_path = ""

# The version of the application API.
# config.api_version = "0.1"

Expand Down Expand Up @@ -80,9 +77,6 @@
# Specify one or more paths to look for your model documentation
# config.models_paths = ["#{app.root}/app/serializers/**/*.rb"]

# TODO: Add note about what this is for...
# config.module_name = ""

# The transfer protocol of the API.
# Values MUST be from the list: "http", "https", "ws", "wss"
# config.schemes = [:https, :http]
Expand Down
12 changes: 2 additions & 10 deletions lib/swaggard/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class Configuration

attr_accessor :controllers_path, :models_paths, :routes

attr_writer :swagger_version, :api_base_path, :api_version, :api_path, :api_formats, :title,
attr_writer :swagger_version, :api_base_path, :api_version, :api_formats, :title,
:description, :tos, :contact_email, :contact_name, :contact_url, :host,
:authentication_type, :authentication_key, :authentication_value,
:access_username, :access_password, :default_content_type, :use_cache, :module_name,
:access_username, :access_password, :default_content_type, :use_cache,
:language, :additional_parameters, :schemes

def swagger_version
Expand All @@ -28,10 +28,6 @@ def api_version
@api_version ||= '0.1'
end

def api_path
@api_path ||= ''
end

def api_base_path
@api_base_path ||= '/'
end
Expand Down Expand Up @@ -116,9 +112,5 @@ def use_cache
@use_cache ||= false
end

def module_name
@module_name ||= ''
end

end
end
6 changes: 2 additions & 4 deletions lib/swaggard/swagger/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ class Tag
attr_reader :controller_class

def initialize(yard_object)
@yard_name = yard_object.name

controller_name = "#{yard_object.namespace}::#{yard_object.name}"
controller_name.prepend("#{Swaggard.configuration.module_name}::") unless Swaggard.configuration.module_name.blank?

@yard_name = yard_object.name
@controller_class = controller_name.constantize

tag = yard_object.tags.find { |tag| tag.tag_name == 'tag' }
Expand All @@ -29,4 +27,4 @@ def to_doc

end
end
end
end

0 comments on commit d520bb6

Please sign in to comment.