albacore 0.1.5 → 0.2.0.preview1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. data/.autotest +4 -0
  2. data/README.markdown +1 -1
  3. data/VERSION +1 -1
  4. data/install_dependencies.rb +2 -3
  5. data/lib/albacore.rb +1 -0
  6. data/lib/albacore/albacoremodel.rb +28 -0
  7. data/lib/albacore/assemblyinfo.rb +5 -4
  8. data/lib/albacore/config/assemblyinfoconfig.rb +21 -0
  9. data/lib/albacore/config/config.rb +14 -0
  10. data/lib/albacore/config/cscconfig.rb +33 -0
  11. data/lib/albacore/config/docuconfig.rb +25 -0
  12. data/lib/albacore/config/execconfig.rb +22 -0
  13. data/lib/albacore/config/msbuildconfig.rb +32 -0
  14. data/lib/albacore/config/mspecconfig.rb +21 -0
  15. data/lib/albacore/config/nantconfig.rb +22 -0
  16. data/lib/albacore/config/ncoverconsoleconfig.rb +22 -0
  17. data/lib/albacore/config/ncoverreportconfig.rb +22 -0
  18. data/lib/albacore/config/ndependconfig.rb +22 -0
  19. data/lib/albacore/config/netversion.rb +23 -0
  20. data/lib/albacore/config/nunitconfig.rb +20 -0
  21. data/lib/albacore/config/specflowreportconfig.rb +27 -0
  22. data/lib/albacore/config/sqlcmdconfig.rb +22 -0
  23. data/lib/albacore/config/unzipconfig.rb +22 -0
  24. data/lib/albacore/config/xbuildconfig.rb +22 -0
  25. data/lib/albacore/config/xunitconfig.rb +22 -0
  26. data/lib/albacore/config/zipconfig.rb +22 -0
  27. data/lib/albacore/csc.rb +31 -0
  28. data/lib/albacore/docu.rb +8 -6
  29. data/lib/albacore/exec.rb +9 -3
  30. data/lib/albacore/msbuild.rb +5 -12
  31. data/lib/albacore/mspectestrunner.rb +9 -7
  32. data/lib/albacore/nant.rb +5 -4
  33. data/lib/albacore/ncoverconsole.rb +6 -9
  34. data/lib/albacore/ncoverreport.rb +8 -6
  35. data/lib/albacore/ncoverreports/codecoveragebase.rb +4 -4
  36. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +4 -4
  37. data/lib/albacore/ncoverreports/fullcoveragereport.rb +3 -3
  38. data/lib/albacore/ncoverreports/reportfilterbase.rb +4 -4
  39. data/lib/albacore/ncoverreports/summaryreport.rb +3 -3
  40. data/lib/albacore/ndepend.rb +12 -9
  41. data/lib/albacore/nunittestrunner.rb +9 -7
  42. data/lib/albacore/specflowreport.rb +62 -0
  43. data/lib/albacore/sqlcmd.rb +8 -6
  44. data/lib/albacore/support/attrmethods.rb +7 -8
  45. data/lib/albacore/support/logging.rb +8 -4
  46. data/lib/albacore/support/openstruct.rb +13 -0
  47. data/lib/albacore/support/runcommand.rb +24 -24
  48. data/lib/albacore/support/supportlinux.rb +23 -0
  49. data/lib/albacore/support/yamlconfig.rb +2 -10
  50. data/lib/albacore/unzip.rb +14 -12
  51. data/lib/albacore/xbuild.rb +6 -5
  52. data/lib/albacore/xunittestrunner.rb +8 -6
  53. data/lib/albacore/zipdirectory.rb +27 -6
  54. data/lib/rake/csctask.rb +3 -0
  55. data/lib/rake/specflowreporttask.rb +3 -0
  56. data/lib/rake/unziptask.rb +1 -1
  57. data/rakefile.rb +21 -54
  58. data/spec/albacoremodel_spec.rb +35 -0
  59. data/spec/assemblyinfo_spec.rb +17 -0
  60. data/spec/attrmethods_spec.rb +17 -1
  61. data/spec/config_spec.rb +19 -0
  62. data/spec/createtask_spec.rb +45 -4
  63. data/spec/csc_spec.rb +87 -0
  64. data/spec/csctask_spec.rb +1 -0
  65. data/spec/docu_spec.rb +43 -1
  66. data/spec/exec_spec.rb +16 -1
  67. data/spec/msbuild_spec.rb +30 -18
  68. data/spec/mspec_spec.rb +28 -0
  69. data/spec/nant_spec.rb +20 -12
  70. data/spec/ncoverconsole_spec.rb +25 -13
  71. data/spec/ncoverreport_spec.rb +31 -18
  72. data/spec/ndepend_spec.rb +23 -2
  73. data/spec/nunittestrunner_spec.rb +48 -0
  74. data/spec/runcommand_spec.rb +59 -32
  75. data/spec/specflowreport_spec.rb +146 -0
  76. data/spec/specflowreporttask_spec.rb +48 -0
  77. data/spec/sqlcmd_spec.rb +18 -5
  78. data/spec/support/SpecFlow/TechTalk.SpecFlow.dll +0 -0
  79. data/spec/support/SpecFlow/TestSolution.SpecFlow.dll +0 -0
  80. data/spec/support/SpecFlow/TestSolution.SpecFlow.pdb +0 -0
  81. data/spec/support/SpecFlow/TestSolution.dll +0 -0
  82. data/spec/support/SpecFlow/TestSolution.pdb +0 -0
  83. data/spec/support/SpecFlow/nunit.framework.dll +0 -0
  84. data/spec/support/TestSolution/TestSolution.5.0.ReSharper.user +27 -0
  85. data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature +8 -0
  86. data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature.cs +73 -0
  87. data/spec/support/TestSolution/TestSolution.SpecFlow/Properties/AssemblyInfo.cs +36 -0
  88. data/spec/support/TestSolution/TestSolution.SpecFlow/StepDefinition.cs +30 -0
  89. data/spec/support/TestSolution/TestSolution.SpecFlow/TestSolution.SpecFlow.csproj +84 -0
  90. data/spec/support/TestSolution/TestSolution.sln +6 -0
  91. data/spec/support/csc/File1.cs +9 -0
  92. data/spec/support/csc/File2.cs +9 -0
  93. data/spec/support/csc/output/ignorethis.txt +1 -0
  94. data/spec/support/msbuildtestdata.rb +3 -3
  95. data/spec/support/ncoverreporttestdata.rb +2 -2
  96. data/spec/support/spec_helper.rb +2 -1
  97. data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -1
  98. data/spec/unzip_spec.rb +15 -0
  99. data/spec/xbuild_spec.rb +15 -0
  100. data/spec/xunit_spec.rb +16 -2
  101. data/spec/yamlconfig_spec.rb +7 -6
  102. data/spec/zip_spec.rb +50 -9
  103. data/watchrtesting.rb +8 -0
  104. metadata +99 -91
  105. data/lib/albacore/expandtemplates.rb +0 -81
  106. data/lib/albacore/plink.rb +0 -49
  107. data/lib/albacore/renamer.rb +0 -17
  108. data/lib/albacore/sftp.rb +0 -42
  109. data/lib/albacore/ssh.rb +0 -44
  110. data/lib/albacore/support/albacore_helper.rb +0 -1
  111. data/lib/albacore/support/globalconfig.rb +0 -6
  112. data/lib/rake/expandtemplatestask.rb +0 -3
  113. data/lib/rake/plinktask.rb +0 -3
  114. data/lib/rake/renametask.rb +0 -3
  115. data/lib/rake/sftptask.rb +0 -3
  116. data/lib/rake/sshtask.rb +0 -3
  117. data/spec/expandtemplates_spec.rb +0 -180
  118. data/spec/expandtemplatestask_spec.rb +0 -46
  119. data/spec/plink_spec.rb +0 -62
  120. data/spec/plinktask_spec.rb +0 -46
  121. data/spec/renametask_spec.rb +0 -32
  122. data/spec/sftp_spec.rb +0 -30
  123. data/spec/sftptask_spec.rb +0 -42
  124. data/spec/ssh_spec.rb +0 -47
  125. data/spec/sshtask_spec.rb +0 -40
  126. data/spec/support/expandtemplates/datafiles/multiplevalues.yml +0 -3
  127. data/spec/support/expandtemplates/datafiles/multitemplate-specificfile.yml +0 -11
  128. data/spec/support/expandtemplates/datafiles/multitemplate.yml +0 -4
  129. data/spec/support/expandtemplates/datafiles/sample.yml +0 -1
  130. data/spec/support/expandtemplates/datafiles/sample_with_include.yml +0 -2
  131. data/spec/support/expandtemplates/datafiles/template_specific_data_file_with_include.yml +0 -5
  132. data/spec/support/expandtemplates/datafiles/template_specific_include.yml +0 -3
  133. data/spec/support/expandtemplates/templates/multipleinstance.config +0 -4
  134. data/spec/support/expandtemplates/templates/multiplevalues.config +0 -1
  135. data/spec/support/expandtemplates/templates/sample.config +0 -1
  136. data/spec/support/expandtemplatestestdata.rb +0 -77
