fluent_command_builder 0.8.9 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/lib/fluent_command_builder/command_builders/appcfg_python_16.rb +7 -1
  2. data/lib/fluent_command_builder/command_builders/appcfg_python_17.rb +7 -1
  3. data/lib/fluent_command_builder/command_builders/aspnet_compiler_20.rb +7 -1
  4. data/lib/fluent_command_builder/command_builders/aspnet_compiler_40.rb +7 -1
  5. data/lib/fluent_command_builder/command_builders/bundle_11.rb +7 -1
  6. data/lib/fluent_command_builder/command_builders/cucumber_11.rb +7 -1
  7. data/lib/fluent_command_builder/command_builders/cucumber_12.rb +7 -1
  8. data/lib/fluent_command_builder/command_builders/dev_appserver_python_16.rb +7 -1
  9. data/lib/fluent_command_builder/command_builders/dev_appserver_python_17.rb +7 -1
  10. data/lib/fluent_command_builder/command_builders/dotcover_10.rb +7 -1
  11. data/lib/fluent_command_builder/command_builders/dotcover_11.rb +7 -1
  12. data/lib/fluent_command_builder/command_builders/dotcover_12.rb +7 -1
  13. data/lib/fluent_command_builder/command_builders/dotcover_20.rb +7 -1
  14. data/lib/fluent_command_builder/command_builders/fastlinkchecker_21.rb +7 -1
  15. data/lib/fluent_command_builder/command_builders/installutil_11.rb +7 -1
  16. data/lib/fluent_command_builder/command_builders/installutil_20.rb +7 -1
  17. data/lib/fluent_command_builder/command_builders/installutil_35.rb +7 -1
  18. data/lib/fluent_command_builder/command_builders/installutil_40.rb +7 -1
  19. data/lib/fluent_command_builder/command_builders/msbuild_20.rb +7 -1
  20. data/lib/fluent_command_builder/command_builders/msbuild_30.rb +7 -1
  21. data/lib/fluent_command_builder/command_builders/msbuild_35.rb +7 -1
  22. data/lib/fluent_command_builder/command_builders/msbuild_40.rb +7 -1
  23. data/lib/fluent_command_builder/command_builders/msdeploy_71.rb +7 -1
  24. data/lib/fluent_command_builder/command_builders/mstest_100.rb +7 -1
  25. data/lib/fluent_command_builder/command_builders/mstest_80.rb +7 -1
  26. data/lib/fluent_command_builder/command_builders/mstest_90.rb +7 -1
  27. data/lib/fluent_command_builder/command_builders/netsh_61.rb +7 -1
  28. data/lib/fluent_command_builder/command_builders/nuget_20.rb +7 -1
  29. data/lib/fluent_command_builder/command_builders/nunit_25.rb +7 -1
  30. data/lib/fluent_command_builder/command_builders/nunit_26.rb +7 -1
  31. data/lib/fluent_command_builder/command_builders/rake_09.rb +7 -1
  32. data/lib/fluent_command_builder/command_builders/security_osx_107.rb +7 -1
  33. data/lib/fluent_command_builder/command_builders/sevenzip_920.rb +7 -1
  34. data/lib/fluent_command_builder/command_builders/simian_23.rb +7 -1
  35. data/lib/fluent_command_builder/command_builders/team_foundation_100.rb +7 -1
  36. data/lib/fluent_command_builder/command_builders/team_foundation_tee_100.rb +7 -1
  37. data/lib/fluent_command_builder/command_builders/team_foundation_tee_101.rb +7 -1
  38. data/lib/fluent_command_builder/command_builders/xcodebuild_43.rb +7 -1
  39. data/lib/fluent_command_builder/command_builders/xcodebuild_44.rb +7 -1
  40. data/lib/fluent_command_builder/command_executors/backticks_executor.rb +2 -2
  41. data/lib/fluent_command_builder/command_executors/executor_base.rb +3 -3
  42. data/lib/fluent_command_builder/command_executors/rake_sh_executor.rb +2 -2
  43. data/lib/fluent_command_builder/command_executors/system_executor.rb +2 -2
  44. data/lib/fluent_command_builder/execution_context.rb +3 -20
  45. data/lib/fluent_command_builder/path_validator.rb +6 -13
  46. data/lib/fluent_command_builder/underlying_builder.rb +21 -7
  47. data/lib/fluent_command_builder/version_validator.rb +20 -13
  48. metadata +6 -6
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::AppCfgPython::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::AppCfgPython.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::AppCfgPython.version_detector
32
38
  c = AppCfgPython.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::AppCfgPython::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::AppCfgPython.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::AppCfgPython.version_detector
