Skip to content
Browse files

added instructions how to get super-fast CMD-R times in TextMate

bumped version
  • Loading branch information...
1 parent 0abfade commit c0e02e0e7c5cc13227a1e49ab6d1ac3ba7f5fb9f @thieso2 thieso2 committed Oct 24, 2010
Showing with 53 additions and 2 deletions.
  1. +26 −0 README-textmate
  2. +2 −2 snailgun.gemspec
  3. +25 −0 textmate.patch
View
26 README-textmate
@@ -0,0 +1,26 @@
+To get ultra fast CMD-R results in textmate you need to patch the run_script.rb that comes with textmate:
+
+cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/
+
+patch -p0 < wherever_snailgun_was_installed/textmate.patch
+
+To run test in never before seen speed simply cd into your rails-app (tested with rails 3) and say:
+
+> snailgun
+
+the output should read something like:
+Now entering subshell for RAILS_ENV=test. Use 'exit' to terminate snailgun
+Server starting for RAILS_ENV=test
+.. some seconds later ...
+Server ready for RAILS_ENV=test
+
+Now you can either use fruby instead of ruby to start tests "by hand":
+
+fruby -Itest test/unit/your_test.rb
+
+or - in TextMate - simply navigate to your_test.rb and hit CMD-R
+
+enjoy!
+
+thieso@gmail.com 20101024 at #rchh
+
View
4 snailgun.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = %q{snailgun}
- s.version = "1.0.6.2"
+ s.version = "1.0.6.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Candler"]
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.email = %q{b.candler@pobox.com}
s.files = [
"bin/fautotest", "bin/fconsole", "bin/fcucumber", "bin/frake", "bin/fruby", "bin/snailgun",
- "lib/snailgun/server.rb", "README.markdown", "README-snowleopard", "ruby-1.9.2-p0.patch"
+ "lib/snailgun/server.rb", "README.markdown", "README-snowleopard", "ruby-1.9.2-p0.patch", "textmate.patch", "README-textmate"
]
s.executables = ["fautotest", "fconsole", "fcucumber", "frake", "fruby", "snailgun"]
s.extra_rdoc_files = ["README.markdown"]
View
25 textmate.patch
@@ -0,0 +1,25 @@
+--- /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/run_script.rb 2010-10-24 15:18:39.000000000 +0200
++++ /tmp/run_script.rb 2010-10-24 15:18:37.000000000 +0200
+@@ -90,22 +90,6 @@
+ return path, '', path
+ end
+
+-def snailgun_socket
+- Pathname.new(Dir.pwd).ascend do |path|
+- if File.exists?(path.join("config", "boot.rb"))
+- if File.exists?(path.join("tmp", "sockets", "snailgun", "test"))
+- return path.join("tmp", "sockets", "snailgun", "test").to_s
+- end
+- end
+- end
+- nil
+-end
+-
+-if socket = snailgun_socket
+- ENV['SNAILGUN_SOCK'] = socket
+- cmd[0] = 'fruby'
+-end
+-
+ TextMate::Executor.run( cmd, :version_args => ["--version"],
+ :script_args => args ) do |line, type|
+ if is_test_script and type == :out

0 comments on commit c0e02e0

Please sign in to comment.
Something went wrong with that request. Please try again.