heroku-readonly 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/heroku/readonly.rb +13 -0
- metadata +2 -2
data/lib/heroku/readonly.rb
CHANGED
@@ -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
|