ufo 0.1.4 → 0.1.5

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: a9432f2c3713a1f96731dd9e6a5cc7101521da75
4
- data.tar.gz: d9a4ca89067032cfbc4dc2321f1695b1a0a52d53
3
+ metadata.gz: 70e2da23bce8f5526cc2c44e2038b8548001854a
4
+ data.tar.gz: 71cb5de075c4d1fe268ce864405369b5b290c79f
5
5
  SHA512:
6
- metadata.gz: 45c58c951fef5bd1cf2ee84010d9e6d66a030ca84953f73c41fec0e3376a95f5ccfc0c48d584bfa0b5ca76ae9b158f36ce0ee7508386a94ea995404779a2e696
7
- data.tar.gz: 9223378f163ecedaba6bd91a92dc8f7a50e8c8975ec34167da41084c08aba1f4689b3478954d19636d1116e608aa4f4a0c04070c4d1146b2de6793c2a2b09d24
6
+ metadata.gz: 00d74b27a780c3cfec842868ae2feadea18dc83ab3fd279896b7f2995db1a84a03be2f1119ba46f3ca67c437f8599fc9ba297ad9b3347d9cad760669b1a0d19d
7
+ data.tar.gz: 4cd0f300b83bd95b44955881c32b09566f16f9e3a8e14fc28e7a732cb8128518372b86eb24d56393b0de637870ea2bc7c3c25b926180c0b6c5ad2ff294fa962d
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.1.5]
7
+
8
+ * helper.env_file instead of env_vars method
9
+
6
10
  ## [0.1.2]
7
11
 
8
12
  * remove byebug dependency and fix task register task
@@ -12,7 +12,7 @@ common = {
12
12
  image: helper.full_image_name, # includes the git sha tongueroo/hi:ufo-[sha].
13
13
  cpu: 128,
14
14
  memory_reservation: 256,
15
- environment: env_file(".env")
15
+ environment: helper.env_file(".env")
16
16
  }
17
17
 
18
18
  task_definition "<%= @app %>-web" do
@@ -12,7 +12,7 @@ module Ufo
12
12
  builder.push if options[:push]
13
13
  end
14
14
 
15
- desc "base", "builds docker image from Dockerfile.base"
15
+ desc "base", "builds docker image from Dockerfile.base and update current Dockerfile"
16
16
  long_desc CLI::Help.docker_base
17
17
  option :push, type: :boolean, default: true
18
18
  def base
@@ -55,37 +55,6 @@ module Ufo
55
55
  @task_definitions << TaskDefinition.new(self, name, @options, &block)
56
56
  end
57
57
 
58
- def env_vars(text)
59
- lines = filtered_lines(text)
60
- lines.map do |line|
61
- key,value = line.strip.split("=").map {|x| x.strip}
62
- {
63
- name: key,
64
- value: value,
65
- }
66
- end
67
- end
68
-
69
- def env_file(path)
70
- full_path = "#{@project_root}/#{path}"
71
- unless File.exist?(full_path)
72
- puts "The #{full_path} env file could not be found. Are you sure it exists?"
73
- exit 1
74
- end
75
- text = IO.read(full_path)
76
- env_vars(text)
77
- end
78
-
79
- def filtered_lines(text)
80
- lines = text.split("\n")
81
- # remove comment at the end of the line
82
- lines.map! { |l| l.sub(/#.*/,'').strip }
83
- # filter out commented lines
84
- lines = lines.reject { |l| l =~ /(^|\s)#/i }
85
- # filter out empty lines
86
- lines = lines.reject { |l| l.strip.empty? }
87
- end
88
-
89
58
  def helper
90
59
  Helper.new(@options)
91
60
  end
@@ -28,6 +28,37 @@ module Ufo
28
28
 
29
29
  #############
30
30
  # helper methods
31
+ def env_vars(text)
32
+ lines = filtered_lines(text)
33
+ lines.map do |line|
34
+ key,value = line.strip.split("=").map {|x| x.strip}
35
+ {
36
+ name: key,
37
+ value: value,
38
+ }
39
+ end
40
+ end
41
+
42
+ def filtered_lines(text)
43
+ lines = text.split("\n")
44
+ # remove comment at the end of the line
45
+ lines.map! { |l| l.sub(/#.*/,'').strip }
46
+ # filter out commented lines
47
+ lines = lines.reject { |l| l =~ /(^|\s)#/i }
48
+ # filter out empty lines
49
+ lines = lines.reject { |l| l.strip.empty? }
50
+ end
51
+
52
+ def env_file(path)
53
+ full_path = "#{@project_root}/#{path}"
54
+ unless File.exist?(full_path)
55
+ puts "The #{full_path} env file could not be found. Are you sure it exists?"
56
+ exit 1
57
+ end
58
+ text = IO.read(full_path)
59
+ env_vars(text)
60
+ end
61
+
31
62
  def settings
32
63
  @settings ||= Settings.new(@project_root)
33
64
  end
@@ -1,3 +1,3 @@
1
1
  module Ufo
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-16 00:00:00.000000000 Z
11
+ date: 2017-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor