albacore 0.2.2 → 0.2.3

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.
@@ -0,0 +1,117 @@
1
+ require 'spec_helper'
2
+ require 'outputtestdata'
3
+ describe Output, 'when having a from and to set' do
4
+
5
+ before :each do
6
+ FileUtils.mkdir(OutputTestData.from) unless File.exists? OutputTestData.from
7
+
8
+ @o = Output.new
9
+ @o.from OutputTestData.from
10
+ @o.to OutputTestData.to
11
+
12
+ end
13
+ after :each do
14
+ FileUtils.rm_rf OutputTestData.to if File.exists? OutputTestData.to
15
+ FileUtils.rm_rf OutputTestData.from if File.exists? OutputTestData.from
16
+ end
17
+
18
+
19
+ describe 'and when outputting files' do
20
+ before :each do
21
+ File.open("#{OutputTestData.from}/test.txt", "w"){|f| f.write "test" }
22
+ end
23
+
24
+ it "should not output a file if not specified so" do
25
+ @o.execute
26
+
27
+ File.exist?("#{OutputTestData.to}/test.txt").should be_false
28
+ end
29
+
30
+ it "should output a file specified" do
31
+ @o.file 'test.txt'
32
+ @o.execute
33
+
34
+ File.exist?("#{OutputTestData.to}/test.txt").should be_true
35
+ end
36
+ end
37
+
38
+
39
+ describe 'and when outputting directories' do
40
+ before :each do
41
+ subdir = "#{OutputTestData.from}/subdir"
42
+ FileUtils.mkdir(subdir) unless File.exists? subdir
43
+ File.open("#{OutputTestData.from}/subdir/test.txt", "w"){|f| f.write "test_sub" }
44
+ end
45
+
46
+ it "should not output a directory if not specified so" do
47
+ @o.execute
48
+
49
+ File.exist?("#{OutputTestData.to}/subdir").should be_false
50
+ end
51
+
52
+ it "should output a directory and content if specified" do
53
+ @o.dir 'subdir'
54
+ @o.execute
55
+
56
+ File.exist?("#{OutputTestData.to}/subdir").should be_true
57
+ File.exist?("#{OutputTestData.to}/subdir/test.txt").should be_true
58
+ end
59
+ end
60
+
61
+ describe 'and when outputting nested directories' do
62
+ before :each do
63
+ subdir = "#{OutputTestData.from}/subdir/foo"
64
+ FileUtils.mkdir_p(subdir) unless File.exists? subdir
65
+ File.open("#{OutputTestData.from}/subdir/foo/test.txt", "w"){|f| f.write "test_sub" }
66
+ end
67
+
68
+ it "should not output a directory if not specified so" do
69
+ @o.execute
70
+
71
+ File.exist?("#{OutputTestData.to}/subdir/foo").should be_false
72
+ end
73
+
74
+ it "should output a directory and content if specified" do
75
+ @o.dir 'subdir'
76
+ @o.execute
77
+
78
+ File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
79
+ File.exist?("#{OutputTestData.to}/subdir/foo/test.txt").should be_true
80
+ end
81
+ end
82
+
83
+
84
+ describe 'and when outputting files with renaming them at target' do
85
+ before :each do
86
+ subdir = "#{OutputTestData.from}/subdir/foo"
87
+ FileUtils.mkdir_p(subdir) unless File.exists? subdir
88
+ File.open("#{OutputTestData.from}/subdir/foo/test.txt", "w"){|f| f.write "test_sub" }
89
+ end
90
+
91
+ it "should rename and create entire path if nested deeply" do
92
+ @o.file 'subdir/foo/test.txt', :as => 'subdir/foo/hello.txt'
93
+ @o.execute
94
+
95
+ File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
96
+ File.exist?("#{OutputTestData.to}/subdir/foo/hello.txt").should be_true
97
+ File.exist?("#{OutputTestData.to}/subdir/foo/test.txt").should be_false
98
+ end
99
+ end
100
+
101
+ describe 'and when using erb, should have templated output' do
102
+ before :each do
103
+ subdir = "#{OutputTestData.from}/subdir/foo"
104
+ FileUtils.mkdir_p(subdir) unless File.exists? subdir
105
+ File.open("#{OutputTestData.from}/subdir/foo/web.config.erb", "w"){|f| f.write "test_sub <%= my_value %>" }
106
+ end
107
+
108
+ it "should rename and create entire path if nested deeply" do
109
+ @o.erb 'subdir/foo/web.config.erb', :as => 'subdir/foo/web.config', :locals => { :my_value => 'hello' }
110
+ @o.execute
111
+
112
+ File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
113
+ File.exist?("#{OutputTestData.to}/subdir/foo/web.config").should be_true
114
+ File.read("#{OutputTestData.to}/subdir/foo/web.config").should == "test_sub hello"
115
+ end
116
+ end
117
+ end
@@ -13,11 +13,5 @@ require 'rake/tasklib'
13
13
  require 'lib/albacore/support/createtask.rb'
