Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First commit

  • Loading branch information...
commit b32d61f5f5274e630575399eaf07031b4fff3def 1 parent 761f9ef
@winton authored
View
8 README.markdown
@@ -16,8 +16,8 @@ Setup the template
You only have to do this once.
<pre>
-git clone git@github.com:winton/gem_template.git
-cd gem_template
+git clone git@github.com:winton/auto-terminal.git
+cd auto-terminal
stencil
</pre>
@@ -29,8 +29,8 @@ Do this for every new project.
<pre>
mkdir my_project
git init
-stencil gem_template
+stencil auto-terminal
rake rename
</pre>
-The last command does a find-replace (gem\_template -> my\_project) on files and filenames.
+The last command does a find-replace (gem\_template -> my\_project) on files and filenames.
View
6 bin/auto
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'auto'
+
+terminal(ARGV)
View
4 bin/gem_template
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.push File.expand_path("#{File.dirname(__FILE__)}/../lib")
-require 'gem_template'
View
10 gemspec.rb
@@ -1,18 +1,18 @@
-GEM_NAME = 'gem_template'
+GEM_NAME = 'auto-terminal'
GEM_FILES = FileList['**/*'] - FileList['coverage', 'coverage/**/*', 'pkg', 'pkg/**/*']
GEM_SPEC = Gem::Specification.new do |s|
# == CONFIGURE ==
s.author = "Winton Welsh"
s.email = "mail@wintoni.us"
s.homepage = "http://github.com/winton/#{GEM_NAME}"
- s.summary = ""
+ s.summary = "Use Auto from the command line"
# == CONFIGURE ==
- s.executables << GEM_NAME
+ s.executables << 'auto'
s.extra_rdoc_files = [ "README.markdown" ]
s.files = GEM_FILES.to_a
s.has_rdoc = false
s.name = GEM_NAME
s.platform = Gem::Platform::RUBY
s.require_path = "lib"
- s.version = "0.1.0"
-end
+ s.version = "0.0.1"
+end
View
1  lib/gem_template.rb
@@ -1 +0,0 @@
-require File.dirname(__FILE__) + "/gem_template/gem_template"
View
0  lib/gem_template/gem_template.rb
No changes.
View
40 lib/terminal.rb
@@ -0,0 +1,40 @@
+module Auto
+ module Terminal
+
+ def terminal(args)
+ Terminal.instance(self, args)
+ end
+
+ class Terminal
+
+ cattr_accessor :runner
+
+ class <<self
+
+ def instance(runner, args)
+ @@runner = runner
+ if args.empty?
+ Plugins.tasks.each do |task|
+ puts task[:name]
+ end
+ else
+ args.each do |task|
+ run(task)
+ end
+ end
+ end
+
+ def run(task)
+ @@runner.before_question do |key, value|
+ puts value.first
+ @@runner.instance_eval do
+ answers[key] = STDIN.gets
+ eval("@#{key} = answers[key]")
+ end
+ end
+ @@runner.run(task)
+ end
+ end
+ end
+ end
+end
View
2  spec/spec_helper.rb
@@ -2,7 +2,7 @@
SPEC = File.dirname(__FILE__)
$:.unshift File.expand_path("#{SPEC}/../lib")
-require 'gem_template'
+require 'auto-terminal'
require 'pp'
Spec::Runner.configure do |config|
Please sign in to comment.
Something went wrong with that request. Please try again.