egg 0.4.1 → 0.5.0

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
  SHA1:
3
- metadata.gz: 78b772cde743c04ccb4592b24da7345460149b2a
4
- data.tar.gz: 4df4dcb8cbe47b91274a7718d03e29082214a490
3
+ metadata.gz: d75e3a224f4e96b79ba91e6e62b43b46efed0f15
4
+ data.tar.gz: 835698e87464bf1fe70cbcdb3bfa910c7c4c1054
5
5
  SHA512:
6
- metadata.gz: 156ebf1cc206873d0373421c857353805d921fe7b51da4cef3b085bd33b38cde80350c4941c16259de33390688ba0c72c79fc8c7925a09d0369854cf968133b2
7
- data.tar.gz: 1226702a62e2d9539cacceee21aab88175e33b7b4ec1b9aba57ecc2be3261d7c0a7583a5c6596c7b0f9908fc48a15f7c6deaffe865e133137fbf4965d1d72076
6
+ metadata.gz: ed225dc0cc7953ab54988a3d337147d9f9e6bdac9a24a589b749f81d223fb512dc68a2fc52a8292c2d973bbaad21041611e284ec1fa8dc1fddac18a4df36b7e2
7
+ data.tar.gz: fab3916a82f6eff8524a9c4c9f7de4ade7c1a32c922ef070e7a4726c2fc1dbff1cf8bfe89919fd7f196a38c5dd34068d7f3c557427a5f2af09ea0752f71ebf74
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- egg (0.4.1)
4
+ egg (0.5.0)
5
5
  thor (~> 0.19.4)
6
6
 
7
7
  GEM
@@ -87,4 +87,4 @@ DEPENDENCIES
87
87
  rspec_junit_formatter (~> 0.2.3)
88
88
 
89
89
  BUNDLED WITH
90
- 1.15.3
90
+ 1.15.4
data/README.md CHANGED
@@ -14,7 +14,7 @@ Maintainers:
14
14
  * [Jason Sisk](https://github.com/sisk)
15
15
 
16
16
  This gem is currently heavily focused on Ruby and Rails projects relevant within
17
- the Belly organization. The eventual goal is for this to become language and
17
+ the Hatch organization. The eventual goal is for this to become language and
18
18
  framework agnostic, though the configuration language will be Ruby.
19
19
 
20
20
  ## Installation
@@ -18,9 +18,7 @@ module Egg
18
18
  raise(MissingPropertyError, "Must populate #{attr}") if send(attr).nil?
19
19
  end
20
20
 
21
- unrendered_output = template.reduce("") do |out, (command, string)|
22
- out << command.to_s.upcase << " " << string << "\n"
23
- end
21
+ unrendered_output = compile_unrendered_output
24
22
 
25
23
  ERB.new(unrendered_output).result(binding)
26
24
  end
@@ -29,6 +27,13 @@ module Egg
29
27
  template.insert(do_before(before), [:run, command])
30
28
  end
31
29
 
30
+ def env(env_hash)
31
+ env_string = env_hash.reduce("") do |out, (key, value)|
32
+ out << key.to_s.upcase << '="' << value.to_s << '" '
33
+ end
34
+ template << [:env, env_string]
35
+ end
36
+
32
37
  private
33
38
 
34
39
  def do_before(before)
@@ -36,6 +41,13 @@ module Egg
36
41
  template.index { |tc| tc[0] == before[0] } ||
37
42
  -1
38
43
  end
44
+
45
+ def compile_unrendered_output
46
+ final_template = template << [:cmd, "<%= command %>"]
47
+ final_template.reduce("") do |out, (command, string)|
48
+ out << command.to_s.upcase << " " << string << "\n"
49
+ end
50
+ end
39
51
  end
40
52
  end
41
53
  end
@@ -25,8 +25,7 @@ module Egg
25
25
  [:add, "package.json $APP_HOME/"],
26
26
  [:add, "yarn.lock $APP_HOME/"],
27
27
  [:run, "yarn install"],
28
- [:add, ". $APP_HOME"],
29
- [:cmd, "<%= command %>"]
28
+ [:add, ". $APP_HOME"]
30
29
  ]
31
30
  end
32
31
  end
@@ -29,8 +29,7 @@ module Egg
29
29
  [:add, "Gemfile* $APP_HOME/"],
30
30
  [:env, "BUNDLE_GEMFILE=$APP_HOME/Gemfile BUNDLE_JOBS=4 BUNDLE_WITHOUT=production:staging"],
31
31
  [:run, "bundle install"],
32
- [:add, ". $APP_HOME"],
33
- [:cmd, "<%= command %>"]
32
+ [:add, ". $APP_HOME"]
34
33
  ]
35
34
  end
36
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Egg
4
- VERSION = "0.4.1".freeze
4
+ VERSION = "0.5.0".freeze
5
5
  end
@@ -4,4 +4,5 @@ log
4
4
  tmp
5
5
  node_modules
6
6
  coverage
7
- public/system
7
+ public/system
8
+ .env
@@ -8,6 +8,7 @@ Egg::Configuration.new do |config|
8
8
  # self.dockerfile = Dockerfile.use "Ruby"
9
9
  # self.dockerfile.ruby_version = "2.4.0"
10
10
  # self.dockerfile.command = "bin/rails server -p 3000"
11
+ # self.dockerfile.env(dotenv.env)
11
12
 
12
13
  # Example docker_compose config:
13
14
  # app = config.docker_compose.service "app"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Thuringer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-09-07 00:00:00.000000000 Z
12
+ date: 2017-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor