Class: AcosOpenApiHelper::PageCreator
- Inherits:
-
Object
- Object
- AcosOpenApiHelper::PageCreator
- Defined in:
- lib/acos_jekyll_openapi.rb
Instance Method Summary collapse
-
#initialize(path, basePath, output_path, swaggerfile, sidebar) ⇒ PageCreator
constructor
A new instance of PageCreator.
- #write ⇒ Object
Constructor Details
#initialize(path, basePath, output_path, swaggerfile, sidebar) ⇒ PageCreator
Returns a new instance of PageCreator.
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/acos_jekyll_openapi.rb', line 175 def initialize(path, basePath, output_path, swaggerfile, ) puts "Initialize intput %s, %s, %s, %s" % [path, output_path, swaggerfile, ] @path = path @output_path = output_path @swaggerfile = swaggerfile = @basePath = basePath @swaggerfileBase = File.basename(@swaggerfile, ".*") @permalink = AcosOpenApiHelper::PermalinkGenerator.create(path, @swaggerfile) @lines = [ "---", "title: User API %s" % path, "keywords: json, openapi", "# summary: test med json fil", "sidebar: %s" % , "permalink: %s.html" % @permalink, "folder: swagger", "toc: false", "swaggerfile: %s" % @swaggerfileBase, "swaggerpath: paths", "swaggerkey: %s" % @path, "---", "{\% include swagger_json/get_path.md \%}" ] end |
Instance Method Details
#write ⇒ Object
201 202 203 204 205 |
# File 'lib/acos_jekyll_openapi.rb', line 201 def write File.open("%s/%s/%s/%s.%s" % [@basePath, "pages", "swagger", @permalink, "md"], "w+") do |f| f.puts(@lines) end end |