codepicnic 0.1.10 → 0.1.10.1
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 +4 -4
- data/README.md +57 -1
- data/lib/codepicnic/request.rb +1 -1
- data/lib/codepicnic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6773b95e21ad1da98f1b8c02631e09275f41f2d
|
4
|
+
data.tar.gz: 7cfdab9e96391f86bba1965e69296135f86fed88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/codepicnic/request.rb
CHANGED
@@ -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" => "
|
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
|
data/lib/codepicnic/version.rb
CHANGED