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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3a9a7a2e2b527a50937de68b43d92875efd6d3ebed6b825d6ab85b2ac1b77fc
4
- data.tar.gz: 50209788fbf7a82ecf0750156595830884972c319398a4415a64ec1dfa042641
3
+ metadata.gz: ae1d9434be1802eefa535368f51e940b4b9930cb3ea45f65e3641d77f73e523c
4
+ data.tar.gz: 23ee21c1b129404c809b8b68487b4e7f8040c4f5435f268e589135d13b945b96
5
5
  SHA512:
6
- metadata.gz: 9e2f8f7182e97a7d05c7415ceb8cf85a4b4548f5e091dc3411aa873a1b922d8968b14f2a0c96288eb6473be6eb9fad00f50e75b424f7133e124b33a89d471e62
7
- data.tar.gz: 8795cfc3472e6eb06f81167c0eb718d1811b059c39e702a98c6834d57a2f58b9bd6c1d362ab3b72a04e968cc32e8c0067cf3680154bd54e796100356c21b6797
6
+ metadata.gz: 8926d2ea3128193406fc82d3c97a3d0e40f803d86b4b73f658716fb4e128e717c0a073e23f012d66c437835f85ac6a539626b15ed47982d19857a927d34388e6
7
+ data.tar.gz: 190ed66fedd153f1c023f60212266a461585665efcd6c6196e85b589ab67f7ba1c3bdbe18d730fb97052dc3a63bf67cfd0fe40d3224f1059416bc302c4bac940
data/lib/app_builder.rb CHANGED
@@ -17,3 +17,4 @@ require "app_builder/base"
17
17
  require "app_builder/archiver"
18
18
  require "app_builder/builder"
19
19
  require "app_builder/uploader"
20
+ require "app_builder/environment.rb"
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AppBuilder
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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.6
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