Some useful utilities for Ruby development in TextMate.
-
Formats output when running RSpec specs in TextMate using the RSpec TextMate bundle via the method
printout
-
Namely, it escapes HTML and converts
\n
characters to +<br/>+. -
This is useful when using print statements to debug code while running specs in TextMate.
-
-
Supports forcing of logs to the Textmate window.
-
Defining TM_SHOW_LOGS in your environment will cause all logs issued using the Logger class be to redirected to the TextMate runner window.
-
This is useful when you want to see your application’s logs while running an RSpec spec in TextMate.
-
Include tm_helper into your Gemfile.
gem 'tm_helper'
Use printout
as you would normally use puts
. Output will be automatically formatted when running in an RSpec window.
If using spork with –drb, define TM_HELPER=true and TM_RSPEC=true in the shell before running spork.
eg.
$ TM_HELPER=true TM_RSPEC=true spork
Optionally, define TM_SHOW_LOGS to cause Logger logs issued by your application be to redirected to the TextMate runner window.
This gem is an extension of the original gem I developed while I was working at Capital Thought in 2010: github.com/capitalthought/tm_helper. It is open source, and licensed under the origin gem’s license.
Copyright 2010 Capital Thought, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use any part of this software or its source code except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.