data/.autotest ADDED
@@ -0,0 +1,4 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ %w{.git .svn rakefile spec/spec.opts spec/support .autotest .DS_Store }.each {|exception|at.add_exception(exception)}
3
+ end
4
+
data/README.markdown CHANGED
@@ -89,5 +89,5 @@ Many thanks for contributions to albacore are due (in alphabetical order):
89
89
  * [Mike Nichols](http://github.com/mnichols): XUnit contributions, bug reports, etc
90
90
  * [Nils Jonsson](http://github.com/njonsson): AssemblyInfo corrections, rakefile corrections
91
91
  * [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
92
- * [Steven Harman](http://github.com/stevenharman): Finding some wicked bugs, patching nunit test runner, and the nant task
92
+ * [Steven Harman](http://github.com/stevenharman): Primary contributor. Nant task, issue tickets, disucssions, and much much more.
93
93
  * [Panda Wood](http://github.com/pandawood): NCover Console options and wiki edits
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.2.0.preview1
@@ -3,7 +3,7 @@ require 'rubygems/gem_runner'
3
3
  require 'rubygems/exceptions'
4
4
 
5
5
  #http://gist.github.com/236148
6
- required_version = Gem::Requirement.new "> 1.8.5"
6
+ required_version = Gem::Requirement.new "> 1.8.7"
7
7
 
8
8
  unless required_version.satisfied_by? Gem.ruby_version then
9
9
  abort "Expected Ruby Version #{required_version}, was #{Gem.ruby_version}"
@@ -24,10 +24,9 @@ end
24
24
 
25
25
  puts "Installing required dependencies"
26
26
  install 'rake'
27
- install 'net-ssh'
28
- install 'net-sftp'
29
27
  install 'rubyzip'
30
28
  install 'jeweler'
31
29
  install 'rspec'
32
30
  install 'derickbailey-notamock'
33
31
  install 'jekyll'
32
+ install 'watchr'
data/lib/albacore.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  $: << File.expand_path(File.dirname(__FILE__))
2
2
  $: << File.expand_path(File.join(File.dirname(__FILE__), "albacore"))
3
3
  $: << File.expand_path(File.join(File.dirname(__FILE__), "albacore", 'support'))
4
+ $: << File.expand_path(File.join(File.dirname(__FILE__), "albacore", 'config'))
4
5
  $: << File.expand_path(File.join(File.dirname(__FILE__), "rake"))
5
6
 
6
7
  require 'logging'
@@ -0,0 +1,28 @@
1
+ require 'albacore/support/attrmethods'
2
+ require 'albacore/support/failure'
3
+ require 'albacore/support/logging'
4
+ require 'albacore/support/yamlconfig'
5
+ require 'albacore/support/runcommand'
6
+ require 'albacore/config/config'
7
+
8
+ module AlbacoreModel
9
+ include Failure
10
+ include Logging
11
+ include YAMLConfig
12
+
13
+ def self.included(obj)
14
+ obj.extend AttrMethods
15
+ end
16
+
17
+ def update_attributes(attrs)
18
+ attrs.each do |key, value|
19
+ setter = "#{key}="
20
+ send(setter, value) if respond_to?(setter)
21
+ @logger.warn "#{key} is not a settable attribute on #{self.class}" unless respond_to?(setter)
22
+ end
23
+ end
24
+
25
+ def <<(attrs)
26
+ update_attributes attrs
27
+ end
28
+ end
@@ -1,11 +1,11 @@
1
- require 'albacore/support/albacore_helper'
1
+ require 'albacore/albacoremodel'
2
2
  require 'albacore/assemblyinfolanguages/csharpengine'
3
3
  require 'albacore/assemblyinfolanguages/vbnetengine'
4
+ require 'albacore/config/assemblyinfoconfig'
4
5
 
5
6
  class AssemblyInfo
6
- extend AttrMethods
7
- include Failure
8
- include YAMLConfig
7
+ include AlbacoreModel
8
+ include Configuration::AssemblyInfo
9
9
 
10
10
  attr_accessor :version, :title, :description, :output_file, :custom_attributes
11
11
  attr_accessor :copyright, :com_visible, :com_guid, :company_name, :product_name
@@ -17,6 +17,7 @@ class AssemblyInfo
17
17
  def initialize
18
18
  @namespaces = []
19
19
  super()
20
+ update_attributes assemblyinfo.to_hash
20
21
  end
21
22
 
22
23
  def write
@@ -0,0 +1,21 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module AssemblyInfo
6
+ @asmconfig = OpenStruct.new.extend(OpenStructToHash)
7
+ def self.asmconfig
8
+ @asmconfig
9
+ end
10
+
11
+ def assemblyinfo
12
+ config = AssemblyInfo.asmconfig
13
+ yield(config) if block_given?
14
+ config
15
+ end
16
+ end
17
+ end
18
+
19
+ class Albacore::Configuration
20
+ include Configuration::AssemblyInfo
21
+ end
@@ -0,0 +1,14 @@
1
+ module Albacore
2
+ class << self
3
+ def configure
4
+ @configuration ||= Configuration.new
5
+ yield(@configuration) if block_given?
6
+ @configuration
7
+ end
8
+ end
9
+
10
+ class Configuration
11
+ attr_accessor :yaml_config_folder
12
+ attr_accessor :log_level
13
+ end
14
+ end
@@ -0,0 +1,33 @@
1
+ require 'ostruct'
2
+ require 'albacore/config/netversion'
3
+ require 'albacore/support/openstruct'
4
+
5
+ module Configuration
6
+ module CSC
7
+ include Configuration::NetVersion
8
+
9
+ @config = OpenStruct.new.extend(OpenStructToHash).extend(CSC)
10
+ def self.cscconfig
11
+ @config
12
+ end
13
+
14
+ def csc
15
+ @config ||= CSC.cscconfig
16
+ yield(@config) if block_given?
17
+ @config
18
+ end
19
+
20
+ def self.included(mod)
21
+ self.cscconfig.use :net40
22
+ end
23
+
24
+ def use(netversion)
25
+ self.command = File.join(get_net_version(netversion), "csc.exe")
26
+ end
27
+
28
+ end
29
+ end
30
+
31
+ class Albacore::Configuration
32
+ include Configuration::CSC
33
+ end
@@ -0,0 +1,25 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module Docu
6
+ @docuconfig = OpenStruct.new.extend(OpenStructToHash)
7
+ def self.docuconfig
8
+ @docuconfig
9
+ end
10
+
11
+ def docu
12
+ config = Docu.docuconfig
13
+ yield(config) if block_given?
14
+ config
15
+ end
16
+
17
+ def self.included(obj)
18
+ docuconfig.command = "Docu.exe"
19
+ end
20
+ end
21
+ end
22
+
23
+ class Albacore::Configuration
24
+ include Configuration::Docu
25
+ end
@@ -0,0 +1,22 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module Exec
6
+ @execconfig = OpenStruct.new.extend(OpenStructToHash)
7
+
8
+ def self.execconfig
9
+ @execconfig
10
+ end
11
+
12
+ def exec
13
+ config = Exec.execconfig
14
+ yield(config) if block_given?
15
+ config
16
+ end
17
+ end
18
+ end
19
+
20
+ class Albacore::Configuration
21
+ include Configuration::Exec
22
+ end
@@ -0,0 +1,32 @@
1
+ require 'ostruct'
2
+ require 'albacore/config/netversion'
3
+ require 'albacore/support/openstruct'
4
+
5
+ module Configuration
6
+ module MSBuild
7
+ include Configuration::NetVersion
8
+
9
+ @msbuildconfig = OpenStruct.new.extend(OpenStructToHash).extend(MSBuild)
10
+ def self.msbuildconfig
11
+ @msbuildconfig
12
+ end
13
+
14
+ def msbuild
15
+ config = MSBuild.msbuildconfig
16
+ yield(config) if block_given?
17
+ config
18
+ end
19
+
20
+ def self.included(mod)
21
+ self.msbuildconfig.use :net40
22
+ end
23
+
24
+ def use(netversion)
25
+ self.command = File.join(get_net_version(netversion), "MSBuild.exe")
26
+ end
27
+ end
28
+ end
29
+
30
+ class Albacore::Configuration
31
+ include Configuration::MSBuild
32
+ end
@@ -0,0 +1,21 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module MSpec
6
+
7
+ def self.mspecconfig
8
+ @mspecconfig ||= OpenStruct.new.extend(OpenStructToHash)
9
+ end
10
+
11
+ def mspec
12
+ config = MSpec.mspecconfig
13
+ yield(config) if block_given?
14
+ config
15
+ end
16
+ end
17
+ end
18
+
19
+ class Albacore::Configuration
20
+ include Configuration::MSpec
21
+ end
@@ -0,0 +1,22 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module NAnt
6
+ @nantconfig = OpenStruct.new.extend(OpenStructToHash)
7
+
8
+ def self.nantconfig
9
+ @nantconfig
10
+ end
11
+
12
+ def nant
13
+ config = NAnt.nantconfig
14
+ yield(config) if block_given?
15
+ config
16
+ end
17
+ end
18
+ end
19
+
20
+ class Albacore::Configuration
21
+ include Configuration::NAnt
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module NCoverConsole
6
+ @ncoverconsoleconfig = OpenStruct.new.extend(OpenStructToHash)
7
+
8
+ def self.ncoverconsoleconfig
9
+ @ncoverconsoleconfig
10
+ end
11
+
12
+ def ncoverconsole
13
+ config = NCoverConsole.ncoverconsoleconfig
14
+ yield(config) if block_given?
15
+ config
16
+ end
17
+ end
18
+ end
19
+
20
+ class Albacore::Configuration
21
+ include Configuration::NCoverConsole
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module NCoverReport
6
+ @ncoverreportconfig = OpenStruct.new.extend(OpenStructToHash)
7
+
8
+ def self.ncoverreportconfig
9
+ @ncoverreportconfig
10
+ end
11
+
12
+ def ncoverreport
13
+ config = NCoverReport.ncoverreportconfig
14
+ yield(config) if block_given?
15
+ config
16
+ end
17
+ end
18
+ end
19
+
20
+ class Albacore::Configuration
21
+ include Configuration::NCoverReport
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module NDepend
6
+ @ndependconfig = OpenStruct.new.extend(OpenStructToHash)
7
+
8
+ def self.ndependconfig
9
+ @ndependconfig
10
+ end
11
+
12
+ def ndepend
13
+ config = NDepend.ndependconfig
14
+ yield(config) if block_given?
15
+ config
16
+ end
17
+ end
18
+ end
19
+
20
+ class Albacore::Configuration
21
+ include Configuration::NDepend
22
+ end
@@ -0,0 +1,23 @@
1
+ module Configuration
2
+ module NetVersion
3
+
4
+ def win_dir
5
+ @win_dir ||= ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
6
+ end
7
+
8
+ def get_net_version(netversion)
9
+ case netversion
10
+ when :net2, :net20
11
+ version = "v2.0.50727"
12
+ when :net35
13
+ version = "v3.5"
14
+ when :net4, :net40
15
+ version = "v4.0.30319"
16
+ else
17
+ fail "#{netversion} is not a supported .net version"
18
+ end
19
+ File.join(win_dir.dup, 'Microsoft.NET', 'Framework', version)
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ require 'albacore/support/openstruct'
2
+
3
+ module Configuration
4
+ module NUnit
5
+ @config = OpenStruct.new.extend(OpenStructToHash).extend(NUnit)
6
+ def self.nunitconfig
7
+ @config
8
+ end
9
+
10
+ def nunit
11
+ config = NUnit.nunitconfig
12
+ yield(config) if block_given?
13
+ config
14
+ end
15
+ end
16
+ end
17
+
18
+ class Albacore::Configuration
19
+ include Configuration::NUnit
20
+ end
@@ -0,0 +1,27 @@
1
+ require 'ostruct'
2
+ require 'albacore/support/openstruct'
3
+
4
+ module Configuration
5
+ module SpecFlowReport
6
+ @specflowreportconfig = OpenStruct.new.extend(OpenStructToHash)
7
+
8
+ def self.specflowreportconfig
9
+ @specflowreportconfig
10
+ end
11
+
12
+ def specflowreport
13
+ config = SpecFlowReport.specflowreportconfig
14
+ yield(config) if block_given?
15
+ config
16
+ end
17
+
18
+ def self.included(obj)
19
+ specflowreportconfig.command = 'specflow.exe'
20
+ specflowreportconfig.report = 'nunitexecutionreport'
21
+ end
22
+ end
23
+ end
24
+
25
+ class Albacore::Configuration
26
+ include Configuration::SpecFlowReport
27
+ end