albacore 2.0.3 → 2.0.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: 01eb159fca6cc1eba5b2ce83d3835de3742df11a
4
- data.tar.gz: c16cbe3f7777b17779c6a208e6cb606d7b65b90c
3
+ metadata.gz: af9dd9c6d77987035b6c5fe1a6d4255b380cddca
4
+ data.tar.gz: f7089ead80b7a9e88ce1f91514e6b74725e9b3c6
5
5
  SHA512:
6
- metadata.gz: a9d9f39444ccb58051bff961ecb7750d7b449ce50a265ed79bd38ab750b3bf5ca3a6b5eb4dbc13f8dbe363d74bf35252daf54bd465188bf9b32ca2d333b66222
7
- data.tar.gz: 7ae0f6df0051fb53874a5821775db824e5273c449da8d8539903860338056f5cc2bfb7d753b37feb97b6fd9cd27865e056afbe5101968907256593a2e56fe192
6
+ metadata.gz: df93fdf4478c808d1305b3c87af31679e55b6caef826cbe07e89f7a62a559b65c435c20e912544363486b867b2f7ee0c2809d6f36be3c746a9532a83157f9071
7
+ data.tar.gz: c7c6c7e7fd7b331eaa68100c6ee586b0aba5cd18a9d9c40847e844451b340082d24253dee3274209f02c41ae31e9adbf49cbccb1c14da2d8466b16eac620969d
@@ -6,6 +6,9 @@ require 'albacore/logging'
6
6
 
7
7
  module Albacore::Tools
8
8
  module FluentMigrator
9
+ class MissingFluentMigratorExe < ::StandardError
10
+ end
11
+
9
12
  class Cmd
10
13
  include ::Albacore::CrossPlatformCmd
11
14
 
@@ -59,21 +62,31 @@ module Albacore::Tools
59
62
  @parameters.push opts.get(:task_override)
60
63
  end
61
64
 
62
- opts.get(:extras).each{|e| @parameters.push e}
65
+ opts.get(:extras).each{ |e| @parameters.push e}
63
66
 
64
- trace "configured Albacore::FluentMigrator::Cmd with exe: '#{@executable}', params: #{@parameters.join(' ')}"
67
+ trace { "configured Albacore::FluentMigrator::Cmd with exe: '#{@executable}', params: #{@parameters.join(' ')}" }
68
+ prepare_verify @executable, opts
65
69
 
66
70
  mono_command
67
71
  end
68
72
 
69
73
  def execute
70
- Dir.chdir (opts.get(:work_dir, '.')) do
71
- raise "Missing FluentMigrator at #{@executable}" unless File.exists? @executable
72
- end
74
+ verify_exists
73
75
  system @executable, @parameters, :work_dir => opts.get(:work_dir)
74
76
  end
75
77
 
76
78
  private
79
+ def prepare_verify exe, opts
80
+ Dir.chdir(opts.get(:work_dir) || '.') do
81
+ @failed_verify = "Missing FluentMigrator at #{@failed_ver}" unless File.exists? exe
82
+ end
83
+ end
84
+
85
+ def verify_exists
86
+ if @failed_verify
87
+ raise MissingFluentMigratorExe, @failed_verify
88
+ end
89
+ end
77
90
 
78
91
  def agree txt, default
79
92
  reply = default ? "[Y/n]" : "[y/N]"
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.0.3"
2
+ VERSION = "2.0.4"
3
3
  end
@@ -15,6 +15,12 @@ describe Albacore::Tools::FluentMigrator::MigrateCmdFactory, "when constructing"
15
15
  end
16
16
  end
17
17
 
18
+ module VerifyInterceptor
19
+ # don't throw if it doesn't exist
20
+ def verify_exists
21
+ end
22
+ end
23
+
18
24
  describe Albacore::Tools::FluentMigrator::Cmd, "when calling #execute" do
19
25
 
20
26
  def cmd *args
@@ -25,6 +31,7 @@ describe Albacore::Tools::FluentMigrator::Cmd, "when calling #execute" do
25
31
  @logger.debug "calling new with #{opts.inspect}"
26
32
  c = Albacore::Tools::FluentMigrator::Cmd.new opts
27
33
  c.extend ShInterceptor
34
+ c.extend VerifyInterceptor
28
35
  c
29
36
  end
30
37
 
@@ -0,0 +1,16 @@
1
+ require 'map'
2
+
3
+ describe 'getting defaults from map' do
4
+ subject do
5
+ Map.options my_key: 456, dir: 'abc'
6
+ end
7
+ it 'should contain :my_key' do
8
+ expect(subject.getopt :my_key).to be 456
9
+ end
10
+ it 'should contain :my_key with #get' do
11
+ expect(subject.get :my_key).to be 456
12
+ end
13
+ it 'should allow defaults' do
14
+ expect(subject.getopt(:doesntexist, 333)).to be 333
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Feldt
@@ -360,6 +360,7 @@ files:
360
360
  - spec/testdata/example.nuspec
361
361
  - spec/testdata/example.symbols.nuspec
362
362
  - spec/tools/fluent_migrator_spec.rb
363
+ - spec/utils_spec.rb
363
364
  homepage: http://albacorebuild.net
364
365
  licenses:
365
366
  - MIT
@@ -579,3 +580,4 @@ test_files:
579
580
  - spec/testdata/example.nuspec
580
581
  - spec/testdata/example.symbols.nuspec
581
582
  - spec/tools/fluent_migrator_spec.rb
583
+ - spec/utils_spec.rb