sinatra-gen 0.2.0 → 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.
- data/History.txt +7 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +4 -2
- data/Rakefile +1 -1
- data/app_generators/sinatra_app/USAGE +1 -1
- data/app_generators/sinatra_app/sinatra_app_generator.rb +24 -11
- data/app_generators/sinatra_app/templates/config.ru.erb +1 -1
- data/app_generators/sinatra_app/templates/test/test_app_bacon.rb.erb +20 -0
- data/app_generators/sinatra_app/templates/test/test_app_rspec.rb.erb +2 -2
- data/app_generators/sinatra_app/templates/test/test_app_shoulda.rb.erb +2 -2
- data/app_generators/sinatra_app/templates/test/test_app_spec.rb.erb +2 -2
- data/app_generators/sinatra_app/templates/test/test_app_unit.rb.erb +2 -2
- data/app_generators/sinatra_app/templates/test/test_helper.rb.erb +3 -2
- data/lib/sinatra-gen.rb +1 -1
- data/sinatra-gen.gemspec +10 -12
- data/test/test_sinatra_app_generator.rb +19 -8
- metadata +6 -5
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.2.1 2009-02-10
|
2
|
+
|
3
|
+
* Updated tests and templates for Sinatra 0.9
|
4
|
+
* Added support for test/bacon
|
5
|
+
* Fixed errors with latest rubigen where git commands were happening before file generation
|
6
|
+
* Updated rubigen dependency
|
7
|
+
|
1
8
|
== 0.2.0 2008-12-23
|
2
9
|
|
3
10
|
* 1 major enhancement
|
data/Manifest.txt
CHANGED
@@ -12,6 +12,7 @@ app_generators/sinatra_app/templates/config.ru.erb
|
|
12
12
|
app_generators/sinatra_app/templates/config.yml
|
13
13
|
app_generators/sinatra_app/templates/config/deploy.rb.erb
|
14
14
|
app_generators/sinatra_app/templates/lib/module.rb.erb
|
15
|
+
app_generators/sinatra_app/templates/test/test_app_bacon.rb.erb
|
15
16
|
app_generators/sinatra_app/templates/test/test_app_rspec.rb.erb
|
16
17
|
app_generators/sinatra_app/templates/test/test_app_shoulda.rb.erb
|
17
18
|
app_generators/sinatra_app/templates/test/test_app_spec.rb.erb
|
data/README.rdoc
CHANGED
@@ -5,7 +5,9 @@ http://github.com/quirkey/sinatra-gen
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
7
|
sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework.
|
8
|
-
For more information on sinatra, check out http://
|
8
|
+
For more information on sinatra, check out http://sinatrarb.com
|
9
|
+
|
10
|
+
!! NOW WITH SUPPORT FOR SINATRA 0.9 (02/10/09)
|
9
11
|
|
10
12
|
== SYNOPSIS:
|
11
13
|
|
@@ -57,7 +59,7 @@ It will also generate test skeletons in the test framework of your choosing.
|
|
57
59
|
--cap Adds config directory with basic capistrano deploy.rb
|
58
60
|
--scripts Install the rubigen scripts (script/generate, script/destroy)
|
59
61
|
--git /path/to/git Specify a different path for 'git'
|
60
|
-
--test=test_framework Specify your testing framework (unit (default)/rspec/spec/shoulda)
|
62
|
+
--test=test_framework Specify your testing framework (unit (default)/rspec/spec/shoulda/bacon)
|
61
63
|
--views=view_framework Specify your view framework (erb (default)/haml/builder)
|
62
64
|
|
63
65
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ $hoe = Hoe.new('sinatra-gen', SinatraGen::VERSION) do |p|
|
|
9
9
|
p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
10
10
|
p.rubyforge_name = 'quirkey'
|
11
11
|
p.extra_deps = [
|
12
|
-
['rubigen','>= 1.
|
12
|
+
['rubigen','>= 1.5.2'],
|
13
13
|
]
|
14
14
|
p.extra_dev_deps = [
|
15
15
|
['newgem', ">= #{::Newgem::VERSION}"]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Description:
|
2
2
|
|
3
3
|
sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework.
|
4
|
-
For more information on sinatra, check out http://
|
4
|
+
For more information on sinatra, check out http://sinatrarb.com
|
5
5
|
|
6
6
|
Usage:
|
7
7
|
|
@@ -1,8 +1,21 @@
|
|
1
|
+
class RubiGen::Commands::Create
|
2
|
+
|
3
|
+
def run(command, relative_path = '')
|
4
|
+
in_directory = destination_path(relative_path)
|
5
|
+
logger.run command
|
6
|
+
system("cd #{in_directory} && #{command}")
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
|
1
12
|
class SinatraAppGenerator < RubiGen::Base
|
2
13
|
|
3
14
|
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
4
15
|
Config::CONFIG['ruby_install_name'])
|
5
16
|
|
17
|
+
SINATRA_GIT_URL = 'git://github.com/sinatra/sinatra.git'
|
18
|
+
|
6
19
|
default_options :author => nil
|
7
20
|
|
8
21
|
attr_accessor :app_name, :vendor, :tiny, :git, :git_init, :test_framework, :view_framework, :install_scripts, :cap, :actions
|
@@ -22,11 +35,11 @@ class SinatraAppGenerator < RubiGen::Base
|
|
22
35
|
m.directory ''
|
23
36
|
|
24
37
|
if git_init
|
25
|
-
|
38
|
+
m.run("#{git} init")
|
26
39
|
end
|
27
40
|
|
28
41
|
m.template 'config.ru.erb', 'config.ru'
|
29
|
-
m.template 'app.rb.erb' ,
|
42
|
+
m.template 'app.rb.erb' , "#{app_name}.rb"
|
30
43
|
m.template 'Rakefile.erb' , 'Rakefile'
|
31
44
|
|
32
45
|
unless tiny
|
@@ -40,14 +53,14 @@ class SinatraAppGenerator < RubiGen::Base
|
|
40
53
|
end
|
41
54
|
|
42
55
|
if vendor
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
56
|
+
m.directory 'vendor'
|
57
|
+
if git_init || File.exists?(File.join(@destination_root, '.git'))
|
58
|
+
command = "#{git} submodule add #{SINATRA_GIT_URL} vendor/sinatra"
|
59
|
+
else
|
60
|
+
command = "#{git} clone #{SINATRA_GIT_URL} vendor/sinatra"
|
61
|
+
end
|
62
|
+
m.run(command)
|
48
63
|
end
|
49
|
-
`#{command}`
|
50
|
-
end
|
51
64
|
|
52
65
|
if cap
|
53
66
|
m.directory 'config'
|
@@ -81,7 +94,7 @@ EOS
|
|
81
94
|
opts.on("--cap", "Adds config directory with basic capistrano deploy.rb") {|o| options[:cap] = o }
|
82
95
|
opts.on("--scripts", "Install the rubigen scripts (script/generate, script/destroy)") {|o| options[:scripts] = o }
|
83
96
|
opts.on("--git /path/to/git", "Specify a different path for 'git'") {|o| options[:git] = o }
|
84
|
-
opts.on("--test=test_framework", String, "Specify your testing framework (unit (default)/rspec/spec/shoulda)") {|o| options[:test_framework] = o }
|
97
|
+
opts.on("--test=test_framework", String, "Specify your testing framework (unit (default)/rspec/spec/shoulda/bacon)") {|o| options[:test_framework] = o }
|
85
98
|
opts.on("--views=view_framework", "Specify your view framework (erb (default)/haml/builder)") {|o| options[:view_framework] = o }
|
86
99
|
end
|
87
100
|
|
@@ -93,7 +106,7 @@ EOS
|
|
93
106
|
self.tiny = options[:tiny]
|
94
107
|
self.cap = options[:cap]
|
95
108
|
self.git = options[:git] || `which git`.strip
|
96
|
-
self.git_init = options[:init]
|
109
|
+
self.git_init = options[:init] || false
|
97
110
|
self.test_framework = options[:test_framework] || 'unit'
|
98
111
|
self.view_framework = options[:view_framework] || 'erb'
|
99
112
|
self.install_scripts = options[:scripts] || false
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe '<%= klass_name %>' do
|
4
|
+
|
5
|
+
<%- unless actions.empty? -%>
|
6
|
+
<% actions.each do |meth, path| %>
|
7
|
+
it 'should <%= meth %> <%= path %>' do
|
8
|
+
<%= meth %> '<%= path %>'
|
9
|
+
should.be.ok
|
10
|
+
end
|
11
|
+
|
12
|
+
<%- end -%>
|
13
|
+
<%- else -%>
|
14
|
+
it 'should load the index' do
|
15
|
+
get '/'
|
16
|
+
should.be.ok
|
17
|
+
end
|
18
|
+
<%- end -%>
|
19
|
+
end
|
20
|
+
|
@@ -5,14 +5,14 @@ describe '<%= klass_name %>' do
|
|
5
5
|
<%- unless actions.empty? -%>
|
6
6
|
<% actions.each do |meth, path| %>
|
7
7
|
it 'should <%= meth %> <%= path %>' do
|
8
|
-
<%= meth %>
|
8
|
+
<%= meth %> '<%= path %>'
|
9
9
|
@response.should be_ok
|
10
10
|
end
|
11
11
|
|
12
12
|
<%- end -%>
|
13
13
|
<%- else -%>
|
14
14
|
it 'should load the index' do
|
15
|
-
|
15
|
+
get '/'
|
16
16
|
@response.should be_ok
|
17
17
|
end
|
18
18
|
<%- end -%>
|
@@ -7,7 +7,7 @@ class <%= klass_name -%>Test < Test::Unit::TestCase
|
|
7
7
|
<% actions.each do |meth, path| %>
|
8
8
|
context "<%= meth %> <%= path %>" do
|
9
9
|
setup do
|
10
|
-
<%= meth %>
|
10
|
+
<%= meth %> '<%= path %>'
|
11
11
|
end
|
12
12
|
|
13
13
|
should "respond" do
|
@@ -19,7 +19,7 @@ class <%= klass_name -%>Test < Test::Unit::TestCase
|
|
19
19
|
<%- else -%>
|
20
20
|
context "getting the index" do
|
21
21
|
setup do
|
22
|
-
|
22
|
+
get '/'
|
23
23
|
end
|
24
24
|
|
25
25
|
should "respond" do
|
@@ -5,14 +5,14 @@ describe '<%= klass_name %>' do
|
|
5
5
|
<%- unless actions.empty? -%>
|
6
6
|
<% actions.each do |meth, path| %>
|
7
7
|
it 'should <%= meth %> <%= path %>' do
|
8
|
-
<%= meth %>
|
8
|
+
<%= meth %> '<%= path %>'
|
9
9
|
should.be.ok
|
10
10
|
end
|
11
11
|
|
12
12
|
<%- end -%>
|
13
13
|
<%- else -%>
|
14
14
|
it 'should load the index' do
|
15
|
-
|
15
|
+
get '/'
|
16
16
|
should.be.ok
|
17
17
|
end
|
18
18
|
<%- end -%>
|
@@ -5,13 +5,13 @@ class <%= klass_name -%>Test < Test::Unit::TestCase
|
|
5
5
|
<%- unless actions.empty? -%>
|
6
6
|
<% actions.each do |meth, path| %>
|
7
7
|
def test_<%= meth %>_<%= path.to_s.gsub(/[^a-z0-9\_]/, '') %>_should
|
8
|
-
<%= meth %>
|
8
|
+
<%= meth %> '<%= path %>'
|
9
9
|
end
|
10
10
|
|
11
11
|
<%- end -%>
|
12
12
|
<%- else -%>
|
13
13
|
def test_my_default
|
14
|
-
|
14
|
+
get '/'
|
15
15
|
end
|
16
16
|
<%- end -%>
|
17
17
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
<%- if vendor -%>
|
3
2
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra', 'lib')
|
4
3
|
require 'sinatra'
|
@@ -9,6 +8,8 @@ require 'sinatra'
|
|
9
8
|
<%- when 'rspec' -%>
|
10
9
|
require 'spec'
|
11
10
|
require 'sinatra/test/rspec'
|
11
|
+
<%- when 'bacon' -%>
|
12
|
+
require 'sinatra/test/bacon'
|
12
13
|
<%- when 'spec' -%>
|
13
14
|
require 'sinatra/test/spec'
|
14
15
|
<%- when 'shoulda' -%>
|
@@ -17,4 +18,4 @@ require 'shoulda'
|
|
17
18
|
<%- when 'unit' -%>
|
18
19
|
require 'sinatra/test/unit'
|
19
20
|
<%- end -%>
|
20
|
-
require File.join(File.dirname(__FILE__), '..', '
|
21
|
+
require File.join(File.dirname(__FILE__), '..', '<%= app_name %>.rb')
|
data/lib/sinatra-gen.rb
CHANGED
data/sinatra-gen.gemspec
CHANGED
@@ -1,24 +1,22 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
1
|
Gem::Specification.new do |s|
|
4
2
|
s.name = %q{sinatra-gen}
|
5
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.1"
|
6
4
|
|
7
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
6
|
s.authors = ["Aaron Quint"]
|
9
|
-
s.date = %q{
|
7
|
+
s.date = %q{2009-02-10}
|
10
8
|
s.default_executable = %q{sinatra-gen}
|
11
9
|
s.description = %q{sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework. For more information on sinatra, check out http://sinatra.rubyforge.org}
|
12
10
|
s.email = ["aaron@quirkey.com"]
|
13
11
|
s.executables = ["sinatra-gen"]
|
14
12
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
|
15
|
-
s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "app_generators/sinatra_app/USAGE", "app_generators/sinatra_app/sinatra_app_generator.rb", "app_generators/sinatra_app/templates/Capfile", "app_generators/sinatra_app/templates/Rakefile.erb", "app_generators/sinatra_app/templates/app.rb.erb", "app_generators/sinatra_app/templates/config.ru.erb", "app_generators/sinatra_app/templates/config.yml", "app_generators/sinatra_app/templates/config/deploy.rb.erb", "app_generators/sinatra_app/templates/lib/module.rb.erb", "app_generators/sinatra_app/templates/test/test_app_rspec.rb.erb", "app_generators/sinatra_app/templates/test/test_app_shoulda.rb.erb", "app_generators/sinatra_app/templates/test/test_app_spec.rb.erb", "app_generators/sinatra_app/templates/test/test_app_unit.rb.erb", "app_generators/sinatra_app/templates/test/test_helper.rb.erb", "app_generators/sinatra_app/templates/views/builder_index.erb", "app_generators/sinatra_app/templates/views/erb_index.erb", "app_generators/sinatra_app/templates/views/erb_layout.erb", "app_generators/sinatra_app/templates/views/haml_index.erb", "app_generators/sinatra_app/templates/views/haml_layout.erb", "bin/sinatra-gen", "lib/sinatra-gen.rb", "sinatra-gen.gemspec", "test/test_generator_helper.rb", "test/test_helper.rb", "test/test_sinatra_app_generator.rb"]
|
13
|
+
s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "app_generators/sinatra_app/USAGE", "app_generators/sinatra_app/sinatra_app_generator.rb", "app_generators/sinatra_app/templates/Capfile", "app_generators/sinatra_app/templates/Rakefile.erb", "app_generators/sinatra_app/templates/app.rb.erb", "app_generators/sinatra_app/templates/config.ru.erb", "app_generators/sinatra_app/templates/config.yml", "app_generators/sinatra_app/templates/config/deploy.rb.erb", "app_generators/sinatra_app/templates/lib/module.rb.erb", "app_generators/sinatra_app/templates/test/test_app_bacon.rb.erb", "app_generators/sinatra_app/templates/test/test_app_rspec.rb.erb", "app_generators/sinatra_app/templates/test/test_app_shoulda.rb.erb", "app_generators/sinatra_app/templates/test/test_app_spec.rb.erb", "app_generators/sinatra_app/templates/test/test_app_unit.rb.erb", "app_generators/sinatra_app/templates/test/test_helper.rb.erb", "app_generators/sinatra_app/templates/views/builder_index.erb", "app_generators/sinatra_app/templates/views/erb_index.erb", "app_generators/sinatra_app/templates/views/erb_layout.erb", "app_generators/sinatra_app/templates/views/haml_index.erb", "app_generators/sinatra_app/templates/views/haml_layout.erb", "bin/sinatra-gen", "lib/sinatra-gen.rb", "sinatra-gen.gemspec", "test/test_generator_helper.rb", "test/test_helper.rb", "test/test_sinatra_app_generator.rb"]
|
16
14
|
s.has_rdoc = true
|
17
15
|
s.homepage = %q{http://github.com/quirkey/sinatra-gen}
|
18
16
|
s.post_install_message = %q{PostInstall.txt}
|
19
17
|
s.rdoc_options = ["--main", "README.rdoc"]
|
20
18
|
s.require_paths = ["lib"]
|
21
|
-
s.rubyforge_project = %q{
|
19
|
+
s.rubyforge_project = %q{quirkey}
|
22
20
|
s.rubygems_version = %q{1.3.1}
|
23
21
|
s.summary = %q{sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework}
|
24
22
|
s.test_files = ["test/test_generator_helper.rb", "test/test_helper.rb", "test/test_sinatra_app_generator.rb"]
|
@@ -28,17 +26,17 @@ Gem::Specification.new do |s|
|
|
28
26
|
s.specification_version = 2
|
29
27
|
|
30
28
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
31
|
-
s.add_runtime_dependency(%q<rubigen>, [">= 1.
|
32
|
-
s.add_development_dependency(%q<newgem>, [">= 1.2.
|
29
|
+
s.add_runtime_dependency(%q<rubigen>, [">= 1.5.2"])
|
30
|
+
s.add_development_dependency(%q<newgem>, [">= 1.2.3"])
|
33
31
|
s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
|
34
32
|
else
|
35
|
-
s.add_dependency(%q<rubigen>, [">= 1.
|
36
|
-
s.add_dependency(%q<newgem>, [">= 1.2.
|
33
|
+
s.add_dependency(%q<rubigen>, [">= 1.5.2"])
|
34
|
+
s.add_dependency(%q<newgem>, [">= 1.2.3"])
|
37
35
|
s.add_dependency(%q<hoe>, [">= 1.8.0"])
|
38
36
|
end
|
39
37
|
else
|
40
|
-
s.add_dependency(%q<rubigen>, [">= 1.
|
41
|
-
s.add_dependency(%q<newgem>, [">= 1.2.
|
38
|
+
s.add_dependency(%q<rubigen>, [">= 1.5.2"])
|
39
|
+
s.add_dependency(%q<newgem>, [">= 1.2.3"])
|
42
40
|
s.add_dependency(%q<hoe>, [">= 1.8.0"])
|
43
41
|
end
|
44
42
|
end
|
@@ -30,7 +30,7 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
30
30
|
def test_generate_app_with_tiny_option
|
31
31
|
run_generator('sinatra_app', [APP_ROOT, '--tiny'], sources)
|
32
32
|
assert_generated_file 'config.ru'
|
33
|
-
assert_generated_file
|
33
|
+
assert_generated_file "#{app_name}.rb"
|
34
34
|
assert_generated_file 'Rakefile'
|
35
35
|
end
|
36
36
|
|
@@ -94,11 +94,22 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
94
94
|
assert_match(/def test/, test_contents)
|
95
95
|
end
|
96
96
|
end
|
97
|
+
|
98
|
+
def test_generate_app_with_test_bacon_option
|
99
|
+
run_generator('sinatra_app', [APP_ROOT, '--test=bacon'], sources)
|
100
|
+
assert_basic_paths_and_files
|
101
|
+
assert_generated_file 'test/test_helper.rb' do |helper_contents|
|
102
|
+
assert_match(/sinatra\/test\/bacon/, helper_contents)
|
103
|
+
end
|
104
|
+
assert_generated_file "test/test_#{app_name}.rb" do |test_contents|
|
105
|
+
assert_match(/describe/, test_contents)
|
106
|
+
end
|
107
|
+
end
|
97
108
|
|
98
109
|
def test_generate_app_with_views_haml_option
|
99
110
|
run_generator('sinatra_app', [APP_ROOT, '--views=erb'], sources)
|
100
111
|
assert_basic_paths_and_files
|
101
|
-
assert_generated_file
|
112
|
+
assert_generated_file "#{app_name}.rb" do |app_contents|
|
102
113
|
assert_match(/erb \:index/, app_contents)
|
103
114
|
end
|
104
115
|
assert_generated_file 'views/layout.erb'
|
@@ -108,7 +119,7 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
108
119
|
def test_generate_app_with_views_haml_option
|
109
120
|
run_generator('sinatra_app', [APP_ROOT, '--views=haml'], sources)
|
110
121
|
assert_basic_paths_and_files
|
111
|
-
assert_generated_file
|
122
|
+
assert_generated_file "#{app_name}.rb" do |app_contents|
|
112
123
|
assert_match(/haml \:index/, app_contents)
|
113
124
|
end
|
114
125
|
assert_generated_file 'views/layout.haml'
|
@@ -118,7 +129,7 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
118
129
|
def test_generate_app_with_views_builder_option
|
119
130
|
run_generator('sinatra_app', [APP_ROOT, '--views=builder'], sources)
|
120
131
|
assert_basic_paths_and_files
|
121
|
-
assert_generated_file
|
132
|
+
assert_generated_file "#{app_name}.rb" do |app_contents|
|
122
133
|
assert_match(/builder \:index/, app_contents)
|
123
134
|
end
|
124
135
|
assert_generated_file 'views/index.builder'
|
@@ -135,7 +146,7 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
135
146
|
def test_generate_app_with_actions_and_no_options
|
136
147
|
run_generator('sinatra_app', [APP_ROOT, 'get:/', 'post:/users/:id', 'put:/users/*'], sources)
|
137
148
|
assert_basic_paths_and_files
|
138
|
-
assert_generated_file
|
149
|
+
assert_generated_file "#{app_name}.rb" do |app_contents|
|
139
150
|
assert_match(/get '\/' do/, app_contents)
|
140
151
|
assert_match(/post '\/users\/\:id' do/, app_contents)
|
141
152
|
assert_match(/put '\/users\/\*' do/, app_contents)
|
@@ -145,9 +156,9 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
145
156
|
def test_generate_app_with_actions_and_options
|
146
157
|
run_generator('sinatra_app', [APP_ROOT, 'get:/', 'post:/users/:id', '--tiny', 'put:/users/*'], sources)
|
147
158
|
assert_generated_file 'config.ru'
|
148
|
-
assert_generated_file
|
159
|
+
assert_generated_file "#{app_name}.rb"
|
149
160
|
assert_generated_file 'Rakefile'
|
150
|
-
assert_generated_file
|
161
|
+
assert_generated_file "#{app_name}.rb" do |app_contents|
|
151
162
|
assert_match(/get '\/' do/, app_contents)
|
152
163
|
assert_match(/post '\/users\/\:id' do/, app_contents)
|
153
164
|
assert_match(/put '\/users\/\*' do/, app_contents)
|
@@ -161,7 +172,7 @@ class TestSinatraAppGenerator < Test::Unit::TestCase
|
|
161
172
|
assert_directory_exists 'public'
|
162
173
|
assert_directory_exists 'views'
|
163
174
|
assert_generated_file 'config.ru'
|
164
|
-
assert_generated_file
|
175
|
+
assert_generated_file "#{app_name}.rb"
|
165
176
|
assert_generated_file 'Rakefile'
|
166
177
|
assert_generated_file 'config.yml'
|
167
178
|
assert_generated_module "lib/#{app_name}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Quint
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-10 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
23
|
+
version: 1.5.2
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: newgem
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.2.
|
33
|
+
version: 1.2.3
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: hoe
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 1.8.0
|
44
44
|
version:
|
45
|
-
description: sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework. For more information on sinatra, check out http://
|
45
|
+
description: sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework. For more information on sinatra, check out http://sinatrarb.com !! NOW WITH SUPPORT FOR SINATRA 0.9 (02/10/09)
|
46
46
|
email:
|
47
47
|
- aaron@quirkey.com
|
48
48
|
executables:
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- app_generators/sinatra_app/templates/config.yml
|
70
70
|
- app_generators/sinatra_app/templates/config/deploy.rb.erb
|
71
71
|
- app_generators/sinatra_app/templates/lib/module.rb.erb
|
72
|
+
- app_generators/sinatra_app/templates/test/test_app_bacon.rb.erb
|
72
73
|
- app_generators/sinatra_app/templates/test/test_app_rspec.rb.erb
|
73
74
|
- app_generators/sinatra_app/templates/test/test_app_shoulda.rb.erb
|
74
75
|
- app_generators/sinatra_app/templates/test/test_app_spec.rb.erb
|