Module: InstaSwag
- Defined in:
- lib/insta_swag.rb,
lib/insta_swag/version.rb,
lib/insta_swag/settings.rb,
lib/insta_swag/assets_app.rb,
lib/insta_swag/static_files.rb,
lib/insta_swag/documentation_app.rb,
lib/insta_swag/documentation_factory.rb
Defined Under Namespace
Classes: DocumentationApp, DocumentationFactory, Settings, StaticFiles
Constant Summary collapse
- ASSETS_PATH =
"/assets"
- DOCUMENTATION_PATH =
"/documentation"
- INDEX_PATH =
DOCUMENTATION_PATH + "/index.html"
- MOUNT_PATH =
DOCUMENTATION_PATH + "/resources"
- VERSION =
"0.1.1"
- AssetsApp =
->(env) do dir = File.("../../../public/docs", __FILE__) run Rack::Directory.new dir end
Class Method Summary collapse
Class Method Details
.for(klass, settings = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/insta_swag.rb', line 16 def self.for(klass, settings = {}) settings = Settings.new klass, settings Rack::Builder.new do map settings.assets_path, &InstaSwag::AssetsApp map settings.prefix_path, &DocumentationApp.create(klass, settings) map settings.index_path, &StaticFiles.create(settings) end end |