swagger_hub_api_pusher 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/swagger_hub_api_pusher/pusher.rb +2 -4
- data/lib/swagger_hub_api_pusher/version.rb +1 -1
- data/lib/tasks/swagger.rake +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81862609bb780ae68c440fa513aa2b8aa61049f0
|
4
|
+
data.tar.gz: a3654a11b43dd48b698704d1cc866b5b82423081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7186fca689ab310215e1ee7db94238065e40c5e91fee87a3e291f31c8abaacd1dc7cd1332f01fabfc3877d6627cf881938a9f6e8c2ae585d9b960f49317f7553
|
7
|
+
data.tar.gz: b4a18eb1e80ded3ced5e16b82e2725c78cef183cef193dbd3209e8be1249e59b2faf25b44e963c6e89141ba63c82e976afa744fb20239b70feb367b8beafd5f0
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# SwaggerHubApiPusher
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/swagger_hub_api_pusher.svg)](https://badge.fury.io/rb/swagger_hub_api_pusher)
|
4
|
+
[![Build Status](https://travis-ci.org/trickstersio/swagger_hub_api_pusher.svg?branch=master)](https://travis-ci.org/trickstersio/swagger_hub_api_pusher)
|
5
|
+
|
3
6
|
Provides rake task for pushing swagger.json to SwaggerHub API
|
4
7
|
|
5
8
|
## Installation
|
@@ -4,7 +4,7 @@ require 'net/https'
|
|
4
4
|
module SwaggerHubApiPusher
|
5
5
|
class Pusher
|
6
6
|
SUCCESS_STATUSES = [200, 201].freeze
|
7
|
-
BASE_URL = 'https://api.swaggerhub.com/apis
|
7
|
+
BASE_URL = 'https://api.swaggerhub.com/apis'.freeze
|
8
8
|
|
9
9
|
def execute
|
10
10
|
raise ArgumentError, config.errors_messages unless config.valid?
|
@@ -19,9 +19,7 @@ module SwaggerHubApiPusher
|
|
19
19
|
http.request(request)
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
'swagger.json was successfully posted'
|
24
|
-
else
|
22
|
+
unless SUCCESS_STATUSES.include?(response.code.to_i)
|
25
23
|
JSON.parse(response.body)['message']
|
26
24
|
end
|
27
25
|
end
|
data/lib/tasks/swagger.rake
CHANGED
@@ -4,6 +4,7 @@ require 'swagger_hub_api_pusher'
|
|
4
4
|
namespace :swagger do
|
5
5
|
desc 'Push swagger json to SwaggerHub API'
|
6
6
|
task push: :environment do
|
7
|
-
SwaggerHubApiPusher::Pusher.new.execute
|
7
|
+
response = SwaggerHubApiPusher::Pusher.new.execute
|
8
|
+
puts response unless response.nil?
|
8
9
|
end
|
9
10
|
end
|