Sha256: f150ec3152b349df593eaefeafa3476622635ef58b9bf6dbaff04fede921aee5
Contents?: true
Size: 1.25 KB
Versions: 3
Compression:
Stored size: 1.25 KB
Contents
require 'rake' require 'rake/clean' require 'rbconfig' require 'rspec/core/rake_task' include RbConfig CLEAN.include('**/*.gem', '**/*.rbc', '**/*.rbx', '**/*.lock') namespace 'gem' do desc "Create the sys-cpu gem" task :create => [:clean] do require 'rubygems/package' spec = eval(IO.read('sys-cpu.gemspec')) spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem') Gem::Package.build(spec) end desc "Install the sys-cpu gem" task :install => [:create] do file = Dir["*.gem"].first sh "gem install -l #{file}" end end desc "Run the example program" task :example => [:clean] do case CONFIG['host_os'] when /bsd|darwin|osx/i file = "examples/example_sys_cpu_bsd.rb" sh "ruby -Ilib/unix #{file}" when /hpux/i file = "examples/example_sys_cpu_hpux.rb" sh "ruby -Ilib/unix #{file}" when /linux/i file = "examples/example_sys_cpu_linux.rb" sh "ruby -Ilib/linux #{file}" when /windows|win32|cygwin|mingw|dos/i file = "examples/example_sys_cpu_windows.rb" sh "ruby -Ilib/windows #{file}" when /sunos|solaris/i file = "examples/example_sys_cpu_sunos.rb" sh "ruby -Ilib/unix #{file}" end end desc "Run the test suite" RSpec::Core::RakeTask.new(:spec) task :default => :spec
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sys-cpu-1.0.3 | Rakefile |
sys-cpu-1.0.2 | Rakefile |
sys-cpu-1.0.1 | Rakefile |