roku_builder 4.5.3 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +7 -0
- data/Gemfile.lock +7 -7
- data/lib/roku_builder.rb +1 -1
- data/lib/roku_builder/config.rb +11 -0
- data/lib/roku_builder/config_parser.rb +3 -3
- data/lib/roku_builder/version.rb +1 -1
- data/test/roku_builder/test_config.rb +26 -0
- data/test/roku_builder/test_config_parser.rb +35 -0
- data/test/roku_builder/test_files/config_test/local.json +0 -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: 14a9f485846b42df5df6187aeeb2611620c90efa
|
4
|
+
data.tar.gz: 52ccf4b5a9642cf40ec84552464ce03d542f7f17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0e3c653d5482fa18f1cf46d86fe8cd79a0f00db30c0317e886927027d6693a4f4292f7a9a66ddb2807ff9369d2e6bda1db0c17170e9060087df15ea48350d30
|
7
|
+
data.tar.gz: f2207a16b2bc713971293de9e553f6dbd53375dbf83119c5d71d30cb36c3cd271bc39d3ce1ff7d2e6789f07ba6ea26920866bcab6c6f5d590e2a926739a0bf2a
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
roku_builder (4.
|
4
|
+
roku_builder (4.6.0)
|
5
5
|
faraday (~> 0.13)
|
6
6
|
faraday-digestauth (~> 0.2)
|
7
7
|
git (~> 1.3)
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
public_suffix (>= 2.0.2, < 4.0)
|
19
19
|
ansi (1.5.0)
|
20
20
|
ast (2.4.0)
|
21
|
-
byebug (10.0.
|
21
|
+
byebug (10.0.2)
|
22
22
|
coderay (1.1.2)
|
23
23
|
coveralls (0.8.21)
|
24
24
|
json (>= 1.8, < 3)
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
crack (0.4.3)
|
30
30
|
safe_yaml (~> 1.0.0)
|
31
31
|
docile (1.1.5)
|
32
|
-
faraday (0.
|
32
|
+
faraday (0.15.0)
|
33
33
|
multipart-post (>= 1.2, < 3)
|
34
34
|
faraday-digestauth (0.3.0)
|
35
35
|
faraday (~> 0.7)
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
59
59
|
rb-inotify (~> 0.9, >= 0.9.7)
|
60
60
|
ruby_dep (~> 1.2)
|
61
|
-
lumberjack (1.0.
|
61
|
+
lumberjack (1.0.13)
|
62
62
|
m (1.5.1)
|
63
63
|
method_source (>= 0.6.7)
|
64
64
|
rake (>= 0.9.2.2)
|
@@ -73,19 +73,19 @@ GEM
|
|
73
73
|
multipart-post (2.0.0)
|
74
74
|
nenv (0.3.0)
|
75
75
|
net-http-digest_auth (1.4.1)
|
76
|
-
net-ping (2.0.
|
76
|
+
net-ping (2.0.4)
|
77
77
|
net-telnet (0.1.1)
|
78
78
|
notiffany (0.1.1)
|
79
79
|
nenv (~> 0.1)
|
80
80
|
shellany (~> 0.0)
|
81
|
-
oga (2.
|
81
|
+
oga (2.15)
|
82
82
|
ast
|
83
83
|
ruby-ll (~> 2.1)
|
84
84
|
pry (0.11.3)
|
85
85
|
coderay (~> 1.1.0)
|
86
86
|
method_source (~> 0.9.0)
|
87
87
|
public_suffix (3.0.2)
|
88
|
-
rake (12.3.
|
88
|
+
rake (12.3.1)
|
89
89
|
rb-fsevent (0.10.3)
|
90
90
|
rb-inotify (0.9.10)
|
91
91
|
ffi (>= 0.5.0, < 2)
|
data/lib/roku_builder.rb
CHANGED
@@ -37,7 +37,6 @@ module RokuBuilder
|
|
37
37
|
# @param options [Hash] The options hash
|
38
38
|
def self.run(options: nil)
|
39
39
|
@@options = nil
|
40
|
-
@@dev = false
|
41
40
|
setup_plugins
|
42
41
|
setup_options(options: options)
|
43
42
|
return unless @@options
|
@@ -75,6 +74,7 @@ module RokuBuilder
|
|
75
74
|
end
|
76
75
|
|
77
76
|
def self.register_plugin(plugin)
|
77
|
+
@@dev ||= false
|
78
78
|
@@plugins ||= []
|
79
79
|
@@plugins.delete(plugin) if @@dev
|
80
80
|
@@plugins << plugin
|
data/lib/roku_builder/config.rb
CHANGED
@@ -121,10 +121,21 @@ module RokuBuilder
|
|
121
121
|
local_config_path = "./.roku_config.json"
|
122
122
|
if File.exist?(local_config_path)
|
123
123
|
local_config_hash = read_config(File.open(local_config_path))
|
124
|
+
add_missing_directories(local_config_hash)
|
124
125
|
@config = @config.deep_merge(local_config_hash)
|
125
126
|
end
|
126
127
|
end
|
127
128
|
|
129
|
+
def add_missing_directories(local_config)
|
130
|
+
if local_config[:projects]
|
131
|
+
local_config[:projects].each_pair do |key,value|
|
132
|
+
unless value[:directory]
|
133
|
+
local_config[:projects][key][:directory] = RokuBuilder.system(command: "pwd")
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
128
139
|
def fix_config_symbol_values
|
129
140
|
if @config[:devices]
|
130
141
|
@config[:devices][:default] = @config[:devices][:default].to_sym
|
@@ -73,7 +73,7 @@ module RokuBuilder
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def get_repo_path(project_config:)
|
76
|
-
if @config[:projects][:project_dir]
|
76
|
+
if @config[:projects][:project_dir] and !Pathname.new(project_config[:directory]).absolute?
|
77
77
|
Pathname.new(File.join(@config[:projects][:project_dir], project_config[:directory])).realdirpath
|
78
78
|
else
|
79
79
|
Pathname.new(project_config[:directory]).realdirpath
|
@@ -137,7 +137,7 @@ module RokuBuilder
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def set_project_directory
|
140
|
-
if @config[:projects][:project_dir]
|
140
|
+
if @config[:projects][:project_dir] and !Pathname.new(@parsed[:project][:directory]).absolute?
|
141
141
|
@parsed[:project][:directory] = File.join(@config[:projects][:project_dir], @parsed[:project][:directory])
|
142
142
|
end
|
143
143
|
unless Dir.exist?(@parsed[:project][:directory])
|
@@ -170,7 +170,7 @@ module RokuBuilder
|
|
170
170
|
def get_global_key_config
|
171
171
|
raise ParseError, "Unknown Key: #{@parsed[:key]}" unless @config[:keys][@parsed[:key].to_sym]
|
172
172
|
@parsed[:key] = @config[:keys][@parsed[:key].to_sym].dup
|
173
|
-
if @config[:keys][:key_dir]
|
173
|
+
if @config[:keys][:key_dir] and !@parsed[:key][:keyed_pkg].start_with?("./")
|
174
174
|
@parsed[:key][:keyed_pkg] = File.join(@config[:keys][:key_dir], @parsed[:key][:keyed_pkg])
|
175
175
|
end
|
176
176
|
end
|
data/lib/roku_builder/version.rb
CHANGED
@@ -103,6 +103,32 @@ module RokuBuilder
|
|
103
103
|
assert_equal "app2", config.raw[:projects][:p2][:app_name]
|
104
104
|
end
|
105
105
|
|
106
|
+
def test_config_read_local_directory
|
107
|
+
options = build_options({config: File.join(test_files_path(ConfigTest), "config.json"), validate: true})
|
108
|
+
config = Config.new(options: options)
|
109
|
+
|
110
|
+
mock = Minitest::Mock.new
|
111
|
+
io = proc { |path|
|
112
|
+
if path == './.roku_config.json'
|
113
|
+
mock
|
114
|
+
else
|
115
|
+
IO.new(IO.sysopen(path))
|
116
|
+
end
|
117
|
+
}
|
118
|
+
local_config_content = IO.read(File.join(test_files_path(ConfigTest), "local.json"))
|
119
|
+
mock.expect(:read, local_config_content)
|
120
|
+
|
121
|
+
File.stub(:exist?, true) do
|
122
|
+
File.stub(:open, io) do
|
123
|
+
config.load
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
mock.verify
|
128
|
+
refute_nil config.raw[:projects][:p2]
|
129
|
+
assert_equal `pwd`.chomp, config.raw[:projects][:p2][:directory]
|
130
|
+
end
|
131
|
+
|
106
132
|
def test_config_edit
|
107
133
|
orginal = File.join(test_files_path(ConfigTest), "config.json")
|
108
134
|
tmp = File.join(test_files_path(ConfigTest), "tmpconfig.json")
|
@@ -196,6 +196,24 @@ module RokuBuilder
|
|
196
196
|
assert_equal "/tmp/project2", configs[:project][:directory]
|
197
197
|
end
|
198
198
|
|
199
|
+
def test_manifest_config_project_directory_select
|
200
|
+
options = build_options({validate: true, working: true})
|
201
|
+
options.define_singleton_method(:source_commands){[:validate]}
|
202
|
+
config = good_config(ConfigParserTest)
|
203
|
+
config[:projects][:project_dir] = "/tmp"
|
204
|
+
config[:projects][:project1][:directory] = "/tmp/project1"
|
205
|
+
|
206
|
+
configs = nil
|
207
|
+
Pathname.stub(:pwd, Pathname.new("/tmp/project1")) do
|
208
|
+
Dir.stub(:exist?, true) do
|
209
|
+
configs = ConfigParser.parse(options: options, config: config)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
assert_equal Hash, config.class
|
214
|
+
assert_equal "/tmp/project1", configs[:project][:directory]
|
215
|
+
end
|
216
|
+
|
199
217
|
def test_key_config_key_directory
|
200
218
|
tmp_file = Tempfile.new("pkg")
|
201
219
|
options = build_options({validate: true, project: :project2, stage: 'production'})
|
@@ -211,6 +229,23 @@ module RokuBuilder
|
|
211
229
|
tmp_file.close
|
212
230
|
end
|
213
231
|
|
232
|
+
def test_key_config_key_local_directory
|
233
|
+
tmp_file = Tempfile.new("pkg")
|
234
|
+
FileUtils.touch("./pkg")
|
235
|
+
options = build_options({validate: true, project: :project2, stage: 'production'})
|
236
|
+
options.define_singleton_method(:source_commands){[:validate]}
|
237
|
+
config = good_config(ConfigParserTest)
|
238
|
+
config[:keys][:key_dir] = File.dirname(tmp_file.path)
|
239
|
+
config[:keys][:a][:keyed_pkg] = "./pkg"
|
240
|
+
|
241
|
+
configs = ConfigParser.parse(options: options, config: config)
|
242
|
+
|
243
|
+
assert_equal Hash, config.class
|
244
|
+
assert_equal "./pkg", configs[:key][:keyed_pkg]
|
245
|
+
tmp_file.close
|
246
|
+
FileUtils.rm("./pkg")
|
247
|
+
end
|
248
|
+
|
214
249
|
def test_key_config_key_directory_bad
|
215
250
|
tmp_file = Tempfile.new("pkg")
|
216
251
|
options = build_options({validate: true, project: :project2, stage: 'production'})
|
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: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greeneca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|