padrino-gen 0.9.7 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
- require 'sdoc'
4
3
 
5
4
  GEM_VERSION = File.read(File.dirname(__FILE__) + '/VERSION')
6
5
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.7
1
+ 0.9.9
@@ -14,7 +14,7 @@ module Padrino
14
14
  include Thor::Actions
15
15
  include Padrino::Generators::Actions
16
16
 
17
- desc "Description:\n\n\tpadrino-gen project generate a new Padrino application"
17
+ desc "Description:\n\n\tpadrino-gen app generates a new Padrino application"
18
18
 
19
19
  argument :name, :desc => "The name of your padrino application"
20
20
 
@@ -36,9 +36,9 @@ module Padrino
36
36
  say (<<-TEXT).gsub(/ {10}/,'')
37
37
 
38
38
  =================================================================
39
- Your #{@class_name} Application now is installed.
40
- It's available on /#{name.underscore}
41
- You can setup a new path editing config/apps.rb
39
+ Your #{@class_name} application has been installed.
40
+ This application has been mounted to /#{name.underscore}
41
+ You can configure a different path by editing 'config/apps.rb'
42
42
  =================================================================
43
43
 
44
44
  TEXT
@@ -6,24 +6,22 @@ module Padrino
6
6
  module BaconGen
7
7
  BACON_SETUP = (<<-TEST).gsub(/^ {10}/, '')
8
8
  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
9
- require File.dirname(__FILE__) + "/../config/boot"
9
+ require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
10
10
 
11
11
  class Bacon::Context
12
12
  include Rack::Test::Methods
13
13
  end
14
14
 
15
15
  def app
16
- # Sinatra < 1.0 always disable sessions for test env
17
- # so if you need them it's necessary force the use
18
- # of Rack::Session::Cookie
19
- CLASS_NAME.tap { |app| app.use Rack::Session::Cookie }
16
+ ##
20
17
  # You can hanlde all padrino applications using instead:
21
18
  # Padrino.application
19
+ CLASS_NAME.tap { |app| }
22
20
  end
23
21
  TEST
24
22
 
25
23
  BACON_CONTROLLER_TEST = (<<-TEST).gsub(/^ {10}/, '')
26
- require File.dirname(__FILE__) + '/../test_config.rb'
24
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
27
25
 
28
26
  describe "!NAME!Controller" do
29
27
  it 'returns text at root' do
@@ -43,7 +41,7 @@ module Padrino
43
41
  TEST
44
42
 
45
43
  BACON_MODEL_TEST = (<<-TEST).gsub(/^ {10}/, '')
46
- require File.dirname(__FILE__) + '/../test_config.rb'
44
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
47
45
 
48
46
  describe "!NAME! Model" do
49
47
  it 'can be created' do
@@ -10,17 +10,15 @@ module Padrino
10
10
 
11
11
  CUCUMBER_SETUP = (<<-TEST).gsub(/^ {10}/, '')
12
12
  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
13
- require File.dirname(__FILE__) + "/../../config/boot"
13
+ require File.expand_path(File.dirname(__FILE__) + "/../../config/boot")
14
14
 
15
15
  require 'capybara/cucumber'
16
16
  require 'spec/expectations'
17
17
 
18
- # Sinatra < 1.0 always disable sessions for test env
19
- # so if you need them it's necessary to force the use
20
- # of Rack::Session::Cookie
21
- Capybara.app = CLASS_NAME.tap { |app| app.use Rack::Session::Cookie }
22
- # You can handle all padrino applications instead using:
23
- # Capybara.app = Padrino.application
18
+ ##
19
+ # You can hanlde all padrino applications using instead:
20
+ # Padrino.application
21
+ Capybara.app = CLASS_NAME.tap { |app| }
24
22
  TEST
25
23
 
26
24
  CUCUMBER_YML = (<<-TEST).gsub(/^ {10}/, '')
@@ -6,24 +6,22 @@ module Padrino
6
6
  module RiotGen
7
7
  RIOT_SETUP = (<<-TEST).gsub(/^ {10}/, '')
8
8
  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
9
- require File.dirname(__FILE__) + "/../config/boot"
9
+ require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
10
10
 
11
11
  class Riot::Situation
12
12
  include Rack::Test::Methods
13
13
 
14
14
  def app
