xapix_client 1.0.0
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 +7 -0
- data/lib/xapix_client/config.rb +17 -0
- data/lib/xapix_client/connection.rb +16 -0
- data/lib/xapix_client/resource.rb +7 -0
- data/lib/xapix_client/version.rb +3 -0
- data/lib/xapix_client.rb +7 -0
- metadata +92 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 0e2ef3a66d02954b0aeb78b65145aa903f924052
|
|
4
|
+
data.tar.gz: 814d2afc1230a9439688f026d84784cad27639b5
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 050af28fb9b28cf7aab546a93a21655af58b92f3e094a76122bc78da8deb5b05a2b2022c5c598d4e02fec9422466b20578c55fb20c6657e46deb571d736e293a
|
|
7
|
+
data.tar.gz: 92086d633fb5e19f2e538e5e019400df140ac7745041d22bc1e2ee106e58ab20ec3fd7b7bdf4274d7f9a514a429c8e8a060538ac105b1a99b9df487119268d08
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module XapixClient
|
|
2
|
+
class BadConfigurationError < StandardError; end
|
|
3
|
+
class NoConfigurationError < StandardError; end
|
|
4
|
+
|
|
5
|
+
class << self
|
|
6
|
+
attr_accessor :configuration
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def self.configure
|
|
10
|
+
self.configuration ||= Configuration.new
|
|
11
|
+
yield(configuration)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class Configuration
|
|
15
|
+
attr_accessor :project_name, :auth_token
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'json_api_client'
|
|
2
|
+
|
|
3
|
+
module XapixClient
|
|
4
|
+
class Connection < JsonApiClient::Connection
|
|
5
|
+
def initialize(options = {})
|
|
6
|
+
fail(XapixClient::NoConfigurationError) if XapixClient.configuration.nil?
|
|
7
|
+
fail(XapixClient::BadConfigurationError) if XapixClient.configuration.project_name.nil?
|
|
8
|
+
super(options.merge(site: "https://app.xapix.io/api/v1/#{XapixClient.configuration.project_name}/"))
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def run(request_method, path, params = {}, headers = {})
|
|
12
|
+
fail(XapixClient::BadConfigurationError) if XapixClient.configuration.auth_token.nil?
|
|
13
|
+
super(request_method, path, params, headers.merge(auth_token: XapixClient.configuration.auth_token))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
data/lib/xapix_client.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: xapix_client
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Oliver Thamm
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-08-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.7'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.7'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: json_api_client
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 1.0.0.beta6
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 1.0.0.beta6
|
|
55
|
+
description: Access xapix.io hosted projects with the ActiveResource based json_api_client
|
|
56
|
+
library.
|
|
57
|
+
email:
|
|
58
|
+
- oliver@xapix.io
|
|
59
|
+
executables: []
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- lib/xapix_client.rb
|
|
64
|
+
- lib/xapix_client/config.rb
|
|
65
|
+
- lib/xapix_client/connection.rb
|
|
66
|
+
- lib/xapix_client/resource.rb
|
|
67
|
+
- lib/xapix_client/version.rb
|
|
68
|
+
homepage: http://www.xapix.io
|
|
69
|
+
licenses:
|
|
70
|
+
- MIT
|
|
71
|
+
metadata: {}
|
|
72
|
+
post_install_message:
|
|
73
|
+
rdoc_options: []
|
|
74
|
+
require_paths:
|
|
75
|
+
- lib
|
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - ">="
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '0'
|
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
|
+
requirements:
|
|
83
|
+
- - ">="
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: '0'
|
|
86
|
+
requirements: []
|
|
87
|
+
rubyforge_project:
|
|
88
|
+
rubygems_version: 2.4.5
|
|
89
|
+
signing_key:
|
|
90
|
+
specification_version: 4
|
|
91
|
+
summary: Client to the xapix.io API
|
|
92
|
+
test_files: []
|