biosphere 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.
- checksums.yaml +4 -4
- data/lib/biosphere/terraformproxy.rb +15 -8
- data/lib/biosphere/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: 940f2005624495fc81086e626786d411b3543065
|
4
|
+
data.tar.gz: eac7ef128ee3aa3ec68442b7ba3754d98eb0da96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa9042cc9931f1f2db0c27cf98ca672f803ce9146bff94f151562903812ccc987174a30ae594d17eca6d2d0444985258c745ec13b73ff4fe0fe5f1e76d03c450
|
7
|
+
data.tar.gz: 3c6a5a5096772ea19571ca3d965212e3cdd1f7f40d7f39fbac71e41212179d6e524e5ecb6276cf176d1f7d35e48f6790df9170f269d5dc608370bc25e1577758
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'biosphere/mixing/from_file.rb'
|
2
2
|
require 'json'
|
3
3
|
require 'pathname'
|
4
|
+
require 'base64'
|
5
|
+
require 'zlib'
|
4
6
|
|
5
7
|
class Biosphere
|
6
8
|
class ActionContext
|
@@ -19,10 +21,10 @@ class Biosphere
|
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
22
|
-
|
24
|
+
|
23
25
|
end
|
24
26
|
|
25
|
-
|
27
|
+
|
26
28
|
class PlanProxy
|
27
29
|
attr_accessor :node
|
28
30
|
def initialize()
|
@@ -68,6 +70,11 @@ class Biosphere
|
|
68
70
|
else
|
69
71
|
@output[symbol] = args[0]
|
70
72
|
end
|
73
|
+
|
74
|
+
# We need to first gzip and then base64-encode the user_data string to work around the 16kb size limitation in AWS
|
75
|
+
if symbol === :user_data
|
76
|
+
@output[symbol] = Base64.strict_encode64(Zlib::Deflate.new(nil, 31).deflate(args[0], Zlib::FINISH))
|
77
|
+
end
|
71
78
|
end
|
72
79
|
end
|
73
80
|
|
@@ -113,7 +120,7 @@ class Biosphere
|
|
113
120
|
src_path = Pathname.new(@src_path.last + "/" + File.dirname(filename)).cleanpath.to_s
|
114
121
|
# Push current src_path and overwrite @src_path so that it tracks recursive loads
|
115
122
|
@src_path << src_path
|
116
|
-
|
123
|
+
|
117
124
|
#puts "Trying to open file: " + src_path + "/" + File.basename(filename)
|
118
125
|
if File.exists?(src_path + "/" + File.basename(filename))
|
119
126
|
self.from_file(src_path + "/" + File.basename(filename))
|
@@ -166,13 +173,13 @@ class Biosphere
|
|
166
173
|
|
167
174
|
def node
|
168
175
|
return @plan_proxy.node
|
169
|
-
end
|
170
|
-
|
176
|
+
end
|
177
|
+
|
171
178
|
def evaluate_plans()
|
172
179
|
@plans.each do |resource|
|
173
180
|
@plan_proxy.instance_eval(&resource[:block])
|
174
181
|
end
|
175
|
-
|
182
|
+
|
176
183
|
end
|
177
184
|
|
178
185
|
def call_action(name, context)
|
@@ -197,10 +204,10 @@ class Biosphere
|
|
197
204
|
if block_given?
|
198
205
|
resource[:block] = block
|
199
206
|
else
|
200
|
-
STDERR.puts("WARNING: No block set for resource call '#{type}', '#{name}' at #{caller[0]}")
|
207
|
+
STDERR.puts("WARNING: No block set for resource call '#{type}', '#{name}' at #{caller[0]}")
|
201
208
|
end
|
202
209
|
|
203
|
-
|
210
|
+
|
204
211
|
|
205
212
|
@resources << resource
|
206
213
|
|
data/lib/biosphere/version.rb
CHANGED