15
- # Sinatra < 1.0 always disable sessions for test env
16
- # so if you need them it's necessary force the use
17
- # of Rack::Session::Cookie
18
- CLASS_NAME.tap { |app| app.use Rack::Session::Cookie }
15
+ ##
19
16
  # You can hanlde all padrino applications using instead:
20
17
  # Padrino.application
18
+ CLASS_NAME.tap { |app| }
21
19
  end
22
20
  end
23
21
  TEST
24
22
 
25
23
  RIOT_CONTROLLER_TEST = (<<-TEST).gsub(/^ {10}/, '')
26
- require File.dirname(__FILE__) + '/../test_config.rb'
24
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
27
25
 
28
26
  context "!NAME!Controller" do
29
27
  context "description here" do
@@ -46,7 +44,7 @@ module Padrino
46
44
  TEST
47
45
 
48
46
  RIOT_MODEL_TEST = (<<-TEST).gsub(/^ {10}/, '')
49
- require File.dirname(__FILE__) + '/../test_config.rb'
47
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
50
48
 
51
49
  context "!NAME! Model" do
52
50
  context 'can be created' do
@@ -7,26 +7,24 @@ module Padrino
7
7
  unless defined?(RSPEC_SETUP)
8
8
  RSPEC_SETUP = (<<-TEST).gsub(/^ {12}/, '')
9
9
  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
10
- require File.dirname(__FILE__) + "/../config/boot"
10
+ require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
11
11
 
12
12
  Spec::Runner.configure do |conf|
13
13
  conf.include Rack::Test::Methods
14
14
  end
15
15
 
16
16
  def app
17
- # Sinatra < 1.0 always disable sessions for test env
18
- # so if you need them it's necessary force the use
19
- # of Rack::Session::Cookie
20
- CLASS_NAME.tap { |app| app.use Rack::Session::Cookie }
17
+ ##
21
18
  # You can hanlde all padrino applications using instead:
22
19
  # Padrino.application
20
+ CLASS_NAME.tap { |app| }
23
21
  end
24
22
  TEST
25
23
  end
26
24
 
27
25
  unless defined?(RSPEC_CONTROLLER_TEST)
28
26
  RSPEC_CONTROLLER_TEST = (<<-TEST).gsub(/^ {12}/, '')
29
- require File.dirname(__FILE__) + '/../spec_helper.rb'
27
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
30
28
 
31
29
  describe "!NAME!Controller" do
32
30
  before do
@@ -53,7 +51,7 @@ module Padrino
53
51
 
54
52
  unless defined?(RSPEC_MODEL_TEST)
55
53
  RSPEC_MODEL_TEST = (<<-TEST).gsub(/^ {12}/, '')
56
- require File.dirname(__FILE__) + '/../spec_helper.rb'
54
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
57
55
 
58
56
  describe "!NAME! Model" do
59
57
  it 'can be created' do
@@ -6,24 +6,22 @@ module Padrino
6
6
  module ShouldaGen
7
7
  SHOULDA_SETUP = (<<-TEST).gsub(/^ {10}/, '')
8
8
  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
9
- require File.dirname(__FILE__) + "/../config/boot"
9
+ require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
10
10
 
11
11
  class Test::Unit::TestCase
12
12
  include Rack::Test::Methods
13
13
 
14
14
  def app
15
- # Sinatra < 1.0 always disable sessions for test env
16
- # so if you need them it's necessary force the use
17
- # of Rack::Session::Cookie
18
- CLASS_NAME.tap { |app| app.use Rack::Session::Cookie }
15
+ ##
19
16
  # You can hanlde all padrino applications using instead:
20
17
  # Padrino.application
18
+ CLASS_NAME.tap { |app| }
21
19
  end
22
20
  end
23
21
  TEST
24
22
 
25
23
  SHOULDA_CONTROLLER_TEST = (<<-TEST).gsub(/^ {10}/, '')
26
- require File.dirname(__FILE__) + '/../test_config.rb'
24
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
27
25
 
28
26
  class !NAME!ControllerTest < Test::Unit::TestCase
29
27
  context "!NAME!Controller" do
@@ -48,7 +46,7 @@ module Padrino
48
46
  TEST
49
47
 
50
48
  SHOULDA_MODEL_TEST = (<<-TEST).gsub(/^ {10}/, '')
