Sha256: c813e5adf4254b50e2c6d24f94b8b7de4fc7334253927fe98d324aba4f4bc1fc

Contents?: true

Size: 934 Bytes

Versions: 1

Compression:

Stored size: 934 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 => :check_debug 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

desc "Check for debug code"
task :check_debug do
  raise "you left in some stupid debug stuff" if system("grep -irl binding\.pry lib") or system(%(grep -irl -e 'require.*pry' lib))
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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubygb-0.2.2 Rakefile