14
14
  require 'lib/albacore/config/config.rb'
15
15
  require 'lib/albacore'
16
- require 'not_a_mock'
17
16
  require 'system_patch'
18
17
  require 'fail_patch'
19
-
20
- Spec::Runner.configure do |config|
21
- config.mock_with NotAMock::RspecMockFrameworkAdapter
22
- end
23
-
@@ -147,19 +147,39 @@ describe SQLCmd, "when running with no command path specified" do
147
147
  @cmd.extend(SystemPatch)
148
148
  @cmd.extend(FailPatch)
149
149
  @cmd.disable_system = true
150
-
150
+
151
151
  @cmd.execute
152
152
  @log_data = strio.string
153
+
154
+ @all_possible_sqlcmd_paths = []
155
+
156
+ ["program files", "program files (x86)"].each do |program_files|
157
+ ["90", "100"].each do |sql_version|
158
+ sqlcmd_path = File.join(ENV['SystemDrive'], program_files,'microsoft sql server', sql_version, 'tools','binn', 'sqlcmd.exe')
159
+ @all_possible_sqlcmd_paths << sqlcmd_path
160
+ end
161
+ end
153
162
  end
154
-
163
+
155
164
  it "should find sqlcmd in the standard places or bail" do
156
- $task_failed.should be_false if (File.exists?(File.join(ENV['SystemDrive'],'program files','microsoft sql server','100','tools','binn', 'sqlcmd.exe')))
157
- $task_failed.should be_false if (File.exists?(File.join(ENV['SystemDrive'],'program files','microsoft sql server','90','tools','binn', 'sqlcmd.exe')))
158
- $task_failed.should be_true if ((!(File.exists?(File.join(ENV['SystemDrive'],'program files','microsoft sql server','100','tools','binn', 'sqlcmd.exe')))) and (!(File.exists?(File.join(ENV['SystemDrive'],'program files','microsoft sql server','90','tools','binn', 'sqlcmd.exe')))))
159
- end
160
-
165
+ any_sqlcmd_exists = false
166
+
167
+ @all_possible_sqlcmd_paths.each do |sqlcmd_path|
168
+ sqlcmd_exists = File.exists?(sqlcmd_path)
169
+ any_sqlcmd_exists = true if sqlcmd_exists
170
+ $task_failed.should be_false if sqlcmd_exists
171
+ end
172
+ $task_failed.should be_true if any_sqlcmd_exists == false
173
+ end
174
+
161
175
  it "should log a failure message if it cannot find sqlcmd in the standard places" do
162
- @log_data.should include('SQLCmd.command cannot be nil.') if ((!(File.exists?(File.join(ENV['SystemDrive'],'program files','microsoft sql server','100','tools','binn', 'sqlcmd.exe')))) and (!(File.exists?(File.join(ENV['SystemDrive'],'program files','microsoft sql server','90','tools','binn', 'sqlcmd.exe')))))
176
+ any_sqlcmd_exists = false
177
+
178
+ @all_possible_sqlcmd_paths.each do |sqlcmd_path|
179
+ sqlcmd_exists = File.exists?(sqlcmd_path)
180
+ any_sqlcmd_exists = true if File.exists?(sqlcmd_path)
181
+ end
182
+ @log_data.should include('SQLCmd.command cannot be nil.') if any_sqlcmd_exists == false
163
183
  end
164
184
  end
165
185
 
