vagrant_cloud 0.1.0 → 0.2.0

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: bdd043af5670ef6a78487763aeabe0f860bf23b6
4
- data.tar.gz: 4776927f8b2d0fedf242cc026a57ec36ad4b9384
3
+ metadata.gz: 977ffdd0c89f9fe2e1ca9a0d566f33332ee31c89
4
+ data.tar.gz: 1479ff5997c230151cb22b1e241c0426aed2f29c
5
5
  SHA512:
6
- metadata.gz: 53dcd676d20dcbb30a3f16055c18a700c17b304c60f5b810f5305cdb7dfb1a0b16841c674c66e47ab50919dc3a62ecee03f593bce6c05846e6eaac754fb69666
7
- data.tar.gz: d751eb2f840bfa329f7ef9550c7d8bdd79fd43c22b309414e577b3933b13b64ea1494a612dd97b035b859a577cf190412ae170be9b63c2b3ab1afc9db2ddcd0e
6
+ metadata.gz: 7edc5f47d0623fa35dd0f69d71c77a098e32d0ee9ce5144137921ea8d0071574ea4e796f4e964fcdc4da2d8603917bf1a26d050c0009d8c8c70d5a035d783de1
7
+ data.tar.gz: ec2c027e276dab7d1617572eb2fff665d903fdcef2a654f9835349e65fc843abb8937c11946add27f9ce9c08ee24ed580375c3e06624b4b7034e3b417ced2395
data/README.md CHANGED
@@ -2,3 +2,19 @@ vagrant_cloud
2
2
  =============
3
3
 
4
4
  *Very* minimalistic ruby wrapper for the [Vagrant Cloud API](https://vagrantcloud.com/api).
5
+
6
+ Consisting of four basic classes for your *account*, *boxes*, *versions* and *providers*.
7
+
8
+ Usage
9
+ -----
10
+
11
+ ```ruby
12
+ account = VagrantCloud::Account.new('<username>', '<access_token>')
13
+ box = vagrant_cloud.ensure_box('my_box')
14
+ version = box.ensure_version('0.0.1')
15
+ provider_foo = version.ensure_provider('foo', 'http://example.com/foo.box')
16
+ provider_bar = version.ensure_provider('bar', 'http://example.com/bar.box')
17
+
18
+ version.release
19
+ puts provider_foo.download_url
20
+ ```
data/lib/vagrant_cloud.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module VagrantCloud
2
+ require 'json'
2
3
  require 'rest_client'
3
4
 
4
5
  require 'vagrant_cloud/account'
@@ -20,10 +20,18 @@ module VagrantCloud
20
20
  data['description_markdown']
21
21
  end
22
22
 
23
+ def status
24
+ data['status']
25
+ end
26
+
23
27
  def providers
24
28
  data['providers'].map { |data| Provider.new(self, data['name'], data) }
25
29
  end
26
30
 
31
+ def to_s
32
+ version
33
+ end
34
+
27
35
  def data
28
36
  @data ||= account.request('get', "/box/#{account.username}/#{box.name}/version/#{number}")
29
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-03 00:00:00.000000000 Z
11
+ date: 2014-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest_client