showtime 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,29 +2,27 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  showtime (0.1.4)
5
- thor (>= 0.14.3)
5
+ thor (~> 0.14.4)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  diff-lcs (1.1.2)
11
- rspec (2.0.0)
12
- rspec-core (= 2.0.0)
13
- rspec-expectations (= 2.0.0)
14
- rspec-mocks (= 2.0.0)
15
- rspec-core (2.0.0)
16
- rspec-expectations (2.0.0)
17
- diff-lcs (>= 1.1.2)
18
- rspec-mocks (2.0.0)
19
- rspec-core (= 2.0.0)
20
- rspec-expectations (= 2.0.0)
21
- thor (0.14.3)
11
+ rspec (2.1.0)
12
+ rspec-core (~> 2.1.0)
13
+ rspec-expectations (~> 2.1.0)
14
+ rspec-mocks (~> 2.1.0)
15
+ rspec-core (2.1.0)
16
+ rspec-expectations (2.1.0)
17
+ diff-lcs (~> 1.1.2)
18
+ rspec-mocks (2.1.0)
19
+ thor (0.14.4)
22
20
 
23
21
  PLATFORMS
24
22
  ruby
25
23
 
26
24
  DEPENDENCIES
27
- bundler (>= 1.0.0)
28
- rspec (>= 2.0.0)
25
+ bundler (~> 1.0)
26
+ rspec (~> 2.1)
29
27
  showtime!
30
- thor (>= 0.14.3)
28
+ thor (~> 0.14.4)
data/TODO CHANGED
@@ -1,2 +1 @@
1
- * Gemfile support
2
1
  * Lookup for default args on "~/.showtime".
@@ -1,10 +1,15 @@
1
1
  module Showtime
2
2
  class Generator < Thor::Group
3
3
  include Thor::Actions
4
-
5
- argument :name, :optional => true, :default => '.'
6
- class_options :heroku => :boolean, :views => :boolean
7
-
4
+
5
+ argument :name, :optional => true, :default => '.', :desc => "Your application folder"
6
+ class_option :gemfile, :type => :boolean, :desc => "Create a Gemfile inside your application folder."
7
+ class_option :views, :type => :boolean, :desc => "creates the public/javascripts and public/stylesheets folders, and a sample index.erb view."
8
+
9
+ def self.banner
10
+ "showtime [app_name] [options]"
11
+ end
12
+
8
13
  def self.source_root
9
14
  File.join(File.dirname(__FILE__), "templates")
10
15
  end
@@ -12,9 +17,11 @@ module Showtime
12
17
  def create_application_file
13
18
  template("application.rb", "#{name}/application.rb")
14
19
  end
20
+
15
21
  def create_rakefile
16
22
  template("Rakefile", "#{name}/Rakefile")
17
23
  end
24
+
18
25
  def create_config_ru
19
26
  template("config.ru", "#{name}/config.ru")
20
27
  end
@@ -24,12 +31,14 @@ module Showtime
24
31
  end
25
32
 
26
33
  def create_spec_folder_and_helper
27
- directory("spec", "#{name}/spec")
34
+ empty_directory("#{name}/spec")
35
+ template("spec/spec_helper.rb", "#{name}/spec/spec_helper.rb")
36
+ template("spec/application_spec.rb", "#{name}/spec/application_spec.rb")
28
37
  end
29
38
 
30
- def create_gem_dependency_strategy
31
- if options.heroku?
32
- template(".gems", "#{name}/.gems")
39
+ def create_gemfile
40
+ if options.gemfile?
41
+ template("Gemfile", "#{name}/Gemfile")
33
42
  end
34
43
  end
35
44
 
@@ -0,0 +1,6 @@
1
+ gem 'sinatra'
2
+
3
+ group :test do
4
+ gem 'rspec'
5
+ gem 'rack-test', :require => 'rack/test'
6
+ end
@@ -1,6 +1,3 @@
1
- require 'rubygems'
2
- require 'sinatra'
3
-
4
1
  get '/' do
5
2
  <% if options.views? %>
6
3
  @text = "Hello world!"
@@ -1,12 +1,13 @@
1
- require 'application'
2
-
3
- <% unless options.heroku? %>
4
- root_dir = File.dirname(__FILE__)
1
+ <% if options.gemfile? %>
2
+ require 'rubygems'
3
+ require 'bundler'
5
4
 
6
- set :environment, ENV['RACK_ENV'].to_sym
7
- set :root, root_dir
8
- set :app_file, File.join(root_dir, 'application.rb')
9
- disable :run
5
+ Bundler.require
6
+ <% else %>
7
+ require 'rubygems'
8
+ require 'sinatra'
10
9
  <% end %>
