Class: R2OAS::Deploy::Client
- Inherits:
-
Schema::Base
- Object
- Base
- Schema::Base
- R2OAS::Deploy::Client
- Defined in:
- lib/r2-oas/deploy/client.rb
Constant Summary collapse
- SWAGGER_UI_DIST_URL =
'https://github.com/swagger-api/swagger-ui/trunk/dist'
Instance Method Summary collapse
- #deploy ⇒ Object
- #download_swagger_ui_dist ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 |
# File 'lib/r2-oas/deploy/client.rb', line 11 def initialize( = {}) super() @download_dir = "#{SecureRandom.uuid[0..7]}/dist" @dist_path = File.(Rails.root.join(@download_dir), __FILE__) end |
Instance Method Details
#deploy ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/r2-oas/deploy/client.rb', line 21 def deploy copy_swagger_ui_dist copy_swagger_ui_index copy_oas_doc_file ensure remove_download_dist end |
#download_swagger_ui_dist ⇒ Object
17 18 19 |
# File 'lib/r2-oas/deploy/client.rb', line 17 def download_swagger_ui_dist system("svn export #{SWAGGER_UI_DIST_URL} #{@dist_path}") end |