@@ -0,0 +1,26 @@
1
+ class XmlValidator
2
+ require 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
3
+ require 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
4
+
5
+ include System::Xml
6
+ include System::Xml::Schema
7
+
8
+ def self.validate(xml_file, xsd_file)
9
+ xml = File.read(xml_file)
10
+
11
+ settings = XmlReaderSettings.new
12
+ settings.validation_type = ValidationType.Schema;
13
+ settings.schemas.add(nil, xsd_file)
14
+
15
+ is_valid = true
16
+ settings.validation_event_handler { |s, e|
17
+ is_valid = false if e.severity == XmlSeverityType.error
18
+ }
19
+
20
+ reader = XmlReader.create(System::IO::StringReader.new(xml), settings)
21
+ while reader.read
22
+ end
23
+
24
+ return is_valid
25
+ end
26
+ end
@@ -0,0 +1,15 @@
1
+ require 'nokogiri'
2
+
3
+ class XmlValidator
4
+ def self.validate(xml_file, schema_file)
5
+ schema = Nokogiri::XML::Schema(File.read(schema_file))
6
+ doc = Nokogiri::XML::Document.parse(File.read(xml_file))
7
+
8
+ validation = schema.validate(doc)
9
+ validation.each do |error|
10
+ raise error.message
11
+ end
12
+
13
+ return validation.length == 0
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ class OutputTestData
2
+
3
+ @@from = File.expand_path(File.join(File.dirname(__FILE__), 'src'))
4
+ @@to = File.expand_path(File.join(File.dirname(__FILE__), 'out'))
5
+
6
+ def self.from
7
+ @@from
8
+ end
9
+
10
+ def self.to
11
+ @@to
12
+ end
13
+ end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 2
9
- - 2
10
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Derick Bailey
@@ -18,152 +17,113 @@ autorequire:
18
17
  bindir: bin
19
18
  cert_chain: []
20
19
 
21
- date: 2010-12-07 00:00:00 -06:00
20
+ date: 2011-03-03 00:00:00 -06:00
22
21
  default_executable:
23
22
  dependencies:
24
23
  - !ruby/object:Gem::Dependency
25
- type: :development
26
- prerelease: false
27
- name: rake
28
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ name: rubyzip
25
+ requirement: &id001 !ruby/object:Gem::Requirement
29
26
  none: false
30
27
  requirements:
31
28
  - - "="
32
29
  - !ruby/object:Gem::Version
33
- hash: 49
34
30
  segments:
35
31
  - 0
36
- - 8
37
- - 7
38
- version: 0.8.7
39
- requirement: *id001
32
+ - 9
33
+ - 4
34
+ version: 0.9.4
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *id001
40
38
  - !ruby/object:Gem::Dependency
39
+ name: nokogiri
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - "="
44
+ - !ruby/object:Gem::Version
45
+ segments:
46
+ - 1
47
+ - 4
48
+ - 4
49
+ version: 1.4.4
41
50
  type: :development
42
51
  prerelease: false
43
- name: rubyzip
44
- version_requirements: &id002 !ruby/object:Gem::Requirement
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: version_bumper
55
+ requirement: &id003 !ruby/object:Gem::Requirement
45
56
  none: false
46
57
  requirements:
47
58
  - - "="
48
59
  - !ruby/object:Gem::Version
49
- hash: 51
50
60
  segments:
51
61
  - 0
52
- - 9
53
- - 4
54
- version: 0.9.4
55
- requirement: *id002
56
- - !ruby/object:Gem::Dependency
62
+ - 3
63
+ - 0
64
+ version: 0.3.0
57
65
  type: :development
58
66
  prerelease: false
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
59
69
  name: jeweler
60
- version_requirements: &id003 !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
61
71
  none: false
62
72
  requirements:
63
73
  - - "="
64
74
  - !ruby/object:Gem::Version
65
- hash: 7
66
75
  segments:
67
76
  - 1
68
77
  - 4
69
78
  - 0
70
79
  version: 1.4.0
71
- requirement: *id003
72
- - !ruby/object:Gem::Dependency
73
80
  type: :development
74
81
  prerelease: false
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
75
84
  name: rspec
76
- version_requirements: &id004 !ruby/object:Gem::Requirement
85
+ requirement: &id005 !ruby/object:Gem::Requirement
77
86
  none: false
78
87
  requirements:
79
88
  - - "="
80
89
  - !ruby/object:Gem::Version
81
- hash: 13
82
90
  segments:
83
91
  - 1
84
92
  - 2
85
93
  - 9
86
94
  version: 1.2.9
87
- requirement: *id004
88
- - !ruby/object:Gem::Dependency
89
95
  type: :development
90
96
  prerelease: false
