swagger2md 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
1
  require 'json'
2
+ require 'pry'
2
3
 
3
4
  module Swagger2md
4
5
  module Converter
5
- def self.to_markdown file_path
6
- docs_file = File.read(file_path)
6
+ def self.to_markdown input_path, output_path
7
+ docs_file = File.read(input_path)
7
8
  docs_hash = JSON.parse(docs_file)
8
9
  content = "#{docs_hash['info']['title']}\n"\
9
10
  "======\n"\
@@ -32,10 +33,10 @@ module Swagger2md
32
33
  end
33
34
  end
34
35
  end
35
- export(content)
36
+ export(content, output_path)
36
37
  end
37
38
 
38
- def self.export(content, output='docs.md')
39
+ def self.export(content, output)
39
40
  File.open(output, 'w') do |file|
40
41
  file.write(content)
41
42
  end
@@ -1,3 +1,3 @@
1
1
  module Swagger2md
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger2md
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SFzxc
@@ -83,6 +83,8 @@ files:
83
83
  - bin/console
84
84
  - bin/setup
85
85
  - bin/swagger2md
86
+ - example/input.json
87
+ - example/output.md
86
88
  - lib/swagger2md.rb
87
89
  - lib/swagger2md/converter.rb
88
90
  - lib/swagger2md/utils.rb