showtime 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +13 -15
- data/TODO +0 -1
- data/lib/showtime/generator.rb +17 -8
- data/lib/showtime/templates/Gemfile +6 -0
- data/lib/showtime/templates/application.rb +0 -3
- data/lib/showtime/templates/config.ru +9 -8
- data/lib/showtime/templates/spec/spec_helper.rb +4 -0
- data/showtime.gemspec +4 -5
- data/spec/generator_spec.rb +4 -4
- metadata +16 -18
- data/lib/showtime/templates/.gems +0 -1
data/Gemfile.lock
CHANGED
@@ -2,29 +2,27 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
showtime (0.1.4)
|
5
|
-
thor (
|
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.
|
12
|
-
rspec-core (
|
13
|
-
rspec-expectations (
|
14
|
-
rspec-mocks (
|
15
|
-
rspec-core (2.
|
16
|
-
rspec-expectations (2.
|
17
|
-
diff-lcs (
|
18
|
-
rspec-mocks (2.
|
19
|
-
|
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 (
|
28
|
-
rspec (
|
25
|
+
bundler (~> 1.0)
|
26
|
+
rspec (~> 2.1)
|
29
27
|
showtime!
|
30
|
-
thor (
|
28
|
+
thor (~> 0.14.4)
|
data/TODO
CHANGED
data/lib/showtime/generator.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
31
|
-
if options.
|
32
|
-
template("
|
39
|
+
def create_gemfile
|
40
|
+
if options.gemfile?
|
41
|
+
template("Gemfile", "#{name}/Gemfile")
|
33
42
|
end
|
34
43
|
end
|
35
44
|
|
@@ -1,12 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
root_dir = File.dirname(__FILE__)
|
1
|
+
<% if options.gemfile? %>
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
data/showtime.gemspec
CHANGED
@@ -2,19 +2,18 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "showtime"
|
5
|
-
s.version = "0.1
|
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", "
|
16
|
-
s.add_development_dependency "rspec", "
|
17
|
-
s.add_runtime_dependency "thor", "
|
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
|
data/spec/generator_spec.rb
CHANGED
@@ -22,15 +22,15 @@ describe Showtime::Generator do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
context "with the --
|
25
|
+
context "with the --gemfile option" do
|
26
26
|
before(:each) do
|
27
|
-
@path = invoke!("
|
27
|
+
@path = invoke!("app", "--gemfile")
|
28
28
|
end
|
29
29
|
|
30
|
-
it "creates
|
30
|
+
it "creates a basic Gemfile" do
|
31
31
|
inside(@path) do
|
32
32
|
verify_expected_files!
|
33
|
-
File.exists?("
|
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:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 2
|
8
9
|
- 1
|
9
|
-
|
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-
|
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:
|
29
|
+
hash: 15
|
30
30
|
segments:
|
31
31
|
- 1
|
32
32
|
- 0
|
33
|
-
|
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:
|
44
|
+
hash: 1
|
46
45
|
segments:
|
47
46
|
- 2
|
48
|
-
-
|
49
|
-
|
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:
|
59
|
+
hash: 47
|
62
60
|
segments:
|
63
61
|
- 0
|
64
62
|
- 14
|
65
|
-
-
|
66
|
-
version: 0.14.
|
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
|
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
|