check_issuing 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a239bb3516bb644d3a5e84c5dbe8453c7a89ecaf
4
+ data.tar.gz: 6e3c5e4f0a7add6e6add2f0e1e6532423f88715b
5
+ SHA512:
6
+ metadata.gz: 9bf42311a390f200d9cf57c4e72f2f394958093737d80ef4950008193852f557d55b81ee4d78936b7d5de28d3831d6a8e0b036520f52e3a8f4b6d43cb12a1618
7
+ data.tar.gz: 934f27d10583d35585e8ab7ecce805b67f35d67f8772f58fdb1936915b0605b2185f22ad0c50bcbd765ff04e4fb3c349291b0eb6a8f21128383d124627e0ed64
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .idea
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in checkissuing.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Iwo Dziechciarow
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # CheckIssuing
2
+
3
+ Simple Ruby wrapper for checkissuing.com
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'check_issuing/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'check_issuing'
8
+ spec.version = CheckIssuing::VERSION
9
+ spec.authors = ["Iwo Dziechciarow"]
10
+ spec.email = ["iiwo@o2.pl"]
11
+ spec.summary = %q{Simple wrapper for checkissuing.com }
12
+ spec.description = %q{Simple wrapper for checkissuing.com (work in progress) }
13
+ spec.homepage = "https://github.com/ArcadiaPower/check-issuing"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'httparty', '~> 0.14'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake", '~> 12.0'
25
+ end
@@ -0,0 +1,16 @@
1
+ module CheckIssuing
2
+ class Client < Request
3
+
4
+ def initialize
5
+ end
6
+
7
+ def base_path
8
+ ''
9
+ end
10
+
11
+ def call(relative_path, data = nil, options = {})
12
+ self.post(base_path+relative_path, options.reverse_merge(body: data))
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,50 @@
1
+ require 'httparty'
2
+ require 'json'
3
+
4
+ module CheckIssuing
5
+ class Request
6
+ include HTTParty
7
+
8
+ def get(path, options={})
9
+ set_auth(options)
10
+ @response = self.class.get(CheckIssuing.endpoint + path, options)
11
+ end
12
+
13
+ def post(path, options={})
14
+ set_auth(options)
15
+ @response = self.class.post(CheckIssuing.endpoint + path, options)
16
+ end
17
+
18
+ def put(path, options={})
19
+ set_auth(options)
20
+ @response = self.class.put(CheckIssuing.endpoint + path, options)
21
+ end
22
+
23
+ def delete(path, options={})
24
+ set_auth(options)
25
+ @response = self.class.delete(CheckIssuing.endpoint + path, options)
26
+ end
27
+
28
+ def response
29
+ @response
30
+ end
31
+
32
+ def parsed_response
33
+ self.response.parsed_response if self.response.present?
34
+ end
35
+
36
+ private
37
+
38
+ def set_auth(options)
39
+ options[:body] ||= {}
40
+ options[:body][:akey] ||= CheckIssuing.api_key
41
+ options[:body][:client_id] ||= CheckIssuing.client_id
42
+
43
+
44
+ options[:http_proxyaddr] = CheckIssuing.proxy_host if CheckIssuing.proxy_host.present?
45
+ options[:http_proxyport] = CheckIssuing.proxy_port if CheckIssuing.proxy_port.present?
46
+ options[:http_proxyuser] = CheckIssuing.proxy_user if CheckIssuing.proxy_user.present?
47
+ options[:http_proxypass] = CheckIssuing.proxy_password if CheckIssuing.proxy_user.present?
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,3 @@
1
+ module CheckIssuing
2
+ VERSION = '1.0.2'
3
+ end
@@ -0,0 +1,35 @@
1
+ require 'httparty'
2
+ require 'check_issuing/version'
3
+
4
+ module CheckIssuing
5
+ mattr_accessor :api_key, :client_id, :proxy_host, :proxy_user, :proxy_password
6
+
7
+ mattr_accessor :endpoint
8
+ @@endpoint = 'https://apisb.webmasterchecks.com/'
9
+
10
+ mattr_accessor :debug
11
+ @@debug = true
12
+
13
+ def self.debug=(flag)
14
+ @@debug = flag
15
+ Checkissuing::Request.default_options.delete(:debug_output) unless flag
16
+ end
17
+
18
+ def self.debug_output=(output)
19
+ return unless debug
20
+ Checkissuing::Request.debug_output(output)
21
+ end
22
+
23
+ mattr_accessor :proxy_port
24
+ @@proxy_port = 80
25
+
26
+ def self.configure
27
+ yield self
28
+ end
29
+ end
30
+
31
+ require 'check_issuing/request'
32
+ require 'check_issuing/client'
33
+
34
+ # default starting point
35
+ Checkissuing.debug_output = $stdout
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: check_issuing
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Iwo Dziechciarow
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.14'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '12.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '12.0'
55
+ description: 'Simple wrapper for checkissuing.com (work in progress) '
56
+ email:
57
+ - iiwo@o2.pl
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - check_issuing.gemspec
68
+ - lib/check_issuing.rb
69
+ - lib/check_issuing/client.rb
70
+ - lib/check_issuing/request.rb
71
+ - lib/check_issuing/version.rb
72
+ homepage: https://github.com/ArcadiaPower/check-issuing
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.0.14.1
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Simple wrapper for checkissuing.com
96
+ test_files: []