-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'bootstar init' now creates an empty dir structure
Ref. #5
- Loading branch information
Matteo Centenaro
committed
Sep 11, 2012
1 parent
469ae93
commit 16fa163
Showing
6 changed files
with
56 additions
and
45 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
require 'rubygems' # ruby1.9 doesn't "require" it though | ||
require 'thor' | ||
require 'bootstar/cli' | ||
|
||
require 'bootstar' | ||
|
||
begin | ||
Bootstar::CLI.new *ARGV.dup | ||
rescue StandardError => e | ||
puts "Error: #{e.message}" | ||
puts e.backtrace | ||
end | ||
Bootstar::CLI.start |
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 |
---|---|---|
@@ -1,24 +1,27 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path("../lib", __FILE__) | ||
require "bootstar/version" | ||
$:.push File.expand_path('../lib', __FILE__) | ||
require 'bootstar/version' | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "bootstar" | ||
s.name = 'bootstar' | ||
s.version = Bootstar::VERSION | ||
s.authors = ["Giovanni Cappellotto"] | ||
s.email = ["[email protected]"] | ||
s.homepage = "http://github.com/hackatron/bootstar" | ||
s.authors = ['Nicola Brisotto', 'Giovanni Cappellotto', 'Matteo Centenaro', 'Eugenio Depalo', 'Matteo Depalo', 'Francesco Tartaggia'] | ||
This comment has been minimized.
Sorry, something went wrong. |
||
s.email = ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]'] | ||
s.homepage = 'http://github.com/hackatron/bootstar' | ||
s.summary = %q{A tool to bootstrap your service oriented app} | ||
s.description = %q{Bootstar is a tool to bootstrap your service oriented app.} | ||
|
||
s.rubyforge_project = "bootstar" | ||
s.rubyforge_project = 'bootstar' | ||
|
||
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.require_paths = ['lib'] | ||
|
||
s.add_dependency 'thor' | ||
|
||
# specify any dependencies here; for example: | ||
s.add_development_dependency "rspec" | ||
s.add_development_dependency 'rspec' | ||
s.add_development_dependency 'debugger' | ||
# s.add_runtime_dependency "rest-client" | ||
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 |
---|---|---|
@@ -1,29 +1,12 @@ | ||
require 'optparse' | ||
require 'thor' | ||
|
||
module Bootstar | ||
class CLI | ||
|
||
attr_accessor :params, :action | ||
|
||
def initialize(*args) | ||
@params = {} | ||
@action = :output | ||
|
||
OptionParser.new do |opts| | ||
opts.banner = "Usage: bootstar new" | ||
|
||
opts.on_tail("-h", "--help", "Show this message") do | ||
puts opts | ||
exit | ||
end | ||
|
||
if args.empty? | ||
puts opts | ||
exit | ||
end | ||
end.parse!(args) | ||
|
||
puts "Bootstar executable..." | ||
class CLI < Thor | ||
desc 'init APP_NAME', 'Create a new basic bootstar app' | ||
def init(name) | ||
Dir.mkdir(File.join('.', name)) | ||
Dir.chdir(File.join('.', name)) | ||
['api', 'client', 'ruby'].each {|dir| Dir.mkdir(File.join('.', "#{name}-#{dir}"))} | ||
end | ||
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,29 @@ | ||
require 'spec_helper' | ||
|
||
describe 'App creation' do | ||
context 'bootstar init' do | ||
before(:all) do | ||
system('bootstar init test-app') | ||
end | ||
|
||
after(:all) do | ||
system('rm -rf test-app') | ||
end | ||
|
||
it 'should create folder with the app name' do | ||
File.directory?('./test-app').should be_true | ||
end | ||
|
||
it 'should create a directory for the API' do | ||
File.directory?('./test-app/test-app-api').should be_true | ||
end | ||
|
||
it 'should create a directory for the client' do | ||
File.directory?('./test-app/test-app-client').should be_true | ||
end | ||
|
||
it 'should create a directory for the API wrapper gem' do | ||
File.directory?('./test-app/test-app-ruby').should be_true | ||
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
require 'spec_helper' | ||
|
||
describe Bootstar do | ||
pending "write it" | ||
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
Hackatron team FTW!