codepicnic 0.1.10 → 0.1.10.1

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: 888acb3dad7df628e8f311dbf1de0a1c1aaad55d
4
- data.tar.gz: 4ff6ab324e928d28105953e1dd29154a4d56de30
3
+ metadata.gz: d6773b95e21ad1da98f1b8c02631e09275f41f2d
4
+ data.tar.gz: 7cfdab9e96391f86bba1965e69296135f86fed88
5
5
  SHA512:
6
- metadata.gz: ab017b7b7f9247184b68862b3af353de45b9eae578785bccc4b3fdc04a1460ad01f1d705232e7b1ae5b50cc21219301e30282a8abd408b58ef679fbd37ddc208
7
- data.tar.gz: 76bb21266d4ea30a70c2636c218c29280fd05e79dc2e59802439b748d8336dc7283f26bdf3481be5f983373ffc99a59143c15d5501629bdf28e7676499235255
6
+ metadata.gz: 2b998172f6d0bdd0d88d43dc736aebb7e09ef4eaaa32b4b9add7f33eac0284c14e3b10f3f13ebf7392d37798592c7d18c7aec4e4995025e9e24e950baccd41d1
7
+ data.tar.gz: 941049c6244ad756590e63ed03a4b22065c2dc74b1ab2d1400222c039b912867cb66db8b09c2ad09985a2b679a33b2747accc36572954718124d5286e408e8da
data/README.md CHANGED
@@ -20,7 +20,63 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Coming soon
23
+ ### Authentication with Rest API
24
+
25
+ ```ruby
26
+ CodePicnic.client_id = "CLIENT_ID"
27
+ CodePicnic.client_secret = "CLIENT_SECRET"
28
+ puts CodePicnic.token
29
+ ```
30
+
31
+ `CodePicnic.client_id` saves your `CLIENT_ID` that is provided in your [profile page](https://codepicnic.com/dashboard/profile). The same happens with your `CLIENT_SECRET`. Next you generate the access token for authenticate your application.
32
+
33
+ For more information and examples, check out our [API's documentation](/docs/api)
34
+
35
+ ### Listing all your consoles
36
+
37
+ ```ruby
38
+ results = CodePicnic::Console.all
39
+ ```
40
+
41
+ ### Saving a new console
42
+
43
+ ```ruby
44
+ console = CodePicnic::Console.new(
45
+ container_type: "bash",
46
+ title: "api-spec",
47
+ container_size: "medium"
48
+ )
49
+ console.save
50
+ ```
51
+
52
+ `CodePicnic::Console.new` creates a new console with all the necessary parameters and then storage it with the `.save` method.
53
+
54
+ ## Console Parameters
55
+
56
+ For a better console customization we offer you the following parameters:
57
+
58
+ | Field | Values |
59
+ | ----- | ------ |
60
+ | `custom_image` | _(optional)_ Any of user's or Docker Hub's generated Docker image |
61
+ | `container_size` | `medium` (256 MB), `large` (512 MB), `xlarge` (1 GB) or `xxlarge` (3 GB) |
62
+ | `container_type` | `bash`, `js`, `mono`, `elixir`, `go`, `nodejs`, `php`, `python`, `python340`, `python350`, `ruby`, `dancer`, `laravel`, `phoenix`, `rails`, `mongodb`, `redis` |
63
+ | `title` | _(optional)_ Pick a name for your console. Make it personal! |
64
+ | `hostname` | _(optional)_ Any name you'd like to be used as your console hostname: `user@your_custom_hostname`
65
+ | `current_mode` | _(optional)_ The mode the console is currently in: `public`, `draft`, `collaborative` and `streaming`.
66
+
67
+ ## Methods
68
+
69
+ `CodePicnic::Console` has the following methods:
70
+
71
+ * `CodePicnic::Console#start` : Start the server attached to the console and returns the result.
72
+ * `CodePicnic::Console#stop`: Stop the server attached to the console and returns the result.
73
+ * `CodePicnic::Console#restart`: Restart the server attached to the console and returns the result.
74
+ * `CodePicnic::Console#upload_file(file, path = nil)`: Uploads a File object to the console to the `path`
75
+ * `CodePicnic::Console.find(container_name = "")` : Returns a single CodePicnic::Console instance
76
+ * `CodePicnic::Console.forks` : Check out the forks the console has.
77
+ * `CodePicnic::Console.file(path = "")` : Returns the list of files that has been added to the console.
78
+ * `CodePicnic::Console#exec(commands = [])` : Execute commands inside the server attached to the console and returns the commands content.
79
+ * `CodePicnic::Console.all` : Return an array of consoles created by the user.
24
80
 
25
81
  ## Development
26
82
 
@@ -12,7 +12,7 @@ module CodePicnic
12
12
  end
13
13
 
14
14
  def post_form(url, params = {})
15
- JSON.parse(RestClient.post "#{url}.json", params, {'Authorization' => "Bearer #{CodePicnic.token}", "Content-Type" => "application/x-www-form-urlencoded; charset=utf-8"})
15
+ JSON.parse(RestClient.post "#{url}.json", params, {'Authorization' => "Bearer #{CodePicnic.token}", "Content-Type" => "multipart/form-data"})
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module CodePicnic
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.10.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codepicnic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alvaro Pereyra