Skip to content

Commit dc06801

Browse files
committed
cleanup, move to jeweler, nuke gemspec
1 parent 6618c50 commit dc06801

File tree

11 files changed

+77
-739
lines changed

11 files changed

+77
-739
lines changed

.document

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
README.rdoc
2+
lib/**/*.rb
3+
bin/*
4+
features/**/*.feature
5+
LICENSE

.gitignore

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
rdoc
2-
pkg
3-
coverage
4-
*~
51
*.sw?
2+
*~
3+
.DS_Store
4+
coverage
5+
pkg
6+
rdoc

CHANGELOG

-35
This file was deleted.

MIT-LICENSE LICENSE

File renamed without changes.

Rakefile

+56-76
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,75 @@
1-
# Copyright 2008 Scott Barron ([email protected])
2-
# All rights reserved
3-
4-
# This file may be distributed under an MIT style license.
5-
# See MIT-LICENSE for details.
1+
require 'rubygems'
2+
require 'rake'
63

74
begin
8-
require 'rubygems'
9-
require 'rake/gempackagetask'
10-
require 'rake/testtask'
11-
require 'rake/rdoctask'
12-
require 'spec/rake/spectask'
13-
rescue Exception
14-
nil
5+
require 'jeweler'
6+
Jeweler::Tasks.new do |gem|
7+
gem.name = "ttilley-aasm"
8+
gem.summary = %Q{State machine mixin for Ruby objects}
9+
gem.description = %Q{AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.}
10+
gem.homepage = "https://github.com/ttilley/aasm"
11+
gem.authors = ["Scott Barron", "Scott Petersen", "Travis Tilley"]
12+
gem.email = "[email protected]"
13+
gem.add_development_dependency "rspec"
14+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15+
end
16+
Jeweler::GemcutterTasks.new
17+
rescue LoadError
18+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
1519
end
1620

17-
if `ruby -Ilib -raasm -e "print AASM.Version"` =~ /([0-9.]+)$/
18-
CURRENT_VERSION = $1
19-
else
20-
CURRENT_VERSION = '0.0.0'
21+
require 'spec/rake/spectask'
22+
Spec::Rake::SpecTask.new(:spec) do |spec|
23+
spec.libs << 'lib' << 'spec'
24+
spec.spec_files = FileList['spec/**/*_spec.rb']
25+
spec.spec_opts = ['-cfs']
2126
end
22-
$package_version = CURRENT_VERSION
2327

24-
PKG_FILES = FileList['[A-Z]*',
25-
'lib/**/*.rb',
26-
'doc/**/*'
27-
]
28-
29-
desc 'Generate documentation for the acts as state machine plugin.'
30-
rd = Rake::RDocTask.new(:rdoc) do |rdoc|
31-
rdoc.rdoc_dir = 'html'
32-
rdoc.template = 'doc/jamis.rb'
33-
rdoc.rdoc_dir = 'rdoc'
34-
rdoc.title = 'AASM'
35-
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc' << '--title' << 'AASM'
36-
rdoc.rdoc_files.include('README.rdoc', 'MIT-LICENSE', 'TODO', 'CHANGELOG')
37-
rdoc.rdoc_files.include('lib/*.rb', 'lib/**/*.rb', 'doc/**/*.rdoc')
28+
Spec::Rake::SpecTask.new(:rcov) do |spec|
29+
spec.libs << 'lib' << 'spec'
30+
spec.pattern = 'spec/**/*_spec.rb'
31+
spec.rcov = true
3832
end
3933

40-
if !defined?(Gem)
41-
puts "Package target requires RubyGEMs"
42-
else
43-
spec = Gem::Specification.new do |s|
44-
s.name = 'aasm'
45-
s.version = $package_version
46-
s.summary = 'State machine mixin for Ruby objects'
47-
s.description = <<EOF
48-
AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.
49-
EOF
34+
task :spec => :check_dependencies
5035

51-
s.files = PKG_FILES.to_a
52-
s.require_path = 'lib'
53-
s.has_rdoc = true
54-
s.extra_rdoc_files = rd.rdoc_files.reject {|fn| fn =~ /\.rb$/}.to_a
55-
s.rdoc_options = rd.options
56-
57-
s.authors = ['Scott Barron', 'Scott Petersen', 'Travis Tilley']
58-
s.email = '[email protected]'
59-
s.homepage = 'https://github.com/ttilley/aasm'
36+
begin
37+
require 'reek/rake_task'
38+
Reek::RakeTask.new do |t|
39+
t.fail_on_error = true
40+
t.verbose = false
41+
t.source_files = 'lib/**/*.rb'
6042
end
61-
62-
package_task = Rake::GemPackageTask.new(spec) do |pkg|
63-
pkg.need_zip = true
64-
pkg.need_tar = true
43+
rescue LoadError
44+
task :reek do
45+
abort "Reek is not available. In order to run reek, you must: sudo gem install reek"
6546
end
6647
end
6748

68-
if !defined?(Spec)
69-
puts "spec and cruise targets require RSpec"
70-
else
71-
desc "Run all examples with RCov"
72-
Spec::Rake::SpecTask.new('cruise') do |t|
73-
t.spec_files = FileList['spec/**/*.rb']
74-
t.rcov = true
75-
t.rcov_opts = ['--exclude', 'spec', '--exclude', 'Library', '--exclude', 'rcov.rb']
49+
begin
50+
require 'roodi'
51+
require 'roodi_task'
52+
RoodiTask.new do |t|
53+
t.verbose = false
7654
end
77-
78-
desc "Run all examples"
79-
Spec::Rake::SpecTask.new('spec') do |t|
80-
t.spec_files = FileList['spec/**/*.rb']
81-
t.rcov = false
82-
t.spec_opts = ['-cfs']
55+
rescue LoadError
56+
task :roodi do
57+
abort "Roodi is not available. In order to run roodi, you must: sudo gem install roodi"
8358
end
8459
end
8560

86-
if !defined?(Gem)
87-
puts "Package target requires RubyGEMs"
88-
else
89-
desc "sudo gem uninstall aasm && rake gem && sudo gem install pkg/aasm-3.0.0.gem"
90-
task :reinstall do
91-
puts `sudo gem uninstall aasm && rake gem && sudo gem install pkg/aasm-3.0.0.gem`
61+
task :default => :spec
62+
63+
require 'rake/rdoctask'
64+
Rake::RDocTask.new do |rdoc|
65+
if File.exist?('VERSION')
66+
version = File.read('VERSION')
67+
else
68+
version = ""
9269
end
93-
end
9470

95-
task :default => [:spec]
71+
rdoc.rdoc_dir = 'rdoc'
72+
rdoc.title = "ttilley-aasm #{version}"
73+
rdoc.rdoc_files.include('README*')
74+
rdoc.rdoc_files.include('lib/**/*.rb')
75+
end

TODO

-9
This file was deleted.

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.1.2

aasm.gemspec

-19
This file was deleted.

0 commit comments

Comments
 (0)