fuburake 0.5.0.23 → 0.9.0.25

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 (5) hide show
  1. checksums.yaml +8 -8
  2. data/lib/fuburake.rb +78 -4
  3. data/lib/msbuild.rb +7 -2
  4. data/lib/nunit.rb +34 -13
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTI0NmYzNzZiZmUwOTA2OTE4OTJiNmYwZDM0N2VjOTIzMzVlMDY3YQ==
4
+ YjU4YmVhMjgyYjljNDBkZmI1MWE1YmQ2OTRjMDEyMjZiMjE5MjQyMw==
5
5
  data.tar.gz: !binary |-
6
- ZWFmZjE5NjNjOTQwZmFlN2ZkOTkwNTI1NTYzODdlNTA1NTc5NWFhYQ==
6
+ Yzk0N2ViMWU5ZDQ3YjBmNjA4N2Q5MmM0Y2FhNGYyNmUyOWNiZTlhNA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzRiZDgzMzc2N2VlZjQzZjk0OGIxOTIwOTk5MzJiNWY1YzdmNGZmNTU5N2Ri
10
- ZTQxNTFkN2M5ZmE5MTIyOWE4YTk1MDExODNjM2NkZTQ5MTQ4YTJjNjEzZDZl
11
- NzdjNjE5N2E3MWNiMGMxZDNjY2EwZjZiZGM5MmQ2OGE2MmQwZWQ=
9
+ MjIyOGRhNGViMzM5YWNlZTk4NzgzOGVmMGViNGY5MmM4ZTFiMGRlYzA1Y2Yz
10
+ MGFmYWE2MmVkMTAwNzA0MjUwNjkwYTNmOGVlZjNmMmMwNTdkMTM4OTg3N2Q0
11
+ ODdiYjdhMDEwN2E3ZjhhOWYzMDFlMTgwMTM5MWRmNTlhZjQ4NjI=
12
12
  data.tar.gz: !binary |-
13
- YTY2NWE3MmUxZTY5ODM2N2Q3NmU4MTJjYWVmN2JmNzExNTk1OWIzNjUzODVk
14
- MDZhMjcxMmY5ZWYxZTZkZTRjNDQ3ZmIyY2FkMTZjNGMzZjljNjkzNDBjZmMw
15
- MTQzZDExNTY5NjU5N2VhNWU2M2MyZGZiOWY3Y2ZlZDhmZDFmYzc=
13
+ ZmYxNTlkODI2ZWM5ZmEwMTA2ZDZhMDZmZThkMDQ4ZjBlZWE1YjA0ODBjMDQy
14
+ ODUxYTAzMzRmMDQ5MWNiMjU5ZDE1ZDQzNTg3MTA5YTFhYjJkY2JhZWMwZGY0
15
+ MzQwODk5N2I3NzJmMWQxYmQzNjNhZDJkYjQ1NDc3MTkzMDIzZDM=
data/lib/fuburake.rb CHANGED
@@ -23,9 +23,22 @@ module FubuRake
23
23
  :ci_steps,
24
24
  :precompile,
25
25
  :integration_test,
26
- :compilations
27
-
26
+ :compilations,
27
+ :bottles,
28
+ :bottles_enabled
28
29
 
30
+ def initialize
31
+ @options = {}
32
+ @bottles = []
33
+ @bottles_enabled = true
34
+
35
+ solutions = Dir.glob('**/*.sln')
36
+ if solutions.count == 1
37
+ solutionfile = solutions[0]
38
+
39
+ @compile = {:solutionfile => solutionfile}
40
+ end
41
+ end
29
42
 
30
43
  def compile_step(name, solution)
31
44
  @compilations ||= []
@@ -34,9 +47,9 @@ module FubuRake
34
47
  end
35
48
 
36
49
  def assembly_bottle(project)
37
- @compilations ||= []
50
+ @bottles ||= []
38
51
 
39
- @compilations << FubuRake::AssemblyBottle.new(project)
52
+ @bottles << FubuRake::AssemblyBottle.new(project)
40
53
  end
41
54
  end
42
55
 
@@ -103,6 +116,28 @@ module FubuRake
103
116
  tasks.compilations.each do |c|
104
117
  c.create @options
105
118
  end
119
+
120
+
121
+
122
+ if tasks.bottles.empty? && tasks.bottles_enabled
123
+ Dir.glob('**/.package-manifest').each do |f|
124
+ dir = File.dirname(f)
125
+ project = dir.split('/').last
126
+ if project.index('.Docs') == nil
127
+ proj_file = "#{dir}/#{project}.csproj"
128
+ if File.exists?(proj_file)
129
+ tasks.bottles << FubuRake::AssemblyBottle.new(project)
130
+ end
131
+ end
132
+
133
+ end
134
+ end
135
+
136
+ if !tasks.bottles.empty?
137
+ tasks.bottles.each do |c|
138
+ c.create @options
139
+ end
140
+ end
106
141
  end
107
142
 
108
143
  def add_dependency(from, to)
@@ -159,6 +194,45 @@ module FubuRake
159
194
  end
160
195
  end
161
196
  end
