roku_builder 3.4.3 → 3.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/roku_builder/config_parser.rb +10 -7
- data/lib/roku_builder/version.rb +1 -1
- data/tests/roku_builder/config_parser_test.rb +22 -0
- data/tests/roku_builder/test_helper.rb +16 -0
- 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: b2edf88ef8bebe2d25296ac9df69d5e79f645051
|
4
|
+
data.tar.gz: bebb326f1be6f127139a7a707a89c748fe455766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 670663b481d9f3c7a7a9d3504466b5b10e8ba1f6b8390ad2639345b80e09f1379d02897186d76751450cdb65c8e0e6b2fde55a41d22a8884727b5874dbf92aaa
|
7
|
+
data.tar.gz: 5aa407111a3c2cd822b9a19205dd55b0635985e29a8ed4c7348fe9a61a7519791c1e8e7cd36a058854e9a9614480e78aa74e8a22e289639df0e325855749b394
|
data/Gemfile.lock
CHANGED
@@ -39,16 +39,19 @@ module RokuBuilder
|
|
39
39
|
# @param config [Hash] The loaded config hash
|
40
40
|
# @param options [Hash] The options hash
|
41
41
|
def self.setup_project(config:, options:)
|
42
|
-
|
43
|
-
path =
|
42
|
+
unless options[:project]
|
43
|
+
path = Pathname.pwd
|
44
44
|
project = nil
|
45
45
|
config[:projects].each_pair {|key,value|
|
46
46
|
if value.is_a?(Hash)
|
47
|
-
repo_path = Pathname.new(value[:directory]).realdirpath
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
repo_path = Pathname.new(value[:directory]).realdirpath
|
48
|
+
path.descend do |path_parent|
|
49
|
+
if path_parent == repo_path
|
50
|
+
project = key
|
51
|
+
break
|
52
|
+
end
|
51
53
|
end
|
54
|
+
break if project
|
52
55
|
end
|
53
56
|
}
|
54
57
|
if project
|
@@ -86,7 +89,7 @@ module RokuBuilder
|
|
86
89
|
#Create Project Config
|
87
90
|
project_config = {}
|
88
91
|
if options[:current]
|
89
|
-
pwd =
|
92
|
+
pwd = Pathname.pwd.to_s
|
90
93
|
return MISSING_MANIFEST unless File.exist?(File.join(pwd, "manifest"))
|
91
94
|
project_config = {
|
92
95
|
directory: pwd,
|
data/lib/roku_builder/version.rb
CHANGED
@@ -16,4 +16,26 @@ class ConfigParserTest < Minitest::Test
|
|
16
16
|
assert_equal Hash, config.class
|
17
17
|
assert_equal "/dev/null", configs[:manifest_config][:root_dir]
|
18
18
|
end
|
19
|
+
|
20
|
+
def test_manifest_config_project_select
|
21
|
+
logger = Logger.new("/dev/null")
|
22
|
+
options = {
|
23
|
+
config: File.expand_path(File.join(File.dirname(__FILE__), "test_files", "controller_config_test", "valid_config.json")),
|
24
|
+
stage: 'production',
|
25
|
+
update_manifest: false,
|
26
|
+
fetch: false,
|
27
|
+
}
|
28
|
+
config = good_config
|
29
|
+
|
30
|
+
code = nil
|
31
|
+
configs = nil
|
32
|
+
|
33
|
+
Pathname.stub(:pwd, Pathname.new("/dev/nuller")) do
|
34
|
+
code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
|
35
|
+
end
|
36
|
+
|
37
|
+
assert_equal RokuBuilder::SUCCESS, code
|
38
|
+
assert_equal Hash, config.class
|
39
|
+
assert_equal "/dev/nuller", configs[:project_config][:directory]
|
40
|
+
end
|
19
41
|
end
|
@@ -39,6 +39,22 @@ def good_config
|
|
39
39
|
}
|
40
40
|
}
|
41
41
|
}
|
42
|
+
},
|
43
|
+
project2: {
|
44
|
+
directory: "/dev/nuller",
|
45
|
+
folders: ["resources","source"],
|
46
|
+
files: ["manifest"],
|
47
|
+
app_name: "<app name>",
|
48
|
+
stage_method: :git,
|
49
|
+
stages:{
|
50
|
+
production: {
|
51
|
+
branch: "production",
|
52
|
+
key: {
|
53
|
+
keyed_pkg: "/dev/null",
|
54
|
+
password: "<password for pkg>"
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
42
58
|
}
|
43
59
|
}
|
44
60
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roku_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greeneca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|