91
- name: derickbailey-notamock
92
- version_requirements: &id005 !ruby/object:Gem::Requirement
93
- none: false
94
- requirements:
95
- - - "="
96
- - !ruby/object:Gem::Version
97
- hash: 29
98
- segments:
99
- - 0
100
- - 0
101
- - 1
102
- version: 0.0.1
103
- requirement: *id005
97
+ version_requirements: *id005
104
98
  - !ruby/object:Gem::Dependency
105
- type: :development
106
- prerelease: false
107
99
  name: jekyll
108
- version_requirements: &id006 !ruby/object:Gem::Requirement
100
+ requirement: &id006 !ruby/object:Gem::Requirement
109
101
  none: false
110
102
  requirements:
111
103
  - - "="
112
104
  - !ruby/object:Gem::Version
113
- hash: 63
114
105
  segments:
115
106
  - 0
116
107
  - 8
117
108
  - 0
118
109
  version: 0.8.0
119
- requirement: *id006
120
- - !ruby/object:Gem::Dependency
121
110
  type: :development
122
111
  prerelease: false
112
+ version_requirements: *id006
113
+ - !ruby/object:Gem::Dependency
123
114
  name: watchr
124
- version_requirements: &id007 !ruby/object:Gem::Requirement
115
+ requirement: &id007 !ruby/object:Gem::Requirement
125
116
  none: false
126
117
  requirements:
127
118
  - - "="
128
119
  - !ruby/object:Gem::Version
129
- hash: 5
130
120
  segments:
131
121
  - 0
132
122
  - 7
133
123
  version: "0.7"
134
- requirement: *id007
135
- - !ruby/object:Gem::Dependency
136
- type: :runtime
137
- prerelease: false
138
- name: rake
139
- version_requirements: &id008 !ruby/object:Gem::Requirement
140
- none: false
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- hash: 49
145
- segments:
146
- - 0
147
- - 8
148
- - 7
149
- version: 0.8.7
150
- requirement: *id008
151
- - !ruby/object:Gem::Dependency
152
- type: :runtime
124
+ type: :development
153
125
  prerelease: false
154
- name: rubyzip
155
- version_requirements: &id009 !ruby/object:Gem::Requirement
156
- none: false
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- hash: 51
161
- segments:
162
- - 0
163
- - 9
164
- - 4
165
- version: 0.9.4
166
- requirement: *id009
126
+ version_requirements: *id007
167
127
  description: Easily build your .NET solutions with Ruby and Rake, using this suite of Rake tasks.
168
128
  email: derickbailey@gmail.com
169
129
  executables: []
@@ -177,7 +137,6 @@ files:
177
137
  - .rvmrc
178
138
  - EULA.txt
179
139
  - Gemfile
180
- - Gemfile.lock
181
140
  - README.markdown
182
141
  - VERSION
183
142
  - lib/albacore.rb
@@ -192,13 +151,16 @@ files:
192
151
  - lib/albacore/config/cscconfig.rb
193
152
  - lib/albacore/config/docuconfig.rb
194
153
  - lib/albacore/config/execconfig.rb
154
+ - lib/albacore/config/fluentmigratorrunnerconfig.rb
195
155
  - lib/albacore/config/msbuildconfig.rb
196
156
  - lib/albacore/config/mspectestrunnerconfig.rb
197
157
  - lib/albacore/config/nantconfig.rb
158
+ - lib/albacore/config/nchurnconfig.rb
198
159
  - lib/albacore/config/ncoverconsoleconfig.rb
199
160
  - lib/albacore/config/ncoverreportconfig.rb
200
161
  - lib/albacore/config/ndependconfig.rb
201
162
  - lib/albacore/config/netversion.rb
163
+ - lib/albacore/config/nugetpackconfig.rb
202
164
  - lib/albacore/config/nunittestrunnerconfig.rb
203
165
  - lib/albacore/config/specflowreportconfig.rb
204
166
  - lib/albacore/config/sqlcmdconfig.rb
@@ -209,9 +171,11 @@ files:
209
171
  - lib/albacore/csc.rb
210
172
  - lib/albacore/docu.rb
211
173
  - lib/albacore/exec.rb
174
+ - lib/albacore/fluentmigratorrunner.rb
212
175
  - lib/albacore/msbuild.rb
213
176
  - lib/albacore/mspectestrunner.rb
214
177
  - lib/albacore/nant.rb
178
+ - lib/albacore/nchurn.rb
215
179
  - lib/albacore/ncoverconsole.rb
216
180
  - lib/albacore/ncoverreport.rb
217
181
  - lib/albacore/ncoverreports/assemblyfilter.rb
