codepicnic 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codepicnic/console.rb +11 -1
- data/lib/codepicnic/request.rb +3 -1
- data/lib/codepicnic/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bd8759aa69ba9c8be4af307d8cd6fd30a6b9a59
|
4
|
+
data.tar.gz: 42ebafa286ba41aa3b359ea1a8fb33282de20ad7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08eaf74687f71476a53c254fffaa77527f3a5717e26574ed2d08983a10fc5a6fcfcd45fab15a21c4ebae1d719d8047f843b0404b9d0e51d453893988bf89d024
|
7
|
+
data.tar.gz: ee95d9ca95501b46e216ad9402d1c4b48e6422725adc84514c8806fa46cfa294012544d228bea61834d0b3863e1280ec9310774136941b625de2b67f9dd509b1
|
data/lib/codepicnic/console.rb
CHANGED
@@ -3,7 +3,12 @@ module CodePicnic
|
|
3
3
|
include APIRequest
|
4
4
|
|
5
5
|
@api_url = "https://codepicnic.com/api/consoles"
|
6
|
-
|
6
|
+
|
7
|
+
class << self
|
8
|
+
attr_accessor :api_url
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_accessor :id, :name, :container_name, :container_type, :custom_image, :created_at, :permalink, :url, :is_headless
|
7
12
|
|
8
13
|
def initialize(opts={})
|
9
14
|
@id = opts.delete("id") || opts.delete(:id)
|
@@ -15,6 +20,11 @@ module CodePicnic
|
|
15
20
|
@container_size = opts.delete("container_size") || opts.delete(:container_size)
|
16
21
|
@title = @name || opts.delete("title") || opts.delete(:title)
|
17
22
|
@hostname = opts.delete("hostname") || opts.delete(:hostname)
|
23
|
+
@is_headless = opts.delete("is_headless") || opts.delete(:is_headless)
|
24
|
+
end
|
25
|
+
|
26
|
+
def find
|
27
|
+
get url_to(@container_name, "show")
|
18
28
|
end
|
19
29
|
|
20
30
|
def save
|
data/lib/codepicnic/request.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
1
3
|
module CodePicnic
|
2
4
|
class Request
|
3
5
|
class << self
|
@@ -6,7 +8,7 @@ module CodePicnic
|
|
6
8
|
end
|
7
9
|
|
8
10
|
def post(url, params = {})
|
9
|
-
JSON.parse(RestClient.post "#{url}.json", params, {'Authorization' => "Bearer #{CodePicnic.token}", "Content-Type" => "application/json; charset=utf-8"})
|
11
|
+
JSON.parse(RestClient.post "#{url}.json", params.to_json, {'Authorization' => "Bearer #{CodePicnic.token}", "Content-Type" => "application/json; charset=utf-8"})
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/codepicnic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codepicnic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alvaro Pereyra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.6.4
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Ruby Client for the CodePicnic's API.
|