51
- require File.dirname(__FILE__) + '/../test_config.rb'
49
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
52
50
 
53
51
  class !NAME!ControllerTest < Test::Unit::TestCase
54
52
  context "!NAME! Model" do
@@ -6,24 +6,22 @@ module Padrino
6
6
  module TestspecGen
7
7
  TESTSPEC_SETUP = (<<-TEST).gsub(/^ {10}/, '')
8
8
  PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
9
- require File.dirname(__FILE__) + "/../config/boot"
9
+ require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
10
10
 
11
11
  class Test::Unit::TestCase
12
12
  include Rack::Test::Methods
13
13
 
14
14
  def app
15
- # Sinatra < 1.0 always disable sessions for test env
16
- # so if you need them it's necessary force the use
17
- # of Rack::Session::Cookie
18
- CLASS_NAME.tap { |app| app.use Rack::Session::Cookie }
15
+ ##
19
16
  # You can hanlde all padrino applications using instead:
20
17
  # Padrino.application
18
+ CLASS_NAME.tap { |app| }
21
19
  end
22
20
  end
23
21
  TEST
24
22
 
25
23
  TESTSPEC_CONTROLLER_TEST = (<<-TEST).gsub(/^ {10}/, '')
26
- require File.dirname(__FILE__) + '/../test_config.rb'
24
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
27
25
 
28
26
  context "!NAME!Controller" do
29
27
  setup { get('/') }
@@ -43,7 +41,7 @@ module Padrino
43
41
  TEST
44
42
 
45
43
  TESTSPEC_MODEL_TEST = (<<-TEST).gsub(/^ {10}/, '')
46
- require File.dirname(__FILE__) + '/../test_config.rb'
44
+ require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
47
45
 
48
46
  context "!NAME! Model" do
49
47
  specify 'can be created' do
@@ -1,2 +1,2 @@
1
- require File.dirname(__FILE__) + '/config/boot.rb'
1
+ require ::File.dirname(__FILE__) + '/config/boot.rb'
2
2
  run Padrino.application
@@ -8,7 +8,7 @@ module Padrino
8
8
  Padrino::Generators.add_generator(:project, self)
9
9
 
10
10
  # Define the source template root
11
- def self.source_root; File.dirname(__FILE__); end
11
+ def self.source_root; File.expand_path(File.dirname(__FILE__)); end
12
12
  def self.banner; "padrino-gen project [name] [options]"; end
13
13
 
14
14
  # Include related modules
@@ -66,7 +66,7 @@ module Padrino
66
66
  say (<<-TEXT).gsub(/ {8}/,'')
67
67
 
68
68
  =================================================================
69
- #{name} has been successfully created, now follow this steps:
69
+ #{name} is ready for development! Next, follow these steps:
70
70
  =================================================================
71
71
  1) cd #{name}
72
72
  2) bundle install
data/padrino-gen.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{padrino-gen}
8
- s.version = "0.9.7"
8
+ s.version = "0.9.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
12
- s.date = %q{2010-03-22}
12
+ s.date = %q{2010-03-29}
13
13
  s.default_executable = %q{padrino-gen}
14
14
  s.description = %q{Generators for easily creating and building padrino applications from the console}
15
15
  s.email = %q{padrinorb@gmail.com}
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
32
32
  "lib/padrino-gen/generators/app/controllers/.empty_directory",
33
33
  "lib/padrino-gen/generators/app/helpers/.empty_directory",
34
34
  "lib/padrino-gen/generators/app/views/.empty_directory",
35
+ "lib/padrino-gen/generators/app/views/layouts/.emptydirectory",
35
36
  "lib/padrino-gen/generators/cli.rb",
36
37
  "lib/padrino-gen/generators/components/actions.rb",
37
38
  "lib/padrino-gen/generators/components/mocks/mocha_gen.rb",
@@ -107,7 +108,7 @@ Gem::Specification.new do |s|
107
108
  s.specification_version = 3
108
109
 
109
110
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
110
- s.add_runtime_dependency(%q<padrino-core>, ["= 0.9.7"])
111
+ s.add_runtime_dependency(%q<padrino-core>, ["= 0.9.9"])
111
112
  s.add_development_dependency(%q<haml>, [">= 2.2.1"])
112
113
  s.add_development_dependency(%q<shoulda>, [">= 2.10.3"])
