Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 2ba24e7ebcea238ec398b7a4897437843f7beae0 @MSch committed Dec 10, 2010
Showing with 95 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +4 −0 Gemfile
  3. +20 −0 MIT-LICENSE
  4. +14 −0 README.md
  5. +2 −0 Rakefile
  6. +23 −0 irb-rake-task.gemspec
  7. +29 −0 lib/irb/rake_task.rb
@@ -0,0 +1,3 @@
+pkg/*
+*.gem
+.bundle
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in irb-rake-task.gemspec
+gemspec
@@ -0,0 +1,20 @@
+Copyright 2010 Martin Schuerrer http://schuerrer.org
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,14 @@
+irb-rake-task
+=============
+
+Add a ``rake console`` task
+
+Just add this line to your Rakefile:
+
+ require 'irb/rake_task'
+
+License
+=======
+
+MIT License. Copyright 2010 [Martin Schuerrer](http://schuerrer.org).
+
@@ -0,0 +1,2 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = "irb-rake-task"
+ s.version = "0.0.1"
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Martin Schuerrer"]
+ s.email = ["martin@schuerrer.org"]
+ s.homepage = ""
+ s.summary = %q{Provides a rake task that startes an IRB session like the rails console}
+ s.description = %q{Provides a rake task that startes an IRB session like the rails console}
+
+ s.rubyforge_project = "irb-rake-task"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_development_dependency("rake", ["~> 0.8.7"])
+ s.add_runtime_dependency("rake", ["~> 0.8.7"])
+end
@@ -0,0 +1,29 @@
+require 'rake'
+require 'rake/tasklib'
+require 'irb'
+require 'irb/completion'
+
+module IRB
+ class RakeTask < ::Rake::TaskLib
+
+ # Name of task.
+ #
+ # default:
+ # :spec
+ attr_accessor :name
+
+ def initialize(*args)
+ @name = args.shift || :console
+
+ yield self if block_given?
+
+ desc("Start the console") unless ::Rake.application.last_comment
+
+ task name do
+ ARGV.clear
+ IRB.start
+ end
+ end
+
+ end
+end

0 comments on commit 2ba24e7

Please sign in to comment.