ufo 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/starter_project/ufo/task_definitions.rb +1 -1
- data/lib/ufo/cli.rb +1 -1
- data/lib/ufo/dsl.rb +0 -31
- data/lib/ufo/dsl/helper.rb +31 -0
- data/lib/ufo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70e2da23bce8f5526cc2c44e2038b8548001854a
|
4
|
+
data.tar.gz: 71cb5de075c4d1fe268ce864405369b5b290c79f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d74b27a780c3cfec842868ae2feadea18dc83ab3fd279896b7f2995db1a84a03be2f1119ba46f3ca67c437f8599fc9ba297ad9b3347d9cad760669b1a0d19d
|
7
|
+
data.tar.gz: 4cd0f300b83bd95b44955881c32b09566f16f9e3a8e14fc28e7a732cb8128518372b86eb24d56393b0de637870ea2bc7c3c25b926180c0b6c5ad2ff294fa962d
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/ufo/cli.rb
CHANGED
@@ -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
|
data/lib/ufo/dsl.rb
CHANGED
@@ -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
|
data/lib/ufo/dsl/helper.rb
CHANGED
@@ -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
|
data/lib/ufo/version.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2017-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|