cigar 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -2,10 +2,18 @@ To get started:
2
2
 
3
3
  gem install cigar
4
4
 
5
- To generate a new Sinatra application:
5
+ The following commands are available:
6
6
 
7
- cigar new [NAME]
7
+ cigar bundler # Generates a Gemfile for Bundler.
8
+ cigar git # Generates a git repository.
9
+ cigar modular # Generates a modular Sinatra base.
10
+ cigar rackup # Generates a file.ru for Rack.
11
+ cigar thor # Generates a file.thor for Thor.
8
12
 
13
+ For help with a specific command:
14
+
15
+ cigar help [TASK]
16
+
9
17
  For tutorials see the [wiki](https://github.com/tutuMatilda/cigar/wiki).
10
18
 
11
19
  For more information see the [documentation](http://rdoc.info/github/tutuMatilda/cigar/master).
data/cigar.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'cigar'
3
- s.version = '0.0.3'
3
+ s.version = '0.0.4'
4
4
  s.date = '2011-06-21'
5
5
 
6
6
  s.description = "Quick skeleton generation for Sinatra."
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
12
12
  s.files = %w[
13
13
  bin/cigar
14
14
  cigar.gemspec
15
- lib/cigar/templates/app.tt
16
15
  lib/cigar.rb
17
16
  README.markdown
18
17
  ]
data/lib/cigar.rb CHANGED
@@ -3,17 +3,31 @@ require 'thor'
3
3
  class Cigar < Thor
4
4
  include Thor::Actions
5
5
 
6
- # Sets the location of the templates
7
- def self.source_root
8
- File.dirname(__FILE__) + "/cigar/templates"
6
+ desc "modular", "Generates a modular Sinatra base."
7
+ def modular
8
+ invoke :bundler
9
+ invoke :git
10
+ invoke :rackup
11
+ invoke :thor
9
12
  end
10
13
 
11
- # Creates a standard Sinatra application.
12
- #
13
- # @param [String] name the name of the application to create
14
- desc "new [NAME]", "Creates a standard Sinatra application."
15
- def new(name)
16
- @name = name
17
- template("app.tt", "#{name}/#{name}.rb", @name)
14
+ desc "bundler", "Generates a Gemfile for Bundler."
15
+ def bundler
16
+ add_file "Gemfile"
17
+ end
18
+
19
+ desc "git", "Generates a git repository."
20
+ def git
21
+ system("git init")
22
+ end
23
+
24
+ desc "rackup", "Generates a file.ru for Rack."
25
+ def rackup
26
+ add_file "config.ru"
27
+ end
28
+
29
+ desc "thor", "Generates a file.thor for Thor."
30
+ def thor
31
+ add_file "commands.thor"
18
32
  end
19
33
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cigar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - tutuMatilda
@@ -45,7 +45,6 @@ extra_rdoc_files: []
45
45
  files:
46
46
  - bin/cigar
47
47
  - cigar.gemspec
48
- - lib/cigar/templates/app.tt
49
48
  - lib/cigar.rb
50
49
  - README.markdown
51
50
  has_rdoc: true
@@ -1,5 +0,0 @@
1
- class <%= @name.capitalize %> < Sinatra::Base
2
- get '/' do
3
- "Hello from <%= @name %>!"
4
- end
5
- end