@@ -228,7 +192,10 @@ files:
228
192
  - lib/albacore/ncoverreports/summaryreport.rb
229
193
  - lib/albacore/ncoverreports/symbolcoverage.rb
230
194
  - lib/albacore/ndepend.rb
195
+ - lib/albacore/nugetpack.rb
231
196
  - lib/albacore/nunittestrunner.rb
197
+ - lib/albacore/nuspec.rb
198
+ - lib/albacore/output.rb
232
199
  - lib/albacore/plink.rb
233
200
  - lib/albacore/specflowreport.rb
234
201
  - lib/albacore/sqlcmd.rb
@@ -256,13 +223,17 @@ files:
256
223
  - spec/csc_spec.rb
257
224
  - spec/docu_spec.rb
258
225
  - spec/exec_spec.rb
226
+ - spec/fluentmigratorrunner_spec.rb
259
227
  - spec/msbuild_spec.rb
260
228
  - spec/mspec_spec.rb
261
229
  - spec/nant_spec.rb
230
+ - spec/nchurn_spec.rb
262
231
  - spec/ncoverconsole_spec.rb
263
232
  - spec/ncoverreport_spec.rb
264
233
  - spec/ndepend_spec.rb
265
234
  - spec/nunittestrunner_spec.rb
235
+ - spec/nuspec_spec.rb
236
+ - spec/output_spec.rb
266
237
  - spec/patches/docu_patch.rb
267
238
  - spec/patches/fail_patch.rb
268
239
  - spec/patches/system_patch.rb
@@ -272,10 +243,13 @@ files:
272
243
  - spec/specflowreport_spec.rb
273
244
  - spec/sqlcmd_spec.rb
274
245
  - spec/support/assemblyinfotester.rb
246
+ - spec/support/ironruby_validator.rb
275
247
  - spec/support/msbuildtestdata.rb
276
248
  - spec/support/nanttestdata.rb
277
249
  - spec/support/ncoverconsoletestdata.rb
278
250
  - spec/support/ncoverreporttestdata.rb
251
+ - spec/support/nokogiri_validator.rb
252
+ - spec/support/outputtestdata.rb
279
253
  - spec/support/ziptestdata.rb
280
254
  - spec/unzip_spec.rb
281
255
  - spec/xbuild_spec.rb
@@ -296,7 +270,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
270
  requirements:
297
271
  - - ">="
298
272
  - !ruby/object:Gem::Version
299
- hash: 3
300
273
  segments:
301
274
  - 0
302
275
  version: "0"
@@ -305,7 +278,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
278
  requirements:
306
279
  - - ">="
307
280
  - !ruby/object:Gem::Version
308
- hash: 3
309
281
  segments:
310
282
  - 0
311
283
  version: "0"
@@ -325,13 +297,17 @@ test_files:
325
297
  - spec/csc_spec.rb
326
298
  - spec/docu_spec.rb
327
299
  - spec/exec_spec.rb
300
+ - spec/fluentmigratorrunner_spec.rb
328
301
  - spec/msbuild_spec.rb
329
302
  - spec/mspec_spec.rb
330
303
  - spec/nant_spec.rb
304
+ - spec/nchurn_spec.rb
331
305
  - spec/ncoverconsole_spec.rb
332
306
  - spec/ncoverreport_spec.rb
333
307
  - spec/ndepend_spec.rb
334
308
  - spec/nunittestrunner_spec.rb
309
+ - spec/nuspec_spec.rb
310
+ - spec/output_spec.rb
335
311
  - spec/patches/docu_patch.rb
336
312
  - spec/patches/fail_patch.rb
337
313
  - spec/patches/system_patch.rb
@@ -341,10 +317,13 @@ test_files:
341
317
  - spec/specflowreport_spec.rb
342
318
  - spec/sqlcmd_spec.rb
343
319
  - spec/support/assemblyinfotester.rb
320
+ - spec/support/ironruby_validator.rb
344
321
  - spec/support/msbuildtestdata.rb
345
322
  - spec/support/nanttestdata.rb
346
323
  - spec/support/ncoverconsoletestdata.rb
347
324
  - spec/support/ncoverreporttestdata.rb
325
+ - spec/support/nokogiri_validator.rb
326
+ - spec/support/outputtestdata.rb
348
327
  - spec/support/ziptestdata.rb
349
328
  - spec/unzip_spec.rb
350
329
  - spec/xbuild_spec.rb