Sha256: ddc0cbbbf18fc11b0a6772b7030ebe60c7256dcb568b6ad8b8d76b311903bc9c

Contents?: true

Size: 1004 Bytes

Versions: 3

Compression:

Stored size: 1004 Bytes

Contents

# # #
# Get gemspec info

gemspec_file = Dir["*.gemspec"].first
gemspec = eval File.read(gemspec_file), binding, gemspec_file
info = "#{gemspec.name} | #{gemspec.version} | " \
       "#{gemspec.runtime_dependencies.size} dependencies | " \
       "#{gemspec.files.size} files"

# # #
# Gem build and install task

desc info
task :gem do
  puts info + "\n\n"
  print "  "; sh "gem build #{gemspec_file}"
  FileUtils.mkdir_p "pkg"
  FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
  puts; sh %{gem install --no-document pkg/#{gemspec.name}-#{gemspec.version}.gem}
end

# # #
# Start an IRB session with the gem loaded

desc "#{gemspec.name} | IRB"
task :irb do
  sh "irb -I ./lib -r #{gemspec.name.gsub '-','/'}"
end
<% if specs %>
# # #
# Run specs

desc "#{gemspec.name} | Spec"
task :spec do
  if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
    sh "for %f in (spec/\*.rb) do ruby spec/%f"
  else
    sh "for file in spec/*.rb; do ruby $file; done"
  end
end
task default: :spec
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
microgem-1.1.2 template/Rakefile.tt
microgem-1.1.1 template/Rakefile.tt
microgem-1.1.0 template/Rakefile.tt