Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c3e398b
Showing
17 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source 'https://rubygems.org' | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
alonzo (0.0.1) | ||
gli (= 2.5.4) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
aruba (0.5.1) | ||
childprocess (~> 0.3.6) | ||
cucumber (>= 1.1.1) | ||
rspec-expectations (>= 2.7.0) | ||
builder (3.2.0) | ||
childprocess (0.3.9) | ||
ffi (~> 1.0, >= 1.0.11) | ||
cucumber (1.2.3) | ||
builder (>= 2.1.2) | ||
diff-lcs (>= 1.1.3) | ||
gherkin (~> 2.11.6) | ||
multi_json (~> 1.3) | ||
diff-lcs (1.2.1) | ||
ffi (1.4.0) | ||
gherkin (2.11.6) | ||
json (>= 1.7.6) | ||
gli (2.5.4) | ||
json (1.7.7) | ||
multi_json (1.6.1) | ||
rake (10.0.3) | ||
rdoc (4.0.0) | ||
json (~> 1.4) | ||
rspec (2.13.0) | ||
rspec-core (~> 2.13.0) | ||
rspec-expectations (~> 2.13.0) | ||
rspec-mocks (~> 2.13.0) | ||
rspec-core (2.13.0) | ||
rspec-expectations (2.13.0) | ||
diff-lcs (>= 1.1.3, < 2.0) | ||
rspec-mocks (2.13.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
alonzo! | ||
aruba | ||
rake | ||
rdoc | ||
rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
= alonzo | ||
|
||
Describe your project here | ||
|
||
:include:alonzo.rdoc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'rake/clean' | ||
require 'rubygems' | ||
require 'rubygems/package_task' | ||
require 'rdoc/task' | ||
require 'cucumber' | ||
require 'cucumber/rake/task' | ||
Rake::RDocTask.new do |rd| | ||
rd.main = "README.rdoc" | ||
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*") | ||
rd.title = 'Your application title' | ||
end | ||
|
||
spec = eval(File.read('alonzo.gemspec')) | ||
|
||
Gem::PackageTask.new(spec) do |pkg| | ||
end | ||
CUKE_RESULTS = 'results.html' | ||
CLEAN << CUKE_RESULTS | ||
desc 'Run features' | ||
Cucumber::Rake::Task.new(:features) do |t| | ||
opts = "features --format html -o #{CUKE_RESULTS} --format progress -x" | ||
opts += " --tags #{ENV['TAGS']}" if ENV['TAGS'] | ||
t.cucumber_opts = opts | ||
t.fork = false | ||
end | ||
|
||
desc 'Run features tagged as work-in-progress (@wip)' | ||
Cucumber::Rake::Task.new('features:wip') do |t| | ||
tag_opts = ' --tags ~@pending' | ||
tag_opts = ' --tags @wip' | ||
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}" | ||
t.fork = false | ||
end | ||
|
||
task :cucumber => :features | ||
task 'cucumber:wip' => 'features:wip' | ||
task :wip => 'features:wip' | ||
require 'rake/testtask' | ||
Rake::TestTask.new do |t| | ||
t.libs << "test" | ||
t.test_files = FileList['test/*_test.rb'] | ||
end | ||
|
||
task :default => [:test,:features] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Ensure we require the local version and not one we might have installed already | ||
require File.join([File.dirname(__FILE__),'lib','alonzo','version.rb']) | ||
spec = Gem::Specification.new do |s| | ||
s.name = 'alonzo' | ||
s.version = Alonzo::VERSION | ||
s.author = 'Joshua Schairbaum' | ||
s.email = 'joshua.schairbaum@gmail.com' | ||
s.homepage = 'https://github.com/jschairb/alonzo' | ||
s.platform = Gem::Platform::RUBY | ||
s.summary = 'Your command-line butler and confident' | ||
# Add your other files here if you make them | ||
s.files = %w( | ||
bin/alonzo | ||
lib/alonzo/version.rb | ||
lib/alonzo.rb | ||
) | ||
s.require_paths << 'lib' | ||
s.has_rdoc = true | ||
s.extra_rdoc_files = ['README.rdoc','alonzo.rdoc'] | ||
s.rdoc_options << '--title' << 'alonzo' << '--main' << 'README.rdoc' << '-ri' | ||
s.bindir = 'bin' | ||
s.executables << 'alonzo' | ||
s.add_development_dependency('rake') | ||
s.add_development_dependency('rdoc') | ||
s.add_development_dependency('aruba') | ||
s.add_development_dependency('rspec') | ||
s.add_runtime_dependency('gli','2.5.4') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
= alonzo | ||
|
||
Generate this with | ||
alonzo rdoc | ||
After you have described your command line interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env ruby | ||
require 'gli' | ||
begin # XXX: Remove this begin/rescue before distributing your app | ||
require 'alonzo' | ||
rescue LoadError | ||
STDERR.puts "In development, you need to use `bundle exec bin/alonzo` to run your app" | ||
STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path" | ||
STDERR.puts "Feel free to remove this message from bin/alonzo now" | ||
exit 64 | ||
end | ||
|
||
include GLI::App | ||
|
||
program_desc 'A commandline butler and confidant' | ||
|
||
version Alonzo::VERSION | ||
|
||
pre do |global, command, options, args| | ||
# Pre logic here | ||
# Return true to proceed; false to abort and not call the | ||
# chosen command | ||
# Use skips_pre before a command to skip this block | ||
# on that command only | ||
true | ||
end | ||
|
||
desc "Generate rubigen-based templates" | ||
arg_name 'template_names' | ||
command :gen do |c| | ||
c.action do |global, options, args| | ||
#Alonzo::Generator.generate(options[:type], options[:root], args) | ||
puts options | ||
puts args.inspect | ||
end | ||
|
||
c.flag [:r, :root], default_value: Dir.pwd, | ||
arg_name: 'project_root', | ||
desc: 'The root directory for the project' | ||
|
||
c.flag [:t, :type], default_value: :lib, | ||
arg_name: 'template_type', | ||
desc: 'The type of template to generate' | ||
end | ||
|
||
post do |global, command, options, args| | ||
# Post logic here | ||
# Use skips_post before a command to skip this | ||
# block on that command only | ||
end | ||
|
||
on_error do |exception| | ||
# Error logic here | ||
# return false to skip default error handling | ||
true | ||
end | ||
|
||
exit run(ARGV) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Feature: My bootstrapped app kinda works | ||
In order to get going on coding my awesome app | ||
I want to have aruba and cucumber setup | ||
So I don't have to do it myself | ||
|
||
Scenario: App just runs | ||
When I get help for "alonzo" | ||
Then the exit status should be 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
When /^I get help for "([^"]*)"$/ do |app_name| | ||
@app_name = app_name | ||
root = File.expand_path(File.join(File.dirname(__FILE__), "..", "..")) | ||
step %(I run `bundle exec #{root}/bin/#{app_name} help`) | ||
end | ||
|
||
# Add more step definitions here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'aruba/cucumber' | ||
|
||
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}" | ||
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib') | ||
|
||
Before do | ||
# Using "announce" causes massive warnings on 1.9.2 | ||
@puts = true | ||
@original_rubylib = ENV['RUBYLIB'] | ||
ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s | ||
end | ||
|
||
After do | ||
ENV['RUBYLIB'] = @original_rubylib | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Alonzo | ||
end | ||
|
||
require 'alonzo/version.rb' | ||
require_relative 'alonzo/generator' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'erb' | ||
|
||
module Alonzo | ||
class Generator | ||
attr_accessor :args, :root, :type | ||
|
||
def self.generate(type, root, args) | ||
generator = new(type, root, args) | ||
generator.generate | ||
end | ||
|
||
def initialize(type, root, args) | ||
self.args = args | ||
self.root = root | ||
self.type = type | ||
end | ||
|
||
def generate | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Alonzo | ||
VERSION = '0.0.1' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
module Alonzo | ||
describe Generator do | ||
let(:generator) { Generator.new } | ||
|
||
describe ".generate" do | ||
end | ||
|
||
describe ".new" do | ||
it "sets the args attribute" | ||
it "sets the root attribute" | ||
it "sets the type attribute" | ||
end | ||
|
||
describe "#generate" do | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file was generated by the `rspec --init` command. Conventionally, all | ||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | ||
# Require this file using `require "spec_helper"` to ensure that it is only | ||
# loaded once. | ||
# | ||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration | ||
RSpec.configure do |config| | ||
config.treat_symbols_as_metadata_keys_with_true_values = true | ||
config.run_all_when_everything_filtered = true | ||
config.filter_run :focus | ||
|
||
# Run specs in random order to surface order dependencies. If you find an | ||
# order dependency and want to debug it, you can fix the order by providing | ||
# the seed, which is printed after each run. | ||
# --seed 1234 | ||
config.order = 'random' | ||
end |