heroku-readonly 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. data/lib/heroku/readonly.rb +13 -0
  2. metadata +2 -2
@@ -57,5 +57,18 @@ module Heroku
57
57
  @enabled
58
58
  end
59
59
  end
60
+
61
+ def self.update(put_url, body)
62
+ out = `curl -s -m 3 -X PUT -H "Content-Type:" -d "#{body}" "#{put_url}"`
63
+ raise(out) unless ($? == 0)
64
+ end
65
+
66
+ def self.enable(put_url)
67
+ update(put_url, "readonly")
68
+ end
69
+
70
+ def self.disable(put_url)
71
+ update(put_url, "ok")
72
+ end
60
73
  end
61
74
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Heroku