Skip to content

Instantly share code, notes, and snippets.

Mike Moore blowmage

Block or report user

Report or block blowmage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@blowmage
blowmage / ruby.svg
Created Aug 17, 2015
Ruby and RubyGems SVG
View ruby.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blowmage
blowmage / docs.rake
Created Nov 15, 2014
A rake task to update the documentation in the gh-pages branch.
View docs.rake
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 / diff.diff
Last active Aug 29, 2015
Updated Minitest::Spec doco
View diff.diff
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:
+ #
View keybase.md

Keybase proof

I hereby claim:

  • I am blowmage on github.
  • I am blowmage (https://keybase.io/blowmage) on keybase.
  • I have a public key whose fingerprint is 7FC4 001A B3B0 FFBA 60FD E278 861B B5BD 2A72 06AF

To claim this, I am signing this object:

@blowmage
blowmage / test_fakefs_thor.rb
Last active Aug 29, 2015
Test to reproduce the problems we were having with FakeFS in the minitest-rails tests. Use version 0.5.0 of FakeFS, and whatever the current version of Thor is.
View test_fakefs_thor.rb
require "minitest/autorun"
require "thor"
require "fakefs/safe"
class SampleGenerator < Thor::Group
include Thor::Actions
def start *args
template "foo.erb", "new/path/here/foo.rb"
end
end
@blowmage
blowmage / .profile
Last active Aug 29, 2015 — forked from zenspider/ohmygems.sh
chruby and ohmygems together at last
View .profile
# my preferred prompt - ☣ [pairwithme:rails4] $
PS1='\[\e[1;31m\]☣ [\W$(if [ -n "$OMG_NAME" ]; then eval "echo :$OMG_NAME"; fi)] $\[\e[0m\] '
# chruby configuration
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
# set default ruby
chruby 2.1
View minitest-assertify.rb
module MiniTest
module Assertify
module Lifecycle # :nodoc:
# Hook into Minitest's Lifecycle to alias methods when tests are run.
def before_setup # :nodoc:
self.class.public_instance_methods.grep(/\Arefute_/).each do |method|
new_method = method.to_s.sub("refute_", "assert_not_").to_sym
class_eval do
alias_method new_method, method
end
View terminal.output
[vagrant@precise32:/vagrant (master)]$ echo "using search_exec"
using search_exec
[vagrant@precise32:/vagrant (master)]$ rspec spec/models/user_search_spec.rb
/usr/local/rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/vagrant/vendor/gems/message_bus/lib/message_bus.rb:130: warning: already initialized constant ENCODE_SITE_TOKEN
== Seed from /vagrant/db/fixtures/post_action_types.rb
- PostActionType {:id=>1, :name_key=>"bookmark", :is_flag=>false, :position=>1}
- PostActionType {:id=>2, :name_key=>"like", :is_flag=>false, :icon=>"heart", :position=>2}
- PostActionType {:id=>3, :name_key=>"off_topic", :is_flag=>true, :position=>3}
@blowmage
blowmage / tasks_controller_refactoring.rb
Created Nov 12, 2012 — forked from ryanb/tasks_controller_refactoring.rb
Variation of RubyTapas episode "021 Domain Model Events" without using callbacks
View tasks_controller_refactoring.rb
class TasksController < ApplicationController
def update
if @task.update_attributes(params[:task])
tracker = PostSaveTaskTracker.new(@task)
TaskPusher.new(tracker, socket_id).push_changes
TaskMailSender.new(tracker, current_user).deliver_email
# success response
else
# failure respond
end
@blowmage
blowmage / tasks_controller_refactoring.rb
Created Nov 12, 2012 — forked from ryanb/tasks_controller_refactoring.rb
Variation of RubyTapas episode "021 Domain Model Events" without callbacks, using dirty, and keeping the tracker object.
View tasks_controller_refactoring.rb
class TasksController < ApplicationController
def update
if @task.update_attributes(params[:task])
tracker = PostSaveTaskTracker.new(@task)
TaskPusher.new(tracker, socket_id).push_changes
TaskMailSender.new(tracker, current_user).deliver_email
# success response
else
# failure respond
end
You can’t perform that action at this time.