caricature 0.7.5 → 0.7.6
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.
- data/README.rdoc +97 -97
- data/Rakefile +309 -310
- data/caricature.gemspec +123 -110
- data/lib/caricature/bacon/integration.rb +75 -75
- data/lib/caricature/bacon.rb +2 -2
- data/lib/caricature/clr/descriptor.rb +159 -159
- data/lib/caricature/clr/event_verification.rb +56 -56
- data/lib/caricature/clr/expectation.rb +100 -100
- data/lib/caricature/clr/isolation.rb +78 -78
- data/lib/caricature/clr/isolator.rb +252 -252
- data/lib/caricature/clr/messenger.rb +51 -49
- data/lib/caricature/clr/method_call_recorder.rb +96 -96
- data/lib/caricature/expectation.rb +1 -1
- data/lib/caricature/method_call_recorder.rb +3 -3
- data/lib/caricature/rspec/integration.rb +118 -118
- data/lib/caricature/version.rb +5 -5
- data/lib/caricature.rb +25 -25
- data/spec/bacon/integration/callback_spec.rb +156 -156
- data/spec/bacon/integration/clr_to_clr_spec.rb +325 -253
- data/spec/bacon/integration/event_spec.rb +97 -97
- data/spec/bacon/integration/indexer_spec.rb +27 -27
- data/spec/bacon/spec_helper.rb +4 -4
- data/spec/bacon/unit/descriptor_spec.rb +212 -212
- data/spec/bacon/unit/sword_spec.rb +39 -39
- data/spec/bacon/unit/verification_spec.rb +103 -103
- data/spec/bin/ClrModels.dll +0 -0
- data/spec/bin/ClrModels.dll.mdb +0 -0
- data/spec/fixtures/ExplodingCar.cs +56 -0
- data/spec/fixtures/ExposedChangedSubscriber.cs +26 -0
- data/spec/fixtures/ExposingWarrior.cs +58 -0
- data/spec/fixtures/IExplodingWarrior.cs +10 -0
- data/spec/fixtures/IExposing.cs +9 -0
- data/spec/fixtures/IExposingBridge.cs +9 -0
- data/spec/fixtures/IExposingWarrior.cs +8 -0
- data/spec/fixtures/IHaveAnIndexer.cs +8 -0
- data/spec/fixtures/IWarrior.cs +13 -0
- data/spec/fixtures/IWeapon.cs +9 -0
- data/spec/fixtures/IndexerCaller.cs +17 -0
- data/spec/fixtures/IndexerContained.cs +20 -0
- data/spec/fixtures/MyClassWithAStatic.cs +16 -0
- data/spec/fixtures/Ninja.cs +34 -0
- data/spec/fixtures/Samurai.cs +29 -0
- data/spec/fixtures/StaticCaller.cs +12 -0
- data/spec/fixtures/Sword.cs +16 -0
- data/spec/fixtures/SwordWithStatics.cs +19 -0
- data/spec/fixtures/clr_interaction.rb +61 -0
- data/spec/fixtures/dagger.rb +11 -0
- data/spec/fixtures/dagger_with_class_members.rb +11 -0
- data/spec/fixtures/sheath.rb +19 -0
- data/spec/fixtures/soldier.rb +29 -0
- data/spec/fixtures/soldier_with_class_members.rb +7 -0
- data/spec/fixtures/swift_cleanup_crew.rb +21 -0
- data/spec/fixtures/with_class_methods.rb +11 -0
- data/spec/{models → models.notused}/ClrModels.cs +241 -241
- data/spec/{models → models.notused}/ruby_models.rb +150 -150
- data/spec/rspec/integration/callback_spec.rb +156 -156
- data/spec/rspec/integration/clr_to_clr_spec.rb +254 -254
- data/spec/rspec/integration/clr_to_ruby_spec.rb +227 -227
- data/spec/rspec/integration/indexer_spec.rb +27 -27
- data/spec/rspec/integration/ruby_to_ruby_spec.rb +271 -271
- data/spec/rspec/spec_helper.rb +12 -12
- data/spec/rspec/unit/core_ext_spec.rb +87 -87
- data/spec/rspec/unit/descriptor_spec.rb +210 -210
- data/spec/rspec/unit/event_spec.rb +16 -16
- data/spec/rspec/unit/expectation_spec.rb +300 -300
- data/spec/rspec/unit/interop_spec.rb +29 -29
- data/spec/rspec/unit/isolation_spec.rb +86 -86
- data/spec/rspec/unit/isolator_spec.rb +219 -219
- data/spec/rspec/unit/messaging_spec.rb +310 -310
- data/spec/rspec/unit/method_call_spec.rb +342 -342
- data/spec/rspec/unit/sword_spec.rb +39 -39
- data/spec/rspec/unit/verification_spec.rb +103 -103
- data/spec/spec_helper.rb +16 -15
- metadata +42 -11
data/Rakefile
CHANGED
@@ -1,310 +1,309 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'rake/rdoctask'
|
4
|
-
|
5
|
-
$:.unshift 'lib'
|
6
|
-
require 'caricature'
|
7
|
-
|
8
|
-
desc "The default task is to run all the specs"
|
9
|
-
task :default => [:clr_models, :spec]
|
10
|
-
|
11
|
-
%w(bacon spec).each do |fw|
|
12
|
-
|
13
|
-
gem_name = fw == "bacon" ? fw : "r#{fw}"
|
14
|
-
|
15
|
-
desc "Runs all the #{gem_name} specs"
|
16
|
-
task fw.to_sym do
|
17
|
-
system "i#{fw} #{Dir.glob("spec/#{gem_name}/**/*_spec.rb").join(' ')}"
|
18
|
-
end
|
19
|
-
|
20
|
-
namespace fw.to_sym do
|
21
|
-
|
22
|
-
desc "runs the #{gem_name} examples for the different classes"
|
23
|
-
task :unit do
|
24
|
-
specs = Dir.glob("spec/#{gem_name}/unit/**/*_spec.rb")
|
25
|
-
system "i#{fw} #{specs.join(' ')}"
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "runs the #{gem_name} integration examples"
|
29
|
-
task :integration do
|
30
|
-
specs = Dir.glob("spec/#{gem_name}/integration/**/*_spec.rb")
|
31
|
-
system "i#{fw} #{specs.join(' ')}"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
def csc
|
39
|
-
system "gmcs"
|
40
|
-
$?.pid.zero? ? "csc" : "gmcs"
|
41
|
-
end
|
42
|
-
|
43
|
-
desc "Compiles the clr models"
|
44
|
-
task :clr_models do
|
45
|
-
Dir.chdir(File.dirname(__FILE__))
|
46
|
-
files = Dir.glob("spec/
|
47
|
-
system "#{csc} /noconfig /target:library /debug+ /debug:full /out:spec/bin/ClrModels.dll #{files}"
|
48
|
-
end
|
49
|
-
|
50
|
-
##############################################################################
|
51
|
-
# OPTIONS
|
52
|
-
##############################################################################
|
53
|
-
|
54
|
-
PKG_NAME = 'caricature'
|
55
|
-
PKG_VERSION = Caricature::VERSION
|
56
|
-
AUTHORS = ['Ivan Porto Carrero']
|
57
|
-
EMAIL = "ivan@flanders.co.nz"
|
58
|
-
HOMEPAGE = "http://casualjim.github.com/caricature"
|
59
|
-
SUMMARY = "Caricature brings simple mocking to Ruby, DLR and CLR."
|
60
|
-
|
61
|
-
# These are the common rdoc options that are shared between generation of
|
62
|
-
# rdoc files using BOTH 'rake rdoc' and the installation by users of a
|
63
|
-
# RubyGem version which builds rdoc's along with its installation. Any
|
64
|
-
# rdoc options that are ONLY for developers running 'rake rdoc' should be
|
65
|
-
# added in the 'Rake::RDocTask' block below.
|
66
|
-
RDOC_OPTIONS = [
|
67
|
-
"--quiet",
|
68
|
-
"--title", SUMMARY,
|
69
|
-
"--main", "README.rdoc",
|
70
|
-
"--line-numbers"
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
#
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
#
|
95
|
-
#
|
96
|
-
|
97
|
-
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#rd.options << '--
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
#
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
s.
|
125
|
-
s.
|
126
|
-
s.
|
127
|
-
s.
|
128
|
-
s.
|
129
|
-
s.
|
130
|
-
s.
|
131
|
-
s.
|
132
|
-
s.
|
133
|
-
s.
|
134
|
-
s.
|
135
|
-
s.
|
136
|
-
s.
|
137
|
-
s.
|
138
|
-
s.
|
139
|
-
s.
|
140
|
-
s.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
pkg.
|
146
|
-
pkg.
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
result
|
173
|
-
result << "
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
name
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
dep,
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
end
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
task :
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
to
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
#
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
p.
|
227
|
-
p.
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
# #
|
241
|
-
#
|
242
|
-
#
|
243
|
-
# self.
|
244
|
-
# self.
|
245
|
-
# self.
|
246
|
-
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
|
251
|
-
|
252
|
-
#
|
253
|
-
#
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
|
268
|
-
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
# gemspec.
|
273
|
-
# gemspec.
|
274
|
-
# gemspec.
|
275
|
-
# gemspec.
|
276
|
-
# gemspec.
|
277
|
-
# gemspec.
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
|
5
|
+
$:.unshift 'lib'
|
6
|
+
require 'caricature'
|
7
|
+
|
8
|
+
desc "The default task is to run all the specs"
|
9
|
+
task :default => [:clr_models, :spec]
|
10
|
+
|
11
|
+
%w(bacon spec).each do |fw|
|
12
|
+
|
13
|
+
gem_name = fw == "bacon" ? fw : "r#{fw}"
|
14
|
+
|
15
|
+
desc "Runs all the #{gem_name} specs"
|
16
|
+
task fw.to_sym do
|
17
|
+
system "i#{fw} #{Dir.glob("spec/#{gem_name}/**/*_spec.rb").join(' ')}"
|
18
|
+
end
|
19
|
+
|
20
|
+
namespace fw.to_sym do
|
21
|
+
|
22
|
+
desc "runs the #{gem_name} examples for the different classes"
|
23
|
+
task :unit do
|
24
|
+
specs = Dir.glob("spec/#{gem_name}/unit/**/*_spec.rb")
|
25
|
+
system "i#{fw} #{specs.join(' ')}"
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "runs the #{gem_name} integration examples"
|
29
|
+
task :integration do
|
30
|
+
specs = Dir.glob("spec/#{gem_name}/integration/**/*_spec.rb")
|
31
|
+
system "i#{fw} #{specs.join(' ')}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
def csc
|
39
|
+
system "gmcs"
|
40
|
+
$?.pid.zero? ? "csc" : "gmcs"
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Compiles the clr models"
|
44
|
+
task :clr_models do
|
45
|
+
Dir.chdir(File.dirname(__FILE__))
|
46
|
+
files = Dir.glob("spec/fixtures/*.cs").join(' ') #.collect { |f| f.gsub(/\//, "\\") }.join(" ")
|
47
|
+
system "#{csc} /noconfig /target:library /debug+ /debug:full /out:spec/bin/ClrModels.dll #{files}"
|
48
|
+
end
|
49
|
+
|
50
|
+
##############################################################################
|
51
|
+
# OPTIONS
|
52
|
+
##############################################################################
|
53
|
+
|
54
|
+
PKG_NAME = 'caricature'
|
55
|
+
PKG_VERSION = Caricature::VERSION
|
56
|
+
AUTHORS = ['Ivan Porto Carrero']
|
57
|
+
EMAIL = "ivan@flanders.co.nz"
|
58
|
+
HOMEPAGE = "http://casualjim.github.com/caricature"
|
59
|
+
SUMMARY = "Caricature brings simple mocking to Ruby, DLR and CLR."
|
60
|
+
|
61
|
+
# These are the common rdoc options that are shared between generation of
|
62
|
+
# rdoc files using BOTH 'rake rdoc' and the installation by users of a
|
63
|
+
# RubyGem version which builds rdoc's along with its installation. Any
|
64
|
+
# rdoc options that are ONLY for developers running 'rake rdoc' should be
|
65
|
+
# added in the 'Rake::RDocTask' block below.
|
66
|
+
RDOC_OPTIONS = [
|
67
|
+
"--quiet",
|
68
|
+
"--title", SUMMARY,
|
69
|
+
"--main", "README.rdoc",
|
70
|
+
"--line-numbers"
|
71
|
+
]
|
72
|
+
|
73
|
+
# Extra files outside of the lib dir that should be included with the rdocs.
|
74
|
+
RDOC_FILES = (%w( README.rdoc)).sort
|
75
|
+
|
76
|
+
# The full file list used for rdocs, tarballs, gems, and for generating the xmpp4r.gemspec.
|
77
|
+
PKG_FILES = (%w( Rakefile caricature.gemspec ) + RDOC_FILES + Dir["{lib,spec}/**/*"]).sort
|
78
|
+
|
79
|
+
# RDOC
|
80
|
+
#######
|
81
|
+
Rake::RDocTask.new do |rd|
|
82
|
+
|
83
|
+
# which dir should rdoc files be installed in?
|
84
|
+
rd.rdoc_dir = 'rdoc'
|
85
|
+
|
86
|
+
# the full list of files to be included
|
87
|
+
rd.rdoc_files.include(RDOC_FILES, "lib/**/*.rb")
|
88
|
+
|
89
|
+
# the full list of options that are common between gem build
|
90
|
+
# and 'rake rdoc' build of docs.
|
91
|
+
rd.options = RDOC_OPTIONS
|
92
|
+
|
93
|
+
# Devs Only : Uncomment to also document private methods in the rdocs
|
94
|
+
# Please don't check this change in to the source repo.
|
95
|
+
#rd.options << '--all'
|
96
|
+
|
97
|
+
# Devs Only : Uncomment to generate dot (graphviz) diagrams along with rdocs.
|
98
|
+
# This requires that graphiz (dot) be installed as a local binary and on your path.
|
99
|
+
# See : http://www.graphviz.org/
|
100
|
+
# Please don't check this change in to the source repo as it introduces a binary dependency.
|
101
|
+
#rd.options << '--diagram'
|
102
|
+
#rd.options << '--fileboxes'
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
desc "Check syntax of all Ruby files."
|
107
|
+
task :check_syntax do
|
108
|
+
`find . -name "*.rb" |xargs -n1 ruby -c |grep -v "Syntax OK"`
|
109
|
+
puts "* Done"
|
110
|
+
end
|
111
|
+
|
112
|
+
##############################################################################
|
113
|
+
# PACKAGING & INSTALLATION
|
114
|
+
##############################################################################
|
115
|
+
|
116
|
+
# What files/dirs should 'rake clean' remove?
|
117
|
+
#CLEAN.include ["*.gem", "pkg", "rdoc", "coverage"]
|
118
|
+
|
119
|
+
begin
|
120
|
+
require 'rake/gempackagetask'
|
121
|
+
|
122
|
+
spec = Gem::Specification.new do |s|
|
123
|
+
s.name = PKG_NAME
|
124
|
+
s.version = PKG_VERSION
|
125
|
+
s.authors = AUTHORS
|
126
|
+
s.email = EMAIL
|
127
|
+
s.homepage = HOMEPAGE
|
128
|
+
s.rubyforge_project = PKG_NAME
|
129
|
+
s.summary = SUMMARY
|
130
|
+
s.description = s.summary
|
131
|
+
s.platform = Gem::Platform::RUBY
|
132
|
+
s.require_path = 'lib'
|
133
|
+
s.executables = []
|
134
|
+
s.files = PKG_FILES
|
135
|
+
s.test_files = []
|
136
|
+
s.has_rdoc = true
|
137
|
+
s.extra_rdoc_files = RDOC_FILES
|
138
|
+
s.rdoc_options = RDOC_OPTIONS
|
139
|
+
s.required_ruby_version = ">= 1.8.6"
|
140
|
+
s.add_dependency 'uuidtools', ">= 2.0.0"
|
141
|
+
end
|
142
|
+
|
143
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
144
|
+
pkg.gem_spec = spec
|
145
|
+
pkg.need_tar = true
|
146
|
+
pkg.need_zip = true
|
147
|
+
end
|
148
|
+
|
149
|
+
namespace :gem do
|
150
|
+
|
151
|
+
desc "Run :package and install the .gem locally"
|
152
|
+
task :install => [:update_gemspec, :package] do
|
153
|
+
sh %{sudo gem install --local pkg/#{PKG_NAME}-#{PKG_VERSION}.gem}
|
154
|
+
end
|
155
|
+
|
156
|
+
desc "Like gem:install but without ri or rdocs"
|
157
|
+
task :install_fast => [:update_gemspec, :package] do
|
158
|
+
sh %{sudo gem install --local pkg/#{PKG_NAME}-#{PKG_VERSION}.gem --no-rdoc --no-ri}
|
159
|
+
end
|
160
|
+
|
161
|
+
desc "Run :clean and uninstall the .gem"
|
162
|
+
task :uninstall => :clean do
|
163
|
+
sh %{sudo gem uninstall #{PKG_NAME}}
|
164
|
+
end
|
165
|
+
|
166
|
+
# Thanks to the Merb project for this code.
|
167
|
+
desc "Update Github Gemspec"
|
168
|
+
task :update_gemspec do
|
169
|
+
skip_fields = %w(new_platform original_platform date)
|
170
|
+
|
171
|
+
result = "# WARNING : RAKE AUTO-GENERATED FILE. DO NOT MANUALLY EDIT!\n"
|
172
|
+
result << "# RUN : 'rake gem:update_gemspec'\n\n"
|
173
|
+
result << "Gem::Specification.new do |s|\n"
|
174
|
+
spec.instance_variables.sort.each do |ivar|
|
175
|
+
value = spec.instance_variable_get(ivar)
|
176
|
+
name = ivar.to_s.split("@").last
|
177
|
+
next if skip_fields.include?(name) || value.nil? || value == "" || (value.respond_to?(:empty?) && value.empty?)
|
178
|
+
if name == "dependencies"
|
179
|
+
value.each do |d|
|
180
|
+
dep, *ver = d.to_s.split(" ")
|
181
|
+
result << " s.add_dependency #{dep.inspect}, #{ver.join(" ").inspect.gsub(/[()]/, "")}\n"
|
182
|
+
end
|
183
|
+
else
|
184
|
+
case value
|
185
|
+
when Array
|
186
|
+
value = name != "files" ? value.inspect : value.sort.uniq.inspect.split(",").join(",\n")
|
187
|
+
when String, Fixnum, true, false
|
188
|
+
value = value.inspect
|
189
|
+
else
|
190
|
+
value = value.to_s.inspect
|
191
|
+
end
|
192
|
+
result << " s.#{name} = #{value}\n"
|
193
|
+
end
|
194
|
+
end
|
195
|
+
result << "end"
|
196
|
+
File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w"){|f| f << result}
|
197
|
+
end
|
198
|
+
|
199
|
+
end # namespace :gem
|
200
|
+
|
201
|
+
# also keep the gemspec up to date each time we package a tarball or gem
|
202
|
+
task :package => ['gem:update_gemspec']
|
203
|
+
task :gem => ['gem:update_gemspec']
|
204
|
+
|
205
|
+
rescue LoadError
|
206
|
+
puts <<EOF
|
207
|
+
###
|
208
|
+
Packaging Warning : RubyGems is apparently not installed on this
|
209
|
+
system and any file add/remove/rename will not
|
210
|
+
be auto-updated in the 'caricature.gemspec' when you run any
|
211
|
+
package tasks. All such file changes are recommended
|
212
|
+
to be packaged on a system with RubyGems installed
|
213
|
+
if you intend to push commits to the Git repo so the
|
214
|
+
gemspec will also stay in sync for others.
|
215
|
+
###
|
216
|
+
EOF
|
217
|
+
end
|
218
|
+
|
219
|
+
# we are apparently on a system that does not have RubyGems installed.
|
220
|
+
# Lets try to provide only the basic tarball package tasks as a fallback.
|
221
|
+
unless defined? Gem
|
222
|
+
begin
|
223
|
+
require 'rake/packagetask'
|
224
|
+
Rake::PackageTask.new(PKG_NAME, PKG_VERSION) do |p|
|
225
|
+
p.package_files = PKG_FILES
|
226
|
+
p.need_tar = true
|
227
|
+
p.need_zip = true
|
228
|
+
end
|
229
|
+
rescue LoadError
|
230
|
+
puts <<EOF
|
231
|
+
###
|
232
|
+
Warning : Unable to require the 'rake/packagetask'. Is Rake installed?
|
233
|
+
###
|
234
|
+
EOF
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
|
239
|
+
# # Generate all the Rake tasks
|
240
|
+
# # Run 'rake -T' to see list of generated tasks (from gem root directory)
|
241
|
+
# $hoe = Hoe.spec 'cloudslide' do
|
242
|
+
# self.developer 'Ivan Porto Carrero', 'ivan@flanders.co.nz'
|
243
|
+
# self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
244
|
+
# self.rubyforge_name = self.name # TODO this is default value
|
245
|
+
# self.extra_deps = [['uuidtools','>= 2.0.0'], ['newgem', '>= 1.5.2']]
|
246
|
+
# end
|
247
|
+
#
|
248
|
+
# require 'newgem/tasks'
|
249
|
+
# Dir['tasks/**/*.rake'].each { |t| load t }
|
250
|
+
|
251
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
252
|
+
# remove_task :default
|
253
|
+
# task :default => [:spec, :features]
|
254
|
+
|
255
|
+
# file_list = Dir.glob("lib/**/*.rb")
|
256
|
+
|
257
|
+
# desc "Create RDoc documentation"
|
258
|
+
# file 'doc/index.html' => file_list do
|
259
|
+
# puts "######## Creating RDoc documentation"
|
260
|
+
# system "rdoc --title 'Caricature isolation framework documentation' -m README README.markdown lib/"
|
261
|
+
# end
|
262
|
+
#
|
263
|
+
# desc "An alias for creating the RDoc documentation"
|
264
|
+
# task :rdoc do
|
265
|
+
# Rake::Task['doc/index.html'].invoke
|
266
|
+
# end
|
267
|
+
|
268
|
+
# begin
|
269
|
+
#
|
270
|
+
# Jeweler::Tasks.new do |gemspec|
|
271
|
+
# gemspec.name = "caricature"
|
272
|
+
# gemspec.summary = "Caricature - Bringing simple mocking to the DLR"
|
273
|
+
# gemspec.email = "ivan@flanders.co.nz"
|
274
|
+
# gemspec.homepage = "http://github.com/casualjim/caricature"
|
275
|
+
# gemspec.description = "This project aims to make interop between IronRuby objects and .NET objects easier. The idea is that it integrates nicely with bacon and later rspec and that it transparently lets you mock ironruby ojbects as well as CLR objects/interfaces. Caricature handles interfaces, interface inheritance, CLR objects, CLR object instances, Ruby classes and instances of Ruby classes."
|
276
|
+
# gemspec.authors = ["Ivan Porto Carrero"]
|
277
|
+
# gemspec.rubyforge_project = 'caricature' # This line would be new
|
278
|
+
# end
|
279
|
+
# rescue LoadError
|
280
|
+
# puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
281
|
+
# end
|
282
|
+
#
|
283
|
+
begin
|
284
|
+
require 'rake/contrib/sshpublisher'
|
285
|
+
namespace :rubyforge do
|
286
|
+
|
287
|
+
desc "Release gem and RDoc documentation to RubyForge"
|
288
|
+
task :release => ["rubyforge:release:gem", 'rubyforge:release:docs']
|
289
|
+
|
290
|
+
namespace :release do
|
291
|
+
desc "Publish RDoc to RubyForge."
|
292
|
+
task :docs => [:rdoc] do
|
293
|
+
config = YAML.load(
|
294
|
+
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
295
|
+
)
|
296
|
+
|
297
|
+
host = "#{config['username']}@rubyforge.org"
|
298
|
+
remote_dir = "/var/www/gforge-projects/caricature/"
|
299
|
+
local_dir = 'doc'
|
300
|
+
|
301
|
+
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
302
|
+
end
|
303
|
+
end
|
304
|
+
end
|
305
|
+
rescue LoadError
|
306
|
+
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
307
|
+
end
|
308
|
+
|
309
|
+
|