rimu 0.0.5 → 0.1.0

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
- SHA1:
3
- metadata.gz: 9d83c7258f16b129d5d5c0b40558a1b204ea69f3
4
- data.tar.gz: 8a52d90147459954396a2af7a2e4d78900036420
2
+ SHA256:
3
+ metadata.gz: 1cd88bd6844c3df8835d7003b18b3c8ccedf2e8b609336cc4ef67c3013d02d4b
4
+ data.tar.gz: 1b5b51d8788a1d337777b3c8ad360554a69dc4ef70c35c5dceb2ab2e50936af8
5
5
  SHA512:
6
- metadata.gz: 5959c9a9c13b598c6801217f400eb291ae5a908ffa4e37116fc246d82df415034f3993defab16a494ecff3477bf1579c672508f533ac38a16af763e33fa97353
7
- data.tar.gz: 10c18c690337109a0c637dbaa703aa6ca60b53a4dac7d05b260acdac6178da3dc8fd6bb45b998bbc7eb791f148a16654cca7d869e8917b20ace3df41d878ec7a
6
+ metadata.gz: 30c41e014ff9573d05350f99483797f1f253b7f125f44a7a19ee34fbeaecfd09128965fc4fdaeeb5306549a739ddad22eca49f7c591c9c7666d4a622cdad6857
7
+ data.tar.gz: 4e0d84e3c8f2c3f63db338d95004e2c7b9c8f3e56cba698633ee951909f453f2d522eb677925625c391edccc9279787cf1767e83c0e703fa79bb5f6a683bbe86
@@ -1,13 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.9.3"
4
- - "2.0.0"
5
- - "2.1.4"
6
- - "2.2.1"
3
+ - "2.6.5"
4
+ - "2.7.0"
7
5
  script: bundle exec rspec spec
8
- addons:
9
- code_climate:
10
- repo_token: 98eb635c4bb4c62c56e531c05c69d911616f3fa319cf79a86ef7b6b783f42fa9
11
6
  notifications:
12
7
  email:
13
8
  on_success: change
data/Gemfile CHANGED
@@ -3,7 +3,6 @@ source 'https://rubygems.org'
3
3
  group :test do
4
4
  gem 'simplecov', :require => false
5
5
  gem 'codecov', :require => false
6
- gem 'codeclimate-test-reporter', :require => false
7
6
  end
8
7
 
9
8
  # Specify your gem's dependencies in rimu.gemspec