32
38
  c = AppCfgPython.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(target_dir=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::AspnetCompiler::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::AspnetCompiler.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::AspnetCompiler.version_detector
32
38
  c = AspnetCompiler.new(b, target_dir)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(target_dir=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::AspnetCompiler::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::AspnetCompiler.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::AspnetCompiler.version_detector
32
38
  c = AspnetCompiler.new(b, target_dir)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::Bundle::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::Bundle.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::Bundle.version_detector
32
38
  c = Bundle.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(feature=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::Cucumber::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::Cucumber.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::Cucumber.version_detector
32
38
  c = Cucumber.new(b, feature)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(feature=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::Cucumber::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::Cucumber.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::Cucumber.version_detector
32
38
  c = Cucumber.new(b, feature)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(application_root=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::DevAppserverPython::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::DevAppserverPython.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::DevAppserverPython.version_detector
32
38
  c = DevAppserverPython.new(b, application_root)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(application_root=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::DevAppserverPython::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::DevAppserverPython.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::DevAppserverPython.version_detector
32
38
  c = DevAppserverPython.new(b, application_root)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::DotCover::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::DotCover.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::DotCover.version_detector
32
38
  c = DotCover.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::DotCover::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::DotCover.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::DotCover.version_detector
32
38
  c = DotCover.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::DotCover::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::DotCover.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::DotCover.version_detector
32
38
  c = DotCover.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::DotCover::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::DotCover.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::DotCover.version_detector
32
38
  c = DotCover.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::FastLinkChecker::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::FastLinkChecker.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::FastLinkChecker.version_detector
32
38
  c = FastLinkChecker.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::InstallUtil::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::InstallUtil.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::InstallUtil.version_detector
32
38
  c = InstallUtil.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::InstallUtil::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::InstallUtil.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::InstallUtil.version_detector
32
38
  c = InstallUtil.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::InstallUtil::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::InstallUtil.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::InstallUtil.version_detector
32
38
  c = InstallUtil.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::InstallUtil::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::InstallUtil.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::InstallUtil.version_detector
32
38
  c = InstallUtil.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(project_file=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSBuild::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSBuild.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSBuild.version_detector
32
38
  c = MSBuild.new(b, project_file)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(project_file=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSBuild::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSBuild.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSBuild.version_detector
32
38
  c = MSBuild.new(b, project_file)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(project_file=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSBuild::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSBuild.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSBuild.version_detector
32
38
  c = MSBuild.new(b, project_file)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(project_file=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSBuild::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSBuild.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSBuild.version_detector
32
38
  c = MSBuild.new(b, project_file)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSDeploy::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSDeploy.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSDeploy.version_detector
32
38
  c = MSDeploy.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSTest::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSTest.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSTest.version_detector
32
38
  c = MSTest.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSTest::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSTest.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSTest.version_detector
32
38
  c = MSTest.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::MSTest::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::MSTest.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::MSTest.version_detector
32
38
  c = MSTest.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::Netsh::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::Netsh.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::Netsh.version_detector
32
38
  c = Netsh.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::NuGet::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::NuGet.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::NuGet.version_detector
32
38
  c = NuGet.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(input_files=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::NUnit::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::NUnit.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::NUnit.version_detector
32
38
  c = NUnit.new(b, input_files)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(input_files=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::NUnit::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::NUnit.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::NUnit.version_detector
32
38
  c = NUnit.new(b, input_files)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create(task=nil)
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::Rake::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::Rake.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::Rake.version_detector
32
38
  c = Rake.new(b, task)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::SecurityOSX::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::SecurityOSX.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::SecurityOSX.version_detector
32
38
  c = SecurityOSX.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::SevenZip::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::SevenZip.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::SevenZip.version_detector
32
38
  c = SevenZip.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::Simian::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::Simian.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::Simian.version_detector
32
38
  c = Simian.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::TeamFoundation::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::TeamFoundation.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::TeamFoundation.version_detector
32
38
  c = TeamFoundation.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::TeamFoundationTEE::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::TeamFoundationTEE.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::TeamFoundationTEE.version_detector
32
38
  c = TeamFoundationTEE.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::TeamFoundationTEE::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::TeamFoundationTEE.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::TeamFoundationTEE.version_detector
32
38
  c = TeamFoundationTEE.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::XCodeBuild::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::XCodeBuild.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::XCodeBuild.version_detector
32
38
  c = XCodeBuild.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -25,10 +25,16 @@ module FluentCommandBuilder
25
25
  validator.validate
26
26
  @default_path = value
27
27
  end
28
+ def self.version_validation_options
29
+ @version_validation_options ||= {}
30
+ yield @version_validation_options if block_given?
31
+ @version_validation_options
32
+ end
28
33
  def self.create
29
34
  b = UnderlyingBuilder.new FluentCommandBuilder::XCodeBuild::COMMAND_NAME, self.exact_version
30
35
  b.path = self.default_path
31
- b.actual_version_lambda = lambda { |path| FluentCommandBuilder::XCodeBuild.version path }
36
+ b.version_validation_options = self.version_validation_options
37
+ b.version_detector = FluentCommandBuilder::XCodeBuild.version_detector
32
38
  c = XCodeBuild.new(b)
33
39
  yield b if block_given?
34
40
  c
@@ -3,8 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + '/executor_base')
3
3
  module FluentCommandBuilder
4
4
  class BackticksExecutor < ExecutorBase
5
5
 
6
- def do_execute(underlying_builder)
7
- `#{underlying_builder}`
6
+ def do_execute(command)
7
+ `#{command}`
8
8
  end
9
9
 
10
10
  end
@@ -1,8 +1,8 @@
1
1
  module FluentCommandBuilder
2
2
  class ExecutorBase
3
3
 
4
- def execute(underlying_builder)
5
- result = do_execute underlying_builder
4
+ def execute(command)
5
+ result = do_execute command
6
6
  yield $? if block_given?
7
7
  result
8
8
  end
@@ -17,7 +17,7 @@ module FluentCommandBuilder
17
17
 
18
18
  protected
19
19
 
20
- def do_execute(underlying_builder)
20
+ def do_execute(command)
21
21
  # template method
22
22
  end
23
23
 
@@ -5,8 +5,8 @@ include Rake::DSL
5
5
  module FluentCommandBuilder
6
6
  class RakeShExecutor < ExecutorBase
7
7
 
8
- def do_execute(underlying_builder)
9
- sh underlying_builder.to_s
8
+ def do_execute(command)
9
+ sh command.to_s
10
10
  end
11
11
 
12
12
  def will_print_on_execute?
@@ -3,8 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + '/executor_base')
3
3
  module FluentCommandBuilder
4
4
  class SystemExecutor < ExecutorBase
5
5
 
6
- def do_execute(underlying_builder)
7
- system underlying_builder.to_s
6
+ def do_execute(command)
7
+ system command.to_s
8
8
  end
9
9
 
10
10
  end
@@ -1,31 +1,25 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/path_validator')
2
1
  require File.expand_path(File.dirname(__FILE__) + '/printer')
3
- require File.expand_path(File.dirname(__FILE__) + '/version_validator')
4
2
  require File.expand_path(File.dirname(__FILE__) + '/command_executors/system_executor')
5
3
  require File.expand_path(File.dirname(__FILE__) + '/command_formatters/null_formatter')
6
4
 
7
5
  module FluentCommandBuilder
8
6
  class ExecutionContext
9
7
 
10
- attr_accessor :executor, :formatter, :should_print_on_execute, :should_fail_on_error, :should_fail_on_unexpected_version
8
+ attr_accessor :executor, :formatter, :should_print_on_execute, :should_fail_on_error
11
9
 
12
10
  def initialize(executor)
13
11
  @executor = executor
14
12
  @formatter = NullFormatter.new
15
13
  @should_print_on_execute = true
16
14
  @should_fail_on_error = true
17
- @should_fail_on_unexpected_version = false
18
15
  @printer = FluentCommandBuilder::Printer.new
19
16
  end
20
17
 
21
- def execute(underlying_builder)
18
+ def execute(command, visible_command=command)
22
19
  validate_should_print_on_execute
23
20
  validate_should_fail_on_error
24
- validate_path underlying_builder
25
- validate_version underlying_builder
26
- visible_command = @formatter.format underlying_builder
27
21
  print_command visible_command
28
- @executor.execute(underlying_builder) do |status|
22
+ @executor.execute(command) do |status|
29
23
  raise "Command failed with status (#{status.exitstatus}): [#{visible_command}]" if @should_fail_on_error && !status.success?
30
24
  end
31
25
  end
@@ -40,17 +34,6 @@ module FluentCommandBuilder
40
34
  raise "should_fail_on_error must be true for #{@executor}." if !@should_fail_on_error && @executor.will_fail_on_error?
41
35
  end
42
36
 
43
- def validate_version(underlying_builder)
44
- v = VersionValidator.new underlying_builder
45
- v.should_fail_on_unexpected_version = @should_fail_on_unexpected_version
46
- v.validate
47
- end
48
-
49
- def validate_path(underlying_builder)
50
- v = PathValidator.new underlying_builder
51
- v.validate
52
- end
53
-
54
37
  def print_command(visible_command)
55
38
  @printer.print_command visible_command if @should_print_on_execute && !@executor.will_print_on_execute?
56
39
  end
@@ -3,33 +3,26 @@ require File.expand_path(File.dirname(__FILE__) + '/printer')
3
3
  module FluentCommandBuilder
4
4
  class PathValidator
5
5
 
6
- def initialize(underlying_builder)
7
- @underlying_builder = underlying_builder
6
+ def initialize(path, command_name, version)
7
+ @path = path
8
+ @command_name = command_name
9
+ @version = version
8
10
  @printer = Printer.new
9
11
  end
10
12
 
11
13
  def validate
12
- return unless can_validate?
13
14
  return if is_valid?
14
- version = @underlying_builder.version || '(unknown)'
15
- message = %Q[Path for command "#{@underlying_builder.command_name}", version "#{version}" does not exist. Path: #{path}]
15
+ version = @version || '(unknown)'
16
+ message = %Q[Path for command "#{@command_name}", version "#{version}" does not exist. Path: #{@path}]
16
17
  @printer.print_error message
17
18
  raise message
18
19
  end
19
20
 
20
21
  private
21
22
 
22
- def can_validate?
23
- !path.nil?
24
- end
25
-
26
23
  def is_valid?
27
24
  File.exist? path
28
25
  end
29
26
 
30
- def path
31
- @underlying_builder.path
32
- end
33
-
34
27
  end
35
28
  end
@@ -1,20 +1,23 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/argument_formatter')
2
2
  require File.expand_path(File.dirname(__FILE__) + '/execution_context')
3
+ require File.expand_path(File.dirname(__FILE__) + '/path_validator')
4
+ require File.expand_path(File.dirname(__FILE__) + '/version_validator')
3
5
 
4
6
  module FluentCommandBuilder
5
7
  class UnderlyingBuilder
6
8
  include ArgumentFormatter
7
9
 
8
10
  attr_reader :command_name, :version, :args, :passwords
9
- attr_accessor :path, :actual_version_lambda
11
+ attr_accessor :path, :version_detector, :version_validation_options
10
12
 
11
13
  def initialize(command_name, version=nil)
12
14
  @command_name = command_name
13
15
  @version = version
14
16
  @args = nil
15
17
  @passwords = []
18
+ @version_validation_options = {}
16
19
  @path = nil
17
- @actual_version_lambda = nil
20
+ @version_detector = nil
18
21
  @execution_context = FluentCommandBuilder.execution_context
19
22
  end
20
23
 
@@ -31,16 +34,27 @@ module FluentCommandBuilder
31
34
  end
32
35
 
33
36
  def execute
34
- @execution_context.execute self
35
- end
36
-
37
- def actual_version
38
- @actual_version_lambda.call @path if @actual_version_lambda
37
+ validate_path if @path
38
+ validate_version if @version_detector
39
+ visible_command = @execution_context.formatter.format self
40
+ @execution_context.execute to_s, visible_command
39
41
  end
40
42
 
41
43
  def to_s
42
44
  "#{quote_if_includes_space executable} #{@args}".strip
43
45
  end
44
46
 
47
+ private
48
+
49
+ def validate_path
50
+ v = PathValidator.new @path, @command_name, @version
51
+ v.validate
52
+ end
53
+
54
+ def validate_version
55
+ v = VersionValidator.new @command_name, @path, @version, @version_detector, @version_validation_options
56
+ v.validate
57
+ end
58
+
45
59
  end
46
60
  end
@@ -3,16 +3,19 @@ require File.expand_path(File.dirname(__FILE__) + '/printer')
3
3
  module FluentCommandBuilder
4
4
  class VersionValidator
5
5
 
6
- attr_accessor :should_fail_on_unexpected_version
7
-
8
- def initialize(underlying_builder)
9
- @underlying_builder = underlying_builder
6
+ def initialize(command_name, path, expected_version, version_detector, options={})
7
+ @command_name = command_name
8
+ @path = path
9
+ @expected_version_string = expected_version
10
+ @version_detector = version_detector
11
+ @options = { enabled: true, warn_only: false }.merge options
10
12
  @printer = Printer.new
11
- @should_fail_on_unexpected_version = false
12
13
  end
13
14
 
14
15
  def validate
15
- return unless can_validate?
16
+ return unless enabled?
17
+
18
+ @actual_version_string = @version_detector.version(@path)
16
19
 
17
20
  unless actual_version
18
21
  @printer.print_warning error_message('unable to determine actual version')
@@ -21,15 +24,19 @@ module FluentCommandBuilder
21
24
 
22
25
  unless is_valid?
23
26
  message = error_message actual_version.to_s(expected_version.to_a.length)
24
- @should_fail_on_unexpected_version ? @printer.print_error(message) : @printer.print_warning(message)
25
- raise message if @should_fail_on_unexpected_version
27
+ warn_only? ? @printer.print_warning(message) : @printer.print_error(message)
28
+ raise message unless warn_only?
26
29
  end
27
30
  end
28
31
 
29
32
  private
30
33
 
31
- def can_validate?
32
- @underlying_builder.version && @underlying_builder.actual_version_lambda
34
+ def enabled?
35
+ @options[:enabled]
36
+ end
37
+
38
+ def warn_only?
39
+ @options[:warn_only]
33
40
  end
34
41
 
35
42
  def is_valid?
@@ -37,15 +44,15 @@ module FluentCommandBuilder
37
44
  end
38
45
 
39
46
  def expected_version
40
- @expected_version ||= Version.new(@underlying_builder.version)
47
+ @expected_version ||= Version.new(@expected_version_string)
41
48
  end
42
49
 
43
50
  def actual_version
44
- @actual_version ||= Version.new(@underlying_builder.actual_version) if @underlying_builder.actual_version
51
+ @actual_version ||= Version.new(@actual_version_string) if @actual_version_string
45
52
  end
46
53
 
47
54
  def error_message(actual_version)
48
- %Q[Version validation for command "#{@underlying_builder.command_name}" failed. Expected version #{expected_version} but was #{actual_version}.]
55
+ %Q[Version validation for command "#{@command_name}" failed. Expected version #{expected_version} but was #{actual_version}.]
49
56
  end
50
57
 
51
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent_command_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-11 00:00:00.000000000 Z
12
+ date: 2012-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70187253086500 !ruby/object:Gem::Requirement
16
+ requirement: &70349041327120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70187253086500
24
+ version_requirements: *70349041327120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: term-ansicolor
27
- requirement: &70187253086060 !ruby/object:Gem::Requirement
27
+ requirement: &70349041326680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70187253086060
35
+ version_requirements: *70349041326680
36
36
  description: Fluent Command Builder makes building command lines easy and clean.
37
37
  email: matthew-github@matthewriley.name
38
38
  executables: []