Rakefile
changeset 0 aef8f9f4a788
child 1 8fb93d4764de
equal deleted inserted replaced
-1:000000000000 0:aef8f9f4a788
       
     1 #!/usr/bin/env rake
       
     2 # vim: set nosta noet ts=4 sw=4:
       
     3 
       
     4 require 'rake/clean'
       
     5 require 'pathname'
       
     6 
       
     7 BASEDIR = Pathname( __FILE__ ).dirname.relative_path_from( Pathname.pwd )
       
     8 LIBDIR  = BASEDIR + 'lib' + 'symphony'
       
     9 CLOBBER.include( 'coverage' )
       
    10 
       
    11 $LOAD_PATH.unshift( LIBDIR.to_s )
       
    12 
       
    13 if Rake.application.options.trace
       
    14     $trace = true
       
    15     $stderr.puts '$trace is enabled'
       
    16 end
       
    17 
       
    18 task :default => [ :spec, :docs, :package ]
       
    19 
       
    20 
       
    21 ########################################################################
       
    22 ### P A C K A G I N G
       
    23 ########################################################################
       
    24 
       
    25 require 'rubygems'
       
    26 require 'rubygems/package_task'
       
    27 spec = Gem::Specification.new do |s|
       
    28 	s.email        = 'mahlon@martini.nu'
       
    29 	s.homepage     = 'http://projects.martini.nu/ruby-modules'
       
    30 	s.authors      = [ 'Mahlon E. Smith <mahlon@martini.nu>', 'Michael Granger <ged@faeriemud.org>' ]
       
    31 	s.platform     = Gem::Platform::RUBY
       
    32 	s.summary      = "Base classes for using Symphony with ssh."
       
    33 	s.name         = 'symphony-ssh'
       
    34 	s.version      = '0.1.0'
       
    35 	s.license      = 'BSD'
       
    36 	s.has_rdoc     = true
       
    37 	s.require_path = 'lib'
       
    38 	s.bindir       = 'bin'
       
    39 	s.files        = File.read( __FILE__ ).split( /^__END__/, 2 ).last.split
       
    40 	#s.executables  = %w[]
       
    41 	s.description  = <<-EOF
       
    42 	EOF
       
    43 	s.required_rubygems_version = '>= 2.0.3'
       
    44 	s.required_ruby_version = '>= 2.0.0'
       
    45 
       
    46 	s.add_dependency 'symphony', '~> 0.6'
       
    47 	s.add_dependency 'net-ssh',  '~> 2.9'
       
    48 	s.add_dependency 'net-sftp', '~> 2.1'
       
    49 
       
    50 	s.add_development_dependency 'rspec',     '~> 3.0'
       
    51 	s.add_development_dependency 'simplecov', '~> 0.8'
       
    52 end
       
    53 
       
    54 Gem::PackageTask.new( spec ) do |pkg|
       
    55 	pkg.need_zip = true
       
    56 	pkg.need_tar = true
       
    57 end
       
    58 
       
    59 
       
    60 ########################################################################
       
    61 ### D O C U M E N T A T I O N
       
    62 ########################################################################
       
    63 
       
    64 begin
       
    65 	require 'rdoc/task'
       
    66 
       
    67 	desc 'Generate rdoc documentation'
       
    68 	RDoc::Task.new do |rdoc|
       
    69 		rdoc.name       = :docs
       
    70 		rdoc.rdoc_dir   = 'docs'
       
    71 		rdoc.main       = "README.rdoc"
       
    72 		rdoc.options    = [ '-f', 'fivefish' ]
       
    73 		rdoc.rdoc_files = [ 'lib', *FileList['*.rdoc'] ]
       
    74 	end
       
    75 
       
    76 	RDoc::Task.new do |rdoc|
       
    77 		rdoc.name       = :doc_coverage
       
    78 		rdoc.options    = [ '-C1' ]
       
    79 	end
       
    80 
       
    81 rescue LoadError
       
    82 	$stderr.puts "Omitting 'docs' tasks, rdoc doesn't seem to be installed."
       
    83 end
       
    84 
       
    85 
       
    86 ########################################################################
       
    87 ### T E S T I N G
       
    88 ########################################################################
       
    89 
       
    90 begin
       
    91 	require 'rspec/core/rake_task'
       
    92 	task :test => :spec
       
    93 
       
    94 	desc "Run specs"
       
    95 	RSpec::Core::RakeTask.new do |t|
       
    96 		t.pattern = "spec/**/*_spec.rb"
       
    97 	end
       
    98 
       
    99 	desc "Build a coverage report"
       
   100 	task :coverage do
       
   101 		ENV[ 'COVERAGE' ] = "yep"
       
   102 		Rake::Task[ :spec ].invoke
       
   103 	end
       
   104 
       
   105 rescue LoadError
       
   106 	$stderr.puts "Omitting testing tasks, rspec doesn't seem to be installed."
       
   107 end
       
   108 
       
   109 
       
   110 ########################################################################
       
   111 ### M A N I F E S T
       
   112 ########################################################################
       
   113 __END__
       
   114 lib/symphony/tasks/ssh.rb
       
   115 lib/symphony/tasks/sshscript.rb
       
   116 README.rdoc