197
+
198
+ class MvcApp
199
+ def initialize(options)
200
+ cleaned_name = options[:name].gsub('.', '_').downcase
201
+ run_args = "--directory #{options[:directory]}"
202
+
203
+ if options.has_key?(:application)
204
+ run_args += " --application #{options[:application]}
205
+ end
206
+
207
+ if options.has_key?(:build)
208
+ run_args += " --build #{options[:build]}"
209
+ end
210
+
211
+ task = Rake::Task.define_task "#{cleaned_name}:alias" do
212
+ sh "bottles alias #{cleaned_name} #{options[:directory]}"
213
+ end
214
+ task.add_description "Add the alias for #{options[:directory]}"
215
+ Rake::Task[:default].enhance ["#{cleaned_name}:alias"]
216
+
217
+
218
+ to_task "#{cleaned_name}:restart", "restart #{cleaned_name}", "touch the web.config file to force ASP.Net hosting to recycle"
219
+ to_task "#{cleaned_name}:run", "run #{run_args} --open", "run the application with Katana hosting"
220
+ to_task "#{cleaned_name}:firefox", "run #{run_args} --browser Firefox --watched", "run the application with Katana hosting and 'watch' the application w/ Firefox"
221
+ to_task "#{cleaned_name}:chrome", "run #{run_args} --browser Chrome --watched", "run the application with Katana hosting and 'watch' the application w/ Chrome"
222
+
223
+ end
224
+
225
+ def to_task(name, args, description)
226
+ task = Rake::Task.define_task name do
227
+ sh "fubu #{args}"
228
+ end
229
+
230
+ task.add_description description
231
+ return task
232
+ end
233
+ end
234
+
235
+
162
236
  end
163
237
 
164
238
 
data/lib/msbuild.rb CHANGED
@@ -8,8 +8,13 @@ module FubuRake
8
8
  compileTask = Rake::Task.define_task :compile do
9
9
  MSBuildRunner.compile options.merge(tasks.compile)
10
10
  end
11
-
12
- compileTask.add_description "Compiles the application"
11
+
12
+ compileTask.add_description "Compiles the solution #{tasks.compile[:solutionfile]}"
13
+
14
+ openTask = Rake::Task.define_task :sln do
15
+ sh "start #{tasks.compile[:solutionfile]}"
16
+ end
17
+ openTask.add_description "Open solution #{tasks.compile[:solutionfile]}"
13
18
 
14
19
  return compileTask
15
20
  end
data/lib/nunit.rb CHANGED
@@ -2,23 +2,38 @@ module FubuRake
2
2
  class NUnit
3
3
  def self.create_task(tasks, options)
4
4
  nunitTask = nil
5
+
6
+ tests = Array.new
7
+
5
8
  if options[:unit_test_projects].any?
6
- nunitTask = Rake::Task.define_task :unit_test do
7
- runner = NUnitRunner.new options
8
- runner.executeTests options[:unit_test_projects]
9
- end
9
+ tests = options[:unit_test_projects]
10
10
  elsif options[:unit_test_list_file] != nil and File::exists?(options[:unit_test_list_file])
11
11
  file = options[:unit_test_list_file]
12
+
13
+ tests = NUnitRunner.readFromFile(file)
12
14
 
15
+ else
16
+ # just find testing projects
17
+ Dir.glob('**/*.Testing.csproj').each do |f|
18
+ test = File.basename(f, ".csproj")
19
+ tests.push test
20
+ end
21
+
22
+ Dir.glob('**/*.Tests.csproj').each do |f|
23
+ test = File.basename(f, ".csproj")
24
+ tests.push test
25
+ end
26
+
27
+ end
28
+
29
+ if !tests.empty?
13
30
  nunitTask = Rake::Task.define_task :unit_test do
14
31
  runner = NUnitRunner.new options
15
- runner.executeTestsInFile file
32
+ runner.executeTests tests
16
33
  end
17
- end
18
34
 
19
- if nunitTask != nil
20
35
  nunitTask.enhance [:compile]
21
- nunitTask.add_description "Runs unit tests"
36
+ nunitTask.add_description "Runs unit tests for " + tests.join(', ')
22
37
  end
23
38
 
24
39
  if tasks.integration_test != nil
@@ -55,11 +70,7 @@ class NUnitRunner
55
70
  end
56
71
  end
57
72
 
58
- def executeTestsInFile(file)
59
- if !File.exist?(file)
60
- throw "File #{file} does not exist"
61
- end
62
-
73
+ def self.readFromFile(file)
63
74
  tests = Array.new
64
75
 
65
76
  file = File.new(file, "r")
@@ -70,6 +81,16 @@ class NUnitRunner
70
81
  end
71
82
  file.close
72
83
 
84
+ return tests
85
+ end
86
+
87
+ def executeTestsInFile(file)
88
+ if !File.exist?(file)
89
+ throw "File #{file} does not exist"
90
+ end
91
+
92
+ tests = readFromFile(file)
93
+
73
94
  if (!tests.empty?)
74
95
  executeTests tests
75
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuburake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.23
4
+ version: 0.9.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy D. Miller
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-06-05 00:00:00.000000000 Z
13
+ date: 2013-08-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ripple-cli