Skip to content

Instantly share code, notes, and snippets.

View blowmage's full-sized avatar

Mike Moore blowmage

View GitHub Profile
@blowmage
blowmage / diff.diff
Last active August 29, 2015 14:02
Updated Minitest::Spec doco
diff --git a/lib/minitest/spec.rb b/lib/minitest/spec.rb
index 40b5e6a..c5b334d 100644
--- a/lib/minitest/spec.rb
+++ b/lib/minitest/spec.rb
@@ -22,6 +22,25 @@ module Kernel # :nodoc:
##
# Describe a series of expectations for a given target +desc+.
#
+ # You can describe your test by passing the object under test:
+ #
@blowmage
blowmage / docs.rake
Created November 15, 2014 01:56
A rake task to update the documentation in the gh-pages branch.
namespace :docs do
desc "Updates the documentation on the gh-pages branch"
task :update do
branch = `git symbolic-ref --short HEAD`.chomp
if "master" != branch
puts "You are on the #{branch} branch. You must be on the master branch to run this rake task."
exit
end
require_relative "../lib/my_gem/version.rb"
@blowmage
blowmage / ruby.svg
Created August 17, 2015 22:06
Ruby and RubyGems SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blowmage
blowmage / lib-tasks-db_fixtures_dump.rake
Created December 6, 2022 11:45
Rails Rake task to dump the current environment's database into fixture files.
namespace :db do
namespace :fixtures do
desc "Dumps the current environment's database into fixtures (uses FIXTURES_PATH)"
task dump: :environment do
Rails.application.eager_load!
models = ApplicationRecord.descendants.reject { |model| model.primary_key.nil? }
fixture_files = ENV["FIXTURES"].to_s.split(",")
if fixture_files.any?