Permalink
Browse files

add script/console

  • Loading branch information...
1 parent 1aed2d1 commit 5f1d2bf19eb4345b78c62a59923ad6e94b9757e0 @technoweenie committed Dec 28, 2012
Showing with 28 additions and 0 deletions.
  1. +6 −0 script/console
  2. +22 −0 script/ruby.rb
View
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+require 'rubygems'
+require 'irb'
+require File.expand_path("../ruby", __FILE__)
+require File.expand_path("../../lib/#{MakeScript.lib_name}", __FILE__)
+IRB.start
View
@@ -0,0 +1,22 @@
+module MakeScript
+ extend self
+
+ def lib_name
+ @lib_name ||= Dir['*.gemspec'].first.split('.').first
+ end
+
+ def version
+ @version ||= begin
+ line = File.read("lib/#{lib_name}.rb")[/^\s*VERSION\s*=\s*.*/]
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
+ end
+ end
+
+ def gemspec_file
+ @gemspec_file ||= "#{lib_name}.gemspec"
+ end
+
+ def gem_file
+ @gem_file ||= "#{lib_name}-#{version}.gem"
+ end
+end

0 comments on commit 5f1d2bf

Please sign in to comment.