data/README.md CHANGED
@@ -3,9 +3,7 @@
3
3
  This gem provides bindings for the [Rimuhosting](https://www.rimuhosting.com/) [REST API](http://apidocs.rimuhosting.com)
4
4
 
5
5
  [![Build Status](https://travis-ci.org/akissa/rimu.svg?branch=master)](https://travis-ci.org/akissa/rimu)
6
- [![codecov.io](https://codecov.io/github/akissa/rimu/coverage.svg?branch=master)](https://codecov.io/github/akissa/rimu?branch=master)
7
- [![Test Coverage](https://codeclimate.com/github/akissa/rimu/badges/coverage.svg)](https://codeclimate.com/github/akissa/rimu/coverage)
8
- [![Code Climate](https://codeclimate.com/github/akissa/rimu/badges/gpa.svg)](https://codeclimate.com/github/akissa/rimu)
6
+ [![codecov](https://codecov.io/gh/akissa/rimu/branch/master/graph/badge.svg)](https://codecov.io/gh/akissa/rimu)
9
7
  [![Gem Version](https://badge.fury.io/rb/rimu.svg)](https://badge.fury.io/rb/rimu)
10
8
  [![MPLv2 License](https://img.shields.io/badge/license-MPLv2-blue.svg?style=flat-square)](https://www.mozilla.org/MPL/2.0/)
11
9
 
@@ -81,26 +81,28 @@ module Rimu
81
81
  end
82
82
 
83
83
  def convert_item(response)
84
+ if response.respond_to?(:keys)
84
85
  response.keys.each do |key|
85
86
  response[key.downcase] = response[key]
86
87
  response.delete(key) if key != key.downcase
87
88
  end
88
- OpenStruct.new(response)
89
+ end
90
+ OpenStruct.new(response)
89
91
  end
90
92
 
91
93
  def send_request(path, field, method="GET", data=nil)
92
94
  logger.info "#{method} #{api_url}#{path} body:#{data.inspect}" if logger
93
95
  if data.nil?
94
- options = {headers: set_headers}
96
+ options = {:base_uri => api_url, headers: set_headers}
95
97
  else
96
- options = {headers: set_headers, body: data.to_json, read_timeout: read_timeout}
98
+ options = {:base_uri => api_url, headers: set_headers, body: data.to_json, read_timeout: read_timeout}
97
99
  end
98
100
  begin
99
101
  response = HTTParty.send(method.downcase.to_sym, path, options).parsed_response
100
102
  rescue StandardError => e
101
- raise RimuRequestError, "Errors completing request #{method} #{api_url}#{path} with data [#{data.inspect}]:\n#{e}"
103
+ raise RimuRequestError, "API Request ERROR: #{e}"
102
104
  end
103
- raise RimuResponseError, "Errors completing request #{method} #{api_url}#{path} with data [#{data.inspect}]:\n#{error_message(response)}" if error?(response)
105
+ raise RimuResponseError, "API Response ERROR: #{error_message(response)}" if error?(response)
104
106
  logger.info "Response: => #{response}" if logger
105
107
  format_response(response, field)
106
108
  end
@@ -145,14 +147,11 @@ module Rimu
145
147
 
146
148
  has_namespace :orders, :servers
147
149
 
148
- class RimuArgumentError < ArgumentError
149
- end
150
+ class RimuArgumentError < ArgumentError; end
150
151
 
151
- class RimuRequestError < StandardError
152
- end
152
+ class RimuRequestError < StandardError; end
153
153
 
154
- class RimuResponseError < StandardError
155
- end
154
+ class RimuResponseError < StandardError; end
156
155
  end
157
156
  Dir[File.expand_path(File.dirname(__FILE__) + '/rimu/*.rb')].each {|f| require f }
158
157
  end
@@ -1,6 +1,6 @@
1
1
  module Rimu
2
2
  module Version
3
- VERSION = '0.0.5'
3
+ VERSION = '0.1.0'
4
4
  VERSION_PATTERN = /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/
5
5
  end
6
6
  end
@@ -21,12 +21,12 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = '>= 1.9.3'
22
22
  spec.extra_rdoc_files = ['README.md']
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.5"
25
- spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "bundler", ">= 1.5"
25
+ spec.add_development_dependency "rake", ">= 12.3.3"
26
26
  spec.add_development_dependency "rspec"
27
27
  spec.add_development_dependency "rspec-core"
28
28
  spec.add_development_dependency "rspec-expectations"
29
29
  spec.add_development_dependency "mocha", "~> 0"
30
- spec.add_runtime_dependency "httparty", "~> 0.0"
31
- spec.add_runtime_dependency "json", "~> 1.0"
30
+ spec.add_runtime_dependency "httparty", ">= 0.10.0"
31
+ spec.add_runtime_dependency "json", "~> 2.0"
32
32
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rimu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Colin Kissa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-28 00:00:00.000000000 Z
11
+ date: 2020-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -98,30 +98,30 @@ dependencies:
98
98
  name: httparty
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '0.0'
103
+ version: 0.10.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '0.0'
110
+ version: 0.10.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: json
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.0'
117
+ version: '2.0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.0'
124
+ version: '2.0'
125
125
  description: This is a Ruby wrapper around Rimuhosting's REST API
126
126
  email:
127
127
  - andrew@topdog.za.net
@@ -163,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.4.8
166
+ rubygems_version: 3.0.8
168
167
  signing_key:
169
168
  specification_version: 4
170
169
  summary: Ruby bindings for the Rimuhosting REST API