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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39cd72764be2152b6ab200e4dd374cfd9e1e992b
4
- data.tar.gz: df4cdc7980fb744e783a07759d6578d1ee6609db
3
+ metadata.gz: 81862609bb780ae68c440fa513aa2b8aa61049f0
4
+ data.tar.gz: a3654a11b43dd48b698704d1cc866b5b82423081
5
5
  SHA512:
6
- metadata.gz: e57a58aa72f17310b54218b587d4bd67d8b1cb173e180a6e0279c48a2b60feb8ae3919dac5b1629ae840c87c7c122181aba1fa9fb8cfc0556e841e9707fde4fb
7
- data.tar.gz: 9afe26066aecf8c4b859b2bedfd718d9ed09c9d2ba1d531d54393a726a0394bb2af05289092ae1dc5c7d6cf3e60f4bfa0a63856e853778382ae962473ce1b07b
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/'.freeze
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
- if SUCCESS_STATUSES.include?(response.code.to_i)
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
@@ -1,3 +1,3 @@
1
1
  module SwaggerHubApiPusher
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger_hub_api_pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markov Alexey