apireaper 1.0.9 → 1.0.10

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: 433cd8c7b6435ed0c89ac5cca663574e82ab16f2
4
- data.tar.gz: 12ec465454f80687886368b78dbd871c007eae24
3
+ metadata.gz: 5ac14f3047975ad8a139d33b85e87dc030764aad
4
+ data.tar.gz: ca0f408f3b7c74dba4a04f2c02822fc06ced6a5f
5
5
  SHA512:
6
- metadata.gz: d2b78674a989cfba06ace5c3ea187f95e39b1d1ea1f206c1f2880da2bdf12f56e82210ca5d71a3a8b677bf3e41bb7002c212ceeb372552ad02a68f93e4b0f210
7
- data.tar.gz: c9485f169c6571408b4676db5dcc7ab57f7a0fd0017e9439175e703924259ebca40b513140f6a3090c3a4533f955b65f9bee0f60cd48aa997162450293548777
6
+ metadata.gz: dbe20601c71f3215524ddcc195a53dee08e134ff047b25d1fa18108f34e2c0caaf1dcffce533d8cba069d7be76cbdc1ea08171057e9ea52510589dae646bf7e3
7
+ data.tar.gz: 91ebffe9fc105439324523bd073641a06c6ae2962e31bcb9890ccf430ab1a2db9058f78812e294c91cc6b19d3461b4284bc4b79e1d27da84505315e5ff84a736
@@ -1,14 +1,14 @@
1
- image: yueyehua/debian-ruby
1
+ image: yueyehua/debian-ruby:deb8
2
2
 
3
3
  rubocop:
4
4
  tags:
5
5
  - docker
6
- image: yueyehua/debian-ruby
7
6
  stage: test
8
7
  script:
9
8
  - rubocop
10
9
 
11
10
  lines_length:
11
+ image: yueyehua/debian-base:8
12
12
  stage: test
13
13
  script:
14
14
  - >
@@ -17,20 +17,19 @@ lines_length:
17
17
  80 README.md spec/files/*
18
18
 
19
19
  git_history:
20
+ image: yueyehua/debian-base:8
20
21
  stage: test
21
22
  script:
22
23
  - >
23
24
  bash <(curl -s
24
25
  https://gitlab.com/yue-script/checks/raw/master/check_git_history.sh)
25
26
 
26
- before_script:
27
- - bundle install
28
-
29
27
  rspec:
30
28
  tags:
31
29
  - docker
32
30
  stage: test
33
31
  script:
32
+ - bundle install
34
33
  - rspec
35
34
  artifacts:
36
35
  paths:
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # APIReaper
2
- ![License][license-img]
2
+ [![License](https://img.shields.io/badge/license-Apache-blue.svg)](LICENSE)
3
3
  [![build status](https://gitlab.com/vp-noc/apireaper/badges/develop/build.svg)](https://gitlab.com/vp-noc/apireaper/commits/develop)
4
4
  [![coverage report](https://gitlab.com/vp-noc/apireaper/badges/develop/coverage.svg)](https://vp-noc.gitlab.io/apireaper/)
5
5
  [![Gem Version](https://badge.fury.io/rb/apireaper.svg)](https://badge.fury.io/rb/apireaper)
@@ -63,5 +63,3 @@ request.
63
63
  ╚═(███)═╝
64
64
  ╚═(███)═╝
65
65
  ```
66
-
67
- [license-img]: https://img.shields.io/badge/license-Apache-blue.svg
@@ -84,8 +84,9 @@ module APIReaper
84
84
 
85
85
  # GET method
86
86
  def rest_request_get
87
- exit_with_error(5, 'GET is not yet implemented')
88
- # TODO
87
+ req = Net::HTTP::Get.new(@uri.request_uri)
88
+ req = format_header(req)
89
+ @http.request(req)
89
90
  end
90
91
 
91
92
  # POST method
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module APIReaper
19
- VERSION = '1.0.9'.freeze
19
+ VERSION = '1.0.10'.freeze
20
20
  end
@@ -26,7 +26,7 @@ def print_out(code)
26
26
  end
27
27
 
28
28
  describe APIReaper::Requester do # rubocop:disable Metrics/BlockLength
29
- %w[delete get put].each do |method|
29
+ %w[delete put].each do |method|
30
30
  context "check #{method} http://api.test.yueyehua.net/ -q" do
31
31
  it 'tries unimplemented commands.' do
32
32
  expect { start(self) }.to raise_error(SystemExit)
@@ -40,9 +40,11 @@ describe APIReaper::Requester do # rubocop:disable Metrics/BlockLength
40
40
  end
41
41
  end
42
42
 
43
- context 'check post http://api.test.yueyehua.net/' do
44
- it 'requests an API without extra arguments.' do
45
- expect { start(self) }.to output(print_out(200)).to_stdout
43
+ %w[get post].each do |method|
44
+ context "check #{method} http://api.test.yueyehua.net/" do
45
+ it 'requests an API without extra arguments.' do
46
+ expect { start(self) }.to output(print_out(200)).to_stdout
47
+ end
46
48
  end
47
49
  end
48
50
 
@@ -26,6 +26,8 @@ RSpec.configure do |config|
26
26
  # requests an API without extra arguments
27
27
  stub_request(:post, 'http://api.test.yueyehua.net/')
28
28
  .to_return('status' => 200, 'body' => '{}', 'headers' => {})
29
+ stub_request(:get, 'http://api.test.yueyehua.net/')
30
+ .to_return('status' => 200, 'body' => '{}', 'headers' => {})
29
31
  # requests an API with headers
30
32
  stub_request(:post, 'http://api.test.yueyehua.net/')
31
33
  .with('headers' => { 'k' => 'v' })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apireaper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Delaplace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-15 00:00:00.000000000 Z
11
+ date: 2017-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.5.2
177
+ rubygems_version: 2.6.8
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Tool to request and check an API.