Permalink
Browse files

surrender

  • Loading branch information...
1 parent 6945fc0 commit 86baad0f58472c944c62a1f4bbad95fb48d3c8b2 @cocoa committed Jun 6, 2013
@@ -0,0 +1,2 @@
+source :rubygems
+gemspec
@@ -0,0 +1,42 @@
+PATH
+ remote: .
+ specs:
+ to-do (0.0.1)
+ gli (= 2.5.6)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ aruba (0.5.3)
+ childprocess (>= 0.3.6)
+ cucumber (>= 1.1.1)
+ rspec-expectations (>= 2.7.0)
+ builder (3.2.2)
+ childprocess (0.3.9)
+ ffi (~> 1.0, >= 1.0.11)
+ cucumber (1.3.2)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.12.0)
+ multi_json (~> 1.3)
+ diff-lcs (1.2.4)
+ ffi (1.8.1)
+ gherkin (2.12.0)
+ multi_json (~> 1.3)
+ gli (2.5.6)
+ json (1.8.0)
+ multi_json (1.7.6)
+ rake (10.0.4)
+ rdoc (4.0.1)
+ json (~> 1.4)
+ rspec-expectations (2.13.0)
+ diff-lcs (>= 1.1.3, < 2.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ aruba
+ rake
+ rdoc
+ to-do!
@@ -0,0 +1,6 @@
+= to-do
+
+Describe your project here
+
+:include:to-do.rdoc
+
@@ -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('to-do.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]
@@ -0,0 +1,86 @@
+#!/usr/bin/env ruby
+require 'gli'
+require 'to-do'
+include GLI::App
+
+
+program_desc 'Describe your application here'
+
+version ToDo::VERSION
+
+desc 'Describe some switch here'
+switch [:s,:switch]
+
+desc 'Describe some flag here'
+default_value 'the default'
+arg_name 'The name of the argument'
+flag [:f,:flagname]
+
+
+
+desc 'Describe new here'
+arg_name 'Describe arguments to new here'
+command :new do |c|
+ c.desc 'Describe a switch to new'
+ c.switch :s
+
+ c.desc 'Describe a flag to new'
+ c.default_value 'default'
+ c.flag :f
+ c.action do |global_options,options,args|
+
+ # Your command logic here
+
+ # If you have any errors, just raise them
+ # raise "that command made no sense"
+
+ puts "new command ran"
+ end
+end
+
+
+
+desc 'Describe list here'
+arg_name 'Describe arguments to list here'
+command :list do |c|
+ c.action do |global_options,options,args|
+ puts "list command ran"
+ end
+end
+
+
+
+
+desc 'Describe done here'
+arg_name 'Describe arguments to done here'
+command :done do |c|
+ c.action do |global_options,options,args|
+ puts "done command ran"
+ end
+end
+
+
+
+
+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
+
+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)
@@ -0,0 +1,6 @@
+When /^I get help for "([^"]*)"$/ do |app_name|
+ @app_name = app_name
+ step %(I run `#{app_name} help`)
+end
+
+# Add more step definitions here
@@ -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
@@ -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 "to-do"
+ Then the exit status should be 0
@@ -0,0 +1,4 @@
+require 'to-do/version.rb'
+
+# Add requires for other files you add to your project here, so
+# you just need to require this one file in your bin file
@@ -0,0 +1,3 @@
+module ToDo
+ VERSION = '0.0.1'
+end
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+class DefaultTest < Test::Unit::TestCase
+
+ def setup
+ end
+
+ def teardown
+ end
+
+ def test_the_truth
+ assert true
+ end
+end
@@ -0,0 +1,9 @@
+require 'test/unit'
+
+# Add test libraries you want to use here, e.g. mocha
+
+class Test::Unit::TestCase
+
+ # Add global extensions to the test case class here
+
+end
@@ -0,0 +1,27 @@
+# Ensure we require the local version and not one we might have installed already
+require File.join([File.dirname(__FILE__),'lib','to-do','version.rb'])
+spec = Gem::Specification.new do |s|
+ s.name = 'to-do'
+ s.version = ToDo::VERSION
+ s.author = 'Your Name Here'
+ s.email = 'your@email.address.com'
+ s.homepage = 'http://your.website.com'
+ s.platform = Gem::Platform::RUBY
+ s.summary = 'A description of your project'
+# Add your other files here if you make them
+ s.files = %w(
+bin/to-do
+lib/to-do/version.rb
+lib/to-do.rb
+ )
+ s.require_paths << 'lib'
+ s.has_rdoc = true
+ s.extra_rdoc_files = ['README.rdoc','to-do.rdoc']
+ s.rdoc_options << '--title' << 'to-do' << '--main' << 'README.rdoc' << '-ri'
+ s.bindir = 'bin'
+ s.executables << 'to-do'
+ s.add_development_dependency('rake')
+ s.add_development_dependency('rdoc')
+ s.add_development_dependency('aruba')
+ s.add_runtime_dependency('gli','2.5.6')
+end
@@ -0,0 +1,5 @@
+= to-do
+
+Generate this with
+ to-do rdoc
+After you have described your command line interface

0 comments on commit 86baad0

Please sign in to comment.