This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ > cat ~/bin/switch | |
#!/bin/sh | |
sudo ln -s -f /etc/apache2/other/passenger_ruby_$1.config /etc/apache2/other/passenger_active.conf | |
rvm $1 --passenger | |
sudo apachectl restart | |
########## in /etc/apache2/other ############# | |
apache2/other > ls -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Trying to figure out how to get a model that has submodels (of the same class) to be able to use IR to set things up. | |
model is: | |
class Item < ActiveRecord::Base | |
has_many :subitems, :class_name => "Item" | |
end | |
Right now it works well for normal Items. Now I'd like to setup a controller to handle adding subitems to an item. So far I haven't been able to do this. Not sure if I should use another IR controller, the same Item IR controller but with a special action for new/create to handle when we're adding a normal item vs a subitem to an item...or maybe just a separate controller that doesn't inherit from IR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.generators do |g| | |
g.fixture_replacement :machinist | |
g.test_framework :rspec, :controller_specs => false, :view_specs => false, :helper_specs => false, :routing_specs => false | |
g.template_engine :haml | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ > beet -g digilord_app -r rails3/git | |
Generating rails 3 project digilord_app... | |
create | |
create README | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/controllers/application_controller.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/foo > pwd | |
/Users/jack/foo | |
~/foo > ls -l **/* | |
-rw-r--r-- 1 jack staff 66B Sep 14 21:15 lib/foo.rb | |
-rw-r--r-- 1 jack staff 21B Sep 14 21:14 lib/foo/a.rb | |
-rw-r--r-- 1 jack staff 21B Sep 14 21:14 lib/foo/b.rb | |
lib: | |
total 8 | |
drwxr-xr-x 4 jack staff 136B Sep 14 21:14 foo/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "loads by basename" do | |
- Dir.stubs(:[]).returns(['./test/commands/site/github.rb']) | |
+ Dir.stubs(:[]).returns([RUBY_VERSION < '1.9.2' ? './test/commands/site/github.rb' : | |
+ File.expand_path('./test/commands/site/github.rb')]) | |
load 'github', :file_string=>"module Github; def blah; end; end", :exists=>false | |
library_has_module('site/github', "Boson::Commands::Site::Github") | |
command_exists?('blah') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git/jackdempsey.github.com master > gem uninstall flyrb | |
Remove executables: | |
amazon, google, pastie | |
in addition to the gem? [Yn] y | |
Removing amazon | |
Removing google | |
Removing pastie | |
Successfully uninstalled flyrb-1.0.0.b | |
git/jackdempsey.github.com master > gi flyrb --pre |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 754299fa3fa3ed6608f82edd3114ee3db3218d5f Mon Sep 17 00:00:00 2001 | |
From: Jack Dempsey <[email protected]> | |
Date: Sat, 11 Sep 2010 19:50:43 -0400 | |
Subject: [PATCH] add Gemfile to project | |
--- | |
.gitignore | 1 + | |
Gemfile | 5 +++++ | |
Gemfile.lock | 14 ++++++++++++++ | |
3 files changed, 20 insertions(+), 0 deletions(-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/thor/shell/basic.rb b/lib/thor/shell/basic.rb | |
index 9235f00..b1cc146 100644 | |
--- a/lib/thor/shell/basic.rb | |
+++ b/lib/thor/shell/basic.rb | |
@@ -69,7 +69,7 @@ class Thor | |
# "yes". | |
# | |
def yes?(statement, color=nil) | |
- ask(statement, color) =~ is?(:yes) | |
+ !!(ask(statement, color) =~ is?(:yes)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ > cat foo.rb | |
#!/usr/bin/env ruby | |
loop do | |
puts "whatcha wanna do" | |
answer = gets.chomp | |
case answer | |
when '1' |