motion-env 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/motion-env/builder.rb +5 -2
- data/motion-env.gemspec +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: ae360db512a9108b41846c1897e4bec775151f5c
|
4
|
+
data.tar.gz: 07409527f05b8850f70b75008bd043209eff08c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1febb33adb94f4202192f8d8b6e1df8bb0ec8c32b65432510720e85f663f5980996d0c47daebdf95e39ef791795593c5a98a664c86c2189e7c4a1b9920ce9996
|
7
|
+
data.tar.gz: 22450bff0e55f30d7fa1ffd420b920ea0423f7cb38fccfe4da8042efc2c114dc1e6af975bdcbd950611d0222ac7930db43fa394e84b032852a4ddbc23b59dcd3
|
data/Gemfile.lock
CHANGED
data/lib/motion-env/builder.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Motion; module Project;
|
2
2
|
class Builder
|
3
3
|
MARSHAL_SIGIL = "__marshall__"
|
4
|
+
NULL = "\x00"
|
5
|
+
NULL_REPLACEMENT = "\\x00"
|
6
|
+
|
4
7
|
def build_with_env(config, platform, opts)
|
5
8
|
config_env = config.env
|
6
9
|
File.open(config_env.file_path, 'w') { |f|
|
@@ -10,7 +13,7 @@ ENV.instance_eval do
|
|
10
13
|
def [](key)
|
11
14
|
value = @get_key_without_patch.call(key)
|
12
15
|
if value && value.start_with?("#{MARSHAL_SIGIL}")
|
13
|
-
value = Marshal.load(value.gsub("#{MARSHAL_SIGIL}", ""))
|
16
|
+
value = Marshal.load(value.gsub("#{MARSHAL_SIGIL}", "").gsub('#{NULL_REPLACEMENT}', '#{NULL}'))
|
14
17
|
end
|
15
18
|
value
|
16
19
|
end
|
@@ -19,7 +22,7 @@ end
|
|
19
22
|
config_env.each do |key, value|
|
20
23
|
dump_value = value
|
21
24
|
if !value.is_a?(String)
|
22
|
-
dump_value = MARSHAL_SIGIL + Marshal.dump(value).
|
25
|
+
dump_value = MARSHAL_SIGIL + Marshal.dump(value).gsub(NULL, NULL_REPLACEMENT)
|
23
26
|
end
|
24
27
|
f.write "ENV['#{key.to_s}'] = '#{dump_value}'\n"
|
25
28
|
end
|
data/motion-env.gemspec
CHANGED