app_builder 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/app_builder.rb +1 -0
- data/lib/app_builder/environment.rb +23 -0
- data/lib/app_builder/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae1d9434be1802eefa535368f51e940b4b9930cb3ea45f65e3641d77f73e523c
|
4
|
+
data.tar.gz: 23ee21c1b129404c809b8b68487b4e7f8040c4f5435f268e589135d13b945b96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8926d2ea3128193406fc82d3c97a3d0e40f803d86b4b73f658716fb4e128e717c0a073e23f012d66c437835f85ac6a539626b15ed47982d19857a927d34388e6
|
7
|
+
data.tar.gz: 190ed66fedd153f1c023f60212266a461585665efcd6c6196e85b589ab67f7ba1c3bdbe18d730fb97052dc3a63bf67cfd0fe40d3224f1059416bc302c4bac940
|
data/lib/app_builder.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module AppBuilder
|
2
|
+
class Environment
|
3
|
+
attr_accessor :name, :source
|
4
|
+
|
5
|
+
def initialize(name, source)
|
6
|
+
@name = name
|
7
|
+
@source = source
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_file(template_path, output_path)
|
11
|
+
File.open(output_path, "w") do |f|
|
12
|
+
f.write(ERB.new(File.read(template_path)).result(template_binding))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def template_binding
|
17
|
+
env = source.fetch(name.to_s)
|
18
|
+
Class.new.tap { |klass|
|
19
|
+
klass.define_method(:env) { env }
|
20
|
+
}.instance_eval { binding }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/app_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- i2bskn
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/app_builder/base.rb
|
130
130
|
- lib/app_builder/builder.rb
|
131
131
|
- lib/app_builder/config.rb
|
132
|
+
- lib/app_builder/environment.rb
|
132
133
|
- lib/app_builder/logger.rb
|
133
134
|
- lib/app_builder/server.rb
|
134
135
|
- lib/app_builder/template/manifest.yml.erb
|