11
10
 
11
+ require 'application'
12
+
12
13
  run Sinatra::Application
@@ -1,7 +1,11 @@
1
1
  require File.join(File.dirname(__FILE__), '..', 'application.rb')
2
2
 
3
+ <% if options.gemfile? %>
4
+ Bundler.require :test
5
+ <% else %>
3
6
  require 'rspec'
4
7
  require 'rack/test'
8
+ <% end %>
5
9
 
6
10
  RSpec.configure do |config|
7
11
  config.include Rack::Test::Methods
@@ -2,19 +2,18 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "showtime"
5
- s.version = "0.1.4"
5
+ s.version = "0.2.1"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ["Lucas Mazza"]
8
- s.date = %q{2010-08-09}
9
8
  s.email = ["luc4smazza@gmail.com"]
10
9
  s.homepage = "http://rubygems.org/gems/showtime"
11
10
  s.summary = "Simple Sinatra generator"
12
11
  s.description = "Application generator for simple Sinatra apps"
13
12
 
14
13
  s.required_rubygems_version = ">= 1.3.6"
15
- s.add_development_dependency "bundler", ">= 1.0.0"
16
- s.add_development_dependency "rspec", ">= 2.0.0"
17
- s.add_runtime_dependency "thor", ">= 0.14.3"
14
+ s.add_development_dependency "bundler", "~> 1.0"
15
+ s.add_development_dependency "rspec", "~> 2.1"
16
+ s.add_runtime_dependency "thor", "~> 0.14.4"
18
17
 
19
18
  s.files = `git ls-files`.split("\n")
20
19
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
@@ -22,15 +22,15 @@ describe Showtime::Generator do
22
22
  end
23
23
  end
24
24
 
25
- context "with the --heroku option" do
25
+ context "with the --gemfile option" do
26
26
  before(:each) do
27
- @path = invoke!("some_heroku_app", "--heroku")
27
+ @path = invoke!("app", "--gemfile")
28
28
  end
29
29
 
30
- it "creates the .gems file for deployment" do
30
+ it "creates a basic Gemfile" do
31
31
  inside(@path) do
32
32
  verify_expected_files!
33
- File.exists?(".gems").should be_true
33
+ File.exists?("Gemfile").should be_true
34
34
  end
35
35
  end
36
36
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showtime
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
+ - 2
8
9
  - 1
9
- - 4
10
- version: 0.1.4
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lucas Mazza
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-09 00:00:00 -03:00
18
+ date: 2010-11-15 00:00:00 -02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,14 +24,13 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 23
29
+ hash: 15
30
30
  segments:
31
31
  - 1
32
32
  - 0
33
- - 0
34
- version: 1.0.0
33
+ version: "1.0"
35
34
  type: :development
36
35
  version_requirements: *id001
37
36
  - !ruby/object:Gem::Dependency
@@ -40,14 +39,13 @@ dependencies:
40
39
  requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
- - - ">="
42
+ - - ~>
44
43
  - !ruby/object:Gem::Version
45
- hash: 15
44
+ hash: 1
46
45
  segments:
47
46
  - 2
48
- - 0
49
- - 0
50
- version: 2.0.0
47
+ - 1
48
+ version: "2.1"
51
49
  type: :development
52
50
  version_requirements: *id002
53
51
  - !ruby/object:Gem::Dependency
@@ -56,14 +54,14 @@ dependencies:
56
54
  requirement: &id003 !ruby/object:Gem::Requirement
57
55
  none: false
58
56
  requirements:
59
- - - ">="
57
+ - - ~>
60
58
  - !ruby/object:Gem::Version
61
- hash: 33
59
+ hash: 47
62
60
  segments:
63
61
  - 0
64
62
  - 14
65
- - 3
66
- version: 0.14.3
63
+ - 4
64
+ version: 0.14.4
67
65
  type: :runtime
68
66
  version_requirements: *id003
69
67
  description: Application generator for simple Sinatra apps
@@ -86,7 +84,7 @@ files:
86
84
  - bin/showtime
87
85
  - lib/showtime.rb
88
86
  - lib/showtime/generator.rb
89
- - lib/showtime/templates/.gems
87
+ - lib/showtime/templates/Gemfile
90
88
  - lib/showtime/templates/Rakefile
91
89
  - lib/showtime/templates/application.rb
92
90
  - lib/showtime/templates/config.ru
@@ -1 +0,0 @@
1
- sinatra