113
114
  s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
@@ -115,7 +116,7 @@ Gem::Specification.new do |s|
115
116
  s.add_development_dependency(%q<webrat>, [">= 0.5.1"])
116
117
  s.add_development_dependency(%q<fakeweb>, [">= 1.2.3"])
117
118
  else
118
- s.add_dependency(%q<padrino-core>, ["= 0.9.7"])
119
+ s.add_dependency(%q<padrino-core>, ["= 0.9.9"])
119
120
  s.add_dependency(%q<haml>, [">= 2.2.1"])
120
121
  s.add_dependency(%q<shoulda>, [">= 2.10.3"])
121
122
  s.add_dependency(%q<mocha>, [">= 0.9.7"])
@@ -124,7 +125,7 @@ Gem::Specification.new do |s|
124
125
  s.add_dependency(%q<fakeweb>, [">= 1.2.3"])
125
126
  end
126
127
  else
127
- s.add_dependency(%q<padrino-core>, ["= 0.9.7"])
128
+ s.add_dependency(%q<padrino-core>, ["= 0.9.9"])
128
129
  s.add_dependency(%q<haml>, [">= 2.2.1"])
129
130
  s.add_dependency(%q<shoulda>, [">= 2.10.3"])
130
131
  s.add_dependency(%q<mocha>, [">= 0.9.7"])
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'thor/group'
3
3
  require 'fakeweb'
4
4
 
@@ -28,6 +28,7 @@ class TestAppGenerator < Test::Unit::TestCase
28
28
  assert_file_exists('/tmp/sample_project/demo/controllers')
29
29
  assert_file_exists('/tmp/sample_project/demo/helpers')
30
30
  assert_file_exists('/tmp/sample_project/demo/views')
31
+ assert_file_exists('/tmp/sample_project/demo/views/layouts')
31
32
  assert_match_in_file 'Padrino.mount("Demo").to("/demo")', '/tmp/sample_project/config/apps.rb'
32
33
  assert_match_in_file 'class Demo < Padrino::Application', '/tmp/sample_project/demo/app.rb'
33
34
  end
data/test/test_cli.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'padrino-gen/generators/cli'
3
3
 
4
4
  class TestCli < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'thor/group'
3
3
 
4
4
  class TestControllerGenerator < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
 
3
3
  class TestGenerator < Test::Unit::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'thor/group'
3
3
 
4
4
  class TestMailerGenerator < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'thor/group'
3
3
 
4
4
  class TestMigrationGenerator < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'thor/group'
3
3
 
4
4
  class TestModelGenerator < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
2
  require 'thor/group'
3
3
  require 'fakeweb'
4
4
 
@@ -81,7 +81,6 @@ class TestProjectGenerator < Test::Unit::TestCase
81
81
  buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--mock=rr', '--test=riot', '--script=none']) }
82
82
  assert_match /Applying.*?rr.*?mock/, buffer
83
83
  assert_match_in_file(/gem 'rr'/, '/tmp/sample_project/Gemfile')
84
- assert_match_in_file(/require 'riot\/rr'/m, '/tmp/sample_project/test/test_config.rb')
85
84
  end
86
85
 
87
86
  should "properly generater for rr and bacon" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 7
9
- version: 0.9.7
8
+ - 9
9
+ version: 0.9.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Padrino Team
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-22 00:00:00 -07:00
20
+ date: 2010-03-29 00:00:00 -07:00
21
21
  default_executable: padrino-gen
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -30,8 +30,8 @@ dependencies:
30
30
  segments:
31
31
  - 0
32
32
  - 9
33
- - 7
34
- version: 0.9.7
33
+ - 9
34
+ version: 0.9.9
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -141,6 +141,7 @@ files:
141
141
  - lib/padrino-gen/generators/app/controllers/.empty_directory
142
142
  - lib/padrino-gen/generators/app/helpers/.empty_directory
143
143
  - lib/padrino-gen/generators/app/views/.empty_directory
144
+ - lib/padrino-gen/generators/app/views/layouts/.emptydirectory
144
145
  - lib/padrino-gen/generators/cli.rb
145
146
  - lib/padrino-gen/generators/components/actions.rb
146
147
  - lib/padrino-gen/generators/components/mocks/mocha_gen.rb