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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bd482d491cdcd7d0fcdb0868cfd4a6a127b7550
4
- data.tar.gz: aa79081e34db9e1de4b65178a051afe0fde5b5a4
3
+ metadata.gz: b2edf88ef8bebe2d25296ac9df69d5e79f645051
4
+ data.tar.gz: bebb326f1be6f127139a7a707a89c748fe455766
5
5
  SHA512:
6
- metadata.gz: 6ac512ad7e5f80613cc1ec94f3ebc5da64ed55f98d2af28edafbc4905f36400239c972fefc0a123465bc645baaa9fc66586f885b7e5dc3e5d957d22528bbdac0
7
- data.tar.gz: c5c10aafa9eef6d3dab2f7ee90c4279b0b5ef6fdc828eb9542fd8a403e8574ed9f0bd451a1f180f5b38b89f6de7de755755014644e4db985850bd618ebc6160a
6
+ metadata.gz: 670663b481d9f3c7a7a9d3504466b5b10e8ba1f6b8390ad2639345b80e09f1379d02897186d76751450cdb65c8e0e6b2fde55a41d22a8884727b5874dbf92aaa
7
+ data.tar.gz: 5aa407111a3c2cd822b9a19205dd55b0635985e29a8ed4c7348fe9a61a7519791c1e8e7cd36a058854e9a9614480e78aa74e8a22e289639df0e325855749b394
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roku_builder (3.4.3)
4
+ roku_builder (3.4.4)
5
5
  faraday (~> 0.9)
6
6
  faraday-digestauth (~> 0.2)
7
7
  git (~> 1.3)
@@ -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
- if options[:current] or not options[:project]
43
- path = Controller.system(command: "pwd")
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.to_s
48
- if path.start_with?(repo_path)
49
- project = key
50
- break
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 = Controller.system(command: "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,
@@ -1,4 +1,4 @@
1
1
  module RokuBuilder
2
2
  # Version of the RokuBuilder Gem
3
- VERSION = "3.4.3"
3
+ VERSION = "3.4.4"
4
4
  end
@@ -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.3
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-19 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip