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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d28cad03130a266188e433581578fa4739f4843
4
- data.tar.gz: 1660b47dccaab5eed34f3bf106b8c93d7ad113f2
3
+ metadata.gz: 4bd8759aa69ba9c8be4af307d8cd6fd30a6b9a59
4
+ data.tar.gz: 42ebafa286ba41aa3b359ea1a8fb33282de20ad7
5
5
  SHA512:
6
- metadata.gz: 16c53a086c95cf1ab2121529baf5cb340fe3afdc241f11000f117d2d78eac11f9c53ca539562c90803ae124a833b9f0d92904d4c43a6239d286b653935fc4e4d
7
- data.tar.gz: cec1773964fbd6b881ca176dcb7a6bb06128bb33ba0e6ee6de9571673da5caaaa899b2831ab79580e2d41e5c76ca36f4cb570bd5ad31d7a60762414bd14b67f5
6
+ metadata.gz: 08eaf74687f71476a53c254fffaa77527f3a5717e26574ed2d08983a10fc5a6fcfcd45fab15a21c4ebae1d719d8047f843b0404b9d0e51d453893988bf89d024
7
+ data.tar.gz: ee95d9ca95501b46e216ad9402d1c4b48e6422725adc84514c8806fa46cfa294012544d228bea61834d0b3863e1280ec9310774136941b625de2b67f9dd509b1
@@ -3,7 +3,12 @@ module CodePicnic
3
3
  include APIRequest
4
4
 
5
5
  @api_url = "https://codepicnic.com/api/consoles"
6
- attr_accessor :id, :name, :container_name, :container_type, :custom_image, :created_at, :permalink, :url
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module CodePicnic
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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-05-12 00:00:00.000000000 Z
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.5.1
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.