bitballoon 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c588189c9a104f90e2ad87493ceb496ca7d5aa01
4
- data.tar.gz: 411c2dc541f248a0751e071746a86ae024e46284
3
+ metadata.gz: 5b8520fe1c7482825685f04a9ab111a156f25ecf
4
+ data.tar.gz: 559da8ab6620be8f7c4b891f0687b70d5bef9503
5
5
  SHA512:
6
- metadata.gz: e196e56cd6b436727c08696a9f371eb080d1fe3faa94438a8b56a9a3035f7cbf05c735ebc1a3e52262a8ada9b7fa9c743e44ebf233f001c32ca08be7d86f67d5
7
- data.tar.gz: 4a81d173863aafac2c6bd2abe669b3f45344d9dd8bf502c70fccae5c0b9fc7d2dffe45f8127bce4d307d3639174f41bcc24c660b8d60351400a1402bbc4415e5
6
+ metadata.gz: 7d466eb1a266999107416d660f18ed14a8845670de1b6fccdcd4d4e73e48816f7624a993d2bd307b459bebb5f4fb39d02da27ca4bb2f8a13222893df0526b663
7
+ data.tar.gz: 5e34e31567ee5f417d0987d6f20ffa591eacc11161a7f25f94b885dae149c6b800eb1d753a742cadedeee6d45bd5963a03c4110d1186cae938904d8d94ddc54f
@@ -48,10 +48,11 @@ module BitBalloon
48
48
  state == "error"
49
49
  end
50
50
 
51
- def restore
51
+ def publish
52
52
  response = client.request(:post, ::File.join(path, "restore"))
53
53
  process(response.parsed)
54
54
  self
55
55
  end
56
+ alias :restore :publish
56
57
  end
57
58
  end
@@ -7,14 +7,15 @@ module BitBalloon
7
7
  def create(attributes)
8
8
  if attributes[:dir]
9
9
  response = client.request(:post, path,
10
- :body => JSON.generate({:files => inventory(attributes[:dir])}),
10
+ :body => JSON.generate({:files => inventory(attributes[:dir]), :draft => attributes[:draft] || false}),
11
11
  :headers => {"Content-Type" => "application/json"}
12
12
  )
13
13
  Deploy.new(client, response.parsed).tap do |deploy|
14
14
  deploy.upload_dir(attributes[:dir])
15
15
  end
16
16
  elsif attributes[:zip]
17
- response = client.request(:post, path,
17
+ request_path = attributes[:draft] ? "#{path}?draft=true" : path
18
+ response = client.request(:post, request_path,
18
19
  :body => ::File.read(attributes[:zip]),
19
20
  :headers => {"Content-Type" => "application/zip"}
20
21
  )
@@ -24,6 +25,10 @@ module BitBalloon
24
25
  end
25
26
  end
26
27
 
28
+ def draft(attributes)
29
+ create(attributes.merge(:draft => true))
30
+ end
31
+
27
32
  private
28
33
  def inventory(dir)
29
34
  files = {}
@@ -1,3 +1,3 @@
1
1
  module BitBalloon
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitballoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Biilmann Christensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-02 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2