Class: Rhohub::Base
Class Method Summary
collapse
-
.catch_all ⇒ Object
-
.check(options, resource) ⇒ Object
-
.create(options, data, resource) ⇒ Object
-
.delete(options, resource) ⇒ Object
options = => build_id || app_id.
-
.list(options, resource) ⇒ Object
options = => app_id || nil.
-
.login(options, resource) ⇒ Object
-
.platforms(options, resource) ⇒ Object
-
.show(options, resource) ⇒ Object
options = => build_id || app_id.
-
.supported_gems(options, resource) ⇒ Object
-
.user_status(options, resource) ⇒ Object
Class Method Details
.catch_all ⇒ Object
3
4
5
6
7
8
9
10
11
12
|
# File 'lib/build/rhohub/base.rb', line 3
def self.catch_all
begin
raise Exception.new "you need to enter an api_token first ex:ENV['api_token']=sometoken" unless Rhohub.token
yield
rescue Exception => e
raise end
end
|
.check(options, resource) ⇒ Object
41
42
43
44
|
# File 'lib/build/rhohub/base.rb', line 41
def self.check(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].get
resp.body
end
|
.create(options, data, resource) ⇒ Object
14
15
16
17
|
# File 'lib/build/rhohub/base.rb', line 14
def self.create(options,data,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].post data.to_json
resp.body
end
|
.delete(options, resource) ⇒ Object
options = => build_id || app_id
25
26
27
28
|
# File 'lib/build/rhohub/base.rb', line 25
def self.delete(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].delete
resp.body
end
|
.list(options, resource) ⇒ Object
options = => app_id || nil
31
32
33
34
|
# File 'lib/build/rhohub/base.rb', line 31
def self.list(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].get
resp.body
end
|
.login(options, resource) ⇒ Object
57
58
59
60
|
# File 'lib/build/rhohub/base.rb', line 57
def self.login(options,resource)
resp = Rhohub.requester(false)[Rhohub.resource_url(options,resource)].post( {:login => options[:username].downcase, :password => options[:password]})
resp.body
end
|
36
37
38
39
|
# File 'lib/build/rhohub/base.rb', line 36
def self.platforms(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].get
resp.body
end
|
.show(options, resource) ⇒ Object
options = => build_id || app_id
20
21
22
23
|
# File 'lib/build/rhohub/base.rb', line 20
def self.show(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].get
resp.body
end
|
.supported_gems(options, resource) ⇒ Object
52
53
54
55
|
# File 'lib/build/rhohub/base.rb', line 52
def self.supported_gems(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].get
resp.body
end
|
.user_status(options, resource) ⇒ Object
47
48
49
50
|
# File 'lib/build/rhohub/base.rb', line 47
def self.user_status(options,resource)
resp = Rhohub.requester[Rhohub.resource_url(options,resource)].get
resp.body
end
|