1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'rubygems/specification'
4
- require 'date'
5
- require 'spec/rake/spectask'
1
+ require 'rubygems/package_task'
2
+ require 'rspec/core/rake_task'
6
3
7
- GEM = "htmldiff"
8
- GEM_VERSION = "0.0.1"
9
- AUTHOR = "Nathan Herald"
10
-
11
- HOMEPAGE = "http://github.com/myobie/htmldiff"
12
- SUMMARY = "HTML diffs of text (borrowed from a wiki software I no longer remember)"
4
+ spec = Gem ::Specification . load ( File . expand_path ( 'htmldiff.gemspec' , __dir__ ) )
13
5
14
- spec = Gem ::Specification . new do |s |
15
- s . name = GEM
16
- s . version = GEM_VERSION
17
- s . platform = Gem ::Platform ::RUBY
18
- s . has_rdoc = true
19
- s . extra_rdoc_files = [ "README" , "LICENSE" , 'TODO' ]
20
- s . summary = SUMMARY
21
- s . description = s . summary
22
- s . author = AUTHOR
23
- s . email = EMAIL
24
- s . homepage = HOMEPAGE
25
-
26
- # Uncomment this to add a dependency
27
- # s.add_dependency "foo"
28
-
29
- s . require_path = 'lib'
30
- s . autorequire = GEM
31
- s . files = %w( LICENSE README Rakefile TODO ) + Dir . glob ( "{lib,spec}/**/*" )
6
+ RSpec ::Core ::RakeTask . new ( :spec ) do |t |
7
+ t . pattern = 'spec/**/*_spec.rb'
32
8
end
33
9
34
10
task :default => :spec
35
11
36
- desc "Run specs"
37
- Spec ::Rake ::SpecTask . new do |t |
38
- t . spec_files = FileList [ 'spec/**/*_spec.rb' ]
39
- t . spec_opts = %w( -fs --color )
40
- end
41
-
42
-
43
- Rake ::GemPackageTask . new ( spec ) do |pkg |
12
+ Gem ::PackageTask . new ( spec ) do |pkg |
44
13
pkg . gem_spec = spec
45
14
end
46
15
47
- desc "install the gem locally"
16
+ desc "Install the gem locally"
48
17
task :install => [ :package ] do
49
- sh %{sudo gem install pkg/#{ GEM } -#{ GEM_VERSION } }
18
+ sh " gem install pkg/#{ GEM } -#{ GEM_VERSION } .gem"
50
19
end
51
-
52
- desc "create a gemspec file"
53
- task :make_spec do
54
- File . open ( "#{ GEM } .gemspec" , "w" ) do |file |
55
- file . puts spec . to_ruby
56
- end
57
- end
0 commit comments