padrino-gen 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -60,7 +60,7 @@ module Padrino
60
60
  # Also builds the available_choices hash of which component choices are supported
61
61
  # component_option :test, "Testing framework", :aliases => '-t', :choices => [:bacon, :shoulda]
62
62
  def component_option(name, caption, options = {})
63
- (@component_types ||= []) << name
63
+ (@component_types ||= []) << name # TODO use ordered hash and combine with choices below
64
64
  (@available_choices ||= Hash.new({}))[name] = options[:choices]
65
65
  description = "The #{caption} component (#{options[:choices].join(', ')})"
66
66
  class_option name, :default => options[:choices].first, :aliases => options[:aliases], :desc => description
File without changes
@@ -1,11 +1,9 @@
1
1
  clear_sources
2
2
  source 'http://gemcutter.org'
3
- # Base requirements
3
+ # Project requirements
4
4
  gem 'sinatra'
5
5
  gem 'padrino'
6
6
  gem 'rack-flash'
7
- gem 'warden'
8
- gem 'bcrypt-ruby', :require_as => 'bcrypt'
9
7
 
10
8
  # Component requirements
11
9
 
File without changes
@@ -0,0 +1,6 @@
1
+ # This file is merely for beginning the boot process
2
+ PADRINO_ROOT = File.dirname(__FILE__) + '/..' unless defined? PADRINO_ROOT
3
+
4
+ # Loads the required files into the application
5
+ require 'padrino'
6
+ Padrino.load!
@@ -0,0 +1,6 @@
1
+ RACK_ENV = ENV["RACK_ENV"] ||= "development" unless defined? RACK_ENV
2
+ require File.dirname(__FILE__) + '/config/boot.rb'
3
+
4
+ # Mount and run padrino applications
5
+ Padrino.mount("core").to("/")
6
+ run Padrino.application
File without changes
File without changes
@@ -29,7 +29,7 @@ module Padrino
29
29
  def setup_skeleton
30
30
  self.destination_root = File.join(path, name)
31
31
  @class_name = name.classify
32
- directory("base_app/", self.destination_root)
32
+ directory("project/", self.destination_root)
33
33
  store_component_config('.components')
34
34
  end
35
35
 
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.1.0"
8
+ s.version = "0.1.1"
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{2009-11-16}
12
+ s.date = %q{2009-11-17}
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{nesquena@gmail.com}
@@ -23,14 +23,12 @@ Gem::Specification.new do |s|
23
23
  ".gitignore",
24
24
  "LICENSE",
25
25
  "README.rdoc",
26
+ "README.rdoc",
27
+ "Rakefile",
26
28
  "Rakefile",
27
29
  "VERSION",
28
30
  "bin/padrino-gen",
29
31
  "lib/generators/actions.rb",
30
- "lib/generators/base_app/.gitignore",
31
- "lib/generators/base_app/Gemfile",
32
- "lib/generators/base_app/config/dependencies.rb.tt",
33
- "lib/generators/base_app/test/test_config.rb.tt",
34
32
  "lib/generators/components/actions.rb",
35
33
  "lib/generators/components/mocks/mocha_gen.rb",
36
34
  "lib/generators/components/mocks/rr_gen.rb",
@@ -49,6 +47,14 @@ Gem::Specification.new do |s|
49
47
  "lib/generators/components/tests/rspec_test_gen.rb",
50
48
  "lib/generators/components/tests/shoulda_test_gen.rb",
51
49
  "lib/generators/components/tests/testspec_test_gen.rb",
50
+ "lib/generators/project/.gitignore",
51
+ "lib/generators/project/Gemfile",
52
+ "lib/generators/project/apps/.empty_directory",
53
+ "lib/generators/project/config.ru",
54
+ "lib/generators/project/config/boot.rb",
55
+ "lib/generators/project/lib/.empty_directory",
56
+ "lib/generators/project/test/test_config.rb.tt",
57
+ "lib/generators/project/tmp/.emptydirectory",
52
58
  "lib/generators/skeleton.rb",
53
59
  "lib/padrino-gen.rb",
54
60
  "padrino-gen.gemspec",
@@ -61,11 +67,6 @@ Gem::Specification.new do |s|
61
67
  s.require_paths = ["lib"]
62
68
  s.rubygems_version = %q{1.3.5}
63
69
  s.summary = %q{Generators for easily creating and building padrino applications}
64
- s.test_files = [
65
- "test/active_support_helpers.rb",
66
- "test/helper.rb",
67
- "test/test_skeleton_generator.rb"
68
- ]
69
70
 
70
71
  if s.respond_to? :specification_version then
71
72
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
data/test/helper.rb CHANGED
@@ -8,7 +8,8 @@ require 'webrat'
8
8
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
9
9
  $LOAD_PATH.unshift(File.dirname(__FILE__))
10
10
  require 'active_support_helpers'
11
- require File.dirname(__FILE__) + '/../../padrino-helpers/lib/padrino-helpers.rb'
11
+ require 'padrino-helpers'
12
+ require 'padrino-gen'
12
13
 
13
14
  class Test::Unit::TestCase
14
15
  include Padrino::Helpers::OutputHelpers
@@ -1,5 +1,4 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
- require File.dirname(__FILE__) + "/../lib/padrino-gen"
3
2
  require 'thor'
4
3
 
5
4
  class TestSkeletonGenerator < Test::Unit::TestCase
@@ -11,7 +10,8 @@ class TestSkeletonGenerator < Test::Unit::TestCase
11
10
  should "allow simple generator to run and create base_app with no options" do
12
11
  assert_nothing_raised { silence_logger { Padrino::Generators::Skeleton.start(['sample_app', '/tmp', '--script=none']) } }
13
12
  assert File.exist?('/tmp/sample_app')
14
- assert File.exist?('/tmp/sample_app/config/dependencies.rb')
13
+ assert File.exist?('/tmp/sample_app/apps')
14
+ assert File.exist?('/tmp/sample_app/config/boot.rb')
15
15
  assert File.exist?('/tmp/sample_app/test/test_config.rb')
16
16
  end
17
17
  should "create components file containing options chosen with defaults" do
@@ -83,8 +83,6 @@ class TestSkeletonGenerator < Test::Unit::TestCase
83
83
  assert_match_in_file(/gem 'activerecord'/, '/tmp/sample_app/Gemfile')
84
84
  assert_match_in_file(/ActiveRecordInitializer/, '/tmp/sample_app/config/initializers/active_record.rb')
85
85
  assert_match_in_file(/Migrate the database/, '/tmp/sample_app/Rakefile')
86
- # assert_match_in_file(/CreateUsers < ActiveRecord::Migration/, '/tmp/sample_app/db/migrate/001_create_users.rb')
87
- # assert_match_in_file(/class User < ActiveRecord::Base/, '/tmp/sample_app/app/models/user.rb')
88
86
  end
89
87
 
90
88
  should "properly generate default for datamapper" do
@@ -92,7 +90,6 @@ class TestSkeletonGenerator < Test::Unit::TestCase
92
90
  assert_match /Applying.*?datamapper.*?orm/, buffer
93
91
  assert_match_in_file(/gem 'dm-core'/, '/tmp/sample_app/Gemfile')
94
92
  assert_match_in_file(/DataMapperInitializer/, '/tmp/sample_app/config/initializers/data_mapper.rb')
95
- # assert_match_in_file(/class User.*?include DataMapper::Resource/m, '/tmp/sample_app/app/models/user.rb')
96
93
  end
97
94
 
98
95
  should "properly generate for mongomapper" do
@@ -100,15 +97,13 @@ class TestSkeletonGenerator < Test::Unit::TestCase
100
97
  assert_match /Applying.*?mongomapper.*?orm/, buffer
101
98
  assert_match_in_file(/gem 'mongo_mapper'/, '/tmp/sample_app/Gemfile')
102
99
  assert_match_in_file(/MongoDbInitializer/, '/tmp/sample_app/config/initializers/mongo_db.rb')
103
- # assert_match_in_file(/class User.*?include MongoMapper::Document/m, '/tmp/sample_app/app/models/user.rb')
104
100
  end
105
101
 
106
102
  should "properly generate for couchrest" do
107
103
  buffer = silence_logger { Padrino::Generators::Skeleton.start(['sample_app', '/tmp', '--orm=couchrest', '--script=none']) }
108
104
  assert_match /Applying.*?couchrest.*?orm/, buffer
109
105
  assert_match_in_file(/gem 'couchrest'/, '/tmp/sample_app/Gemfile')
110
- assert_match_in_file(/CouchRestInitializer/, '/tmp/sample_app/config/initializers/couch_rest.rb')
111
- # assert_match_in_file(/class User < CouchRest::ExtendedDocument/m, '/tmp/sample_app/app/models/user.rb')
106
+ assert_match_in_file(/CouchRestInitializer/, '/tmp/sample_app/config/initializers/couch_rest.rb')
112
107
  end
113
108
  end
114
109
 
@@ -123,8 +118,6 @@ class TestSkeletonGenerator < Test::Unit::TestCase
123
118
  buffer = silence_logger { Padrino::Generators::Skeleton.start(['sample_app', '/tmp', '--renderer=haml','--script=none']) }
124
119
  assert_match /Applying.*?haml.*?renderer/, buffer
125
120
  assert_match_in_file(/gem 'haml'/, '/tmp/sample_app/Gemfile')
126
- # assert_match_in_file(/gem 'hassle'/, '/tmp/sample_app/Gemfile')
127
- # assert_match_in_file(/HassleInitializer/, '/tmp/sample_app/config/initializers/hassle.rb')
128
121
  end
129
122
  end
130
123
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-11-16 00:00:00 -08:00
15
+ date: 2009-11-17 00:00:00 -08:00
16
16
  default_executable: padrino-gen
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -113,10 +113,6 @@ files:
113
113
  - VERSION
114
114
  - bin/padrino-gen
115
115
  - lib/generators/actions.rb
116
- - lib/generators/base_app/.gitignore
117
- - lib/generators/base_app/Gemfile
118
- - lib/generators/base_app/config/dependencies.rb.tt
119
- - lib/generators/base_app/test/test_config.rb.tt
120
116
  - lib/generators/components/actions.rb
121
117
  - lib/generators/components/mocks/mocha_gen.rb
122
118
  - lib/generators/components/mocks/rr_gen.rb
@@ -135,6 +131,14 @@ files:
135
131
  - lib/generators/components/tests/rspec_test_gen.rb
136
132
  - lib/generators/components/tests/shoulda_test_gen.rb
137
133
  - lib/generators/components/tests/testspec_test_gen.rb
134
+ - lib/generators/project/.gitignore
135
+ - lib/generators/project/Gemfile
136
+ - lib/generators/project/apps/.empty_directory
137
+ - lib/generators/project/config.ru
138
+ - lib/generators/project/config/boot.rb
139
+ - lib/generators/project/lib/.empty_directory
140
+ - lib/generators/project/test/test_config.rb.tt
141
+ - lib/generators/project/tmp/.emptydirectory
138
142
  - lib/generators/skeleton.rb
139
143
  - lib/padrino-gen.rb
140
144
  - padrino-gen.gemspec
@@ -169,7 +173,5 @@ rubygems_version: 1.3.5
169
173
  signing_key:
170
174
  specification_version: 3
171
175
  summary: Generators for easily creating and building padrino applications
172
- test_files:
173
- - test/active_support_helpers.rb
174
- - test/helper.rb
175
- - test/test_skeleton_generator.rb
176
+ test_files: []
177
+
@@ -1,41 +0,0 @@
1
- # Dependencies contains all required gems, helpers and core configuration
2
-
3
- def app(&block)
4
- <%= @class_name %>.class_eval(&block)
5
- end
6
-
7
- class <%= @class_name %> < Sinatra::Application
8
- bundler_require_dependencies
9
-
10
- # Required middleware
11
- use Rack::Session::Cookie
12
- use Rack::Flash
13
-
14
- # Includes all necessary sinatra_more helpers
15
- register SinatraMore::MarkupPlugin
16
- register SinatraMore::RenderPlugin
17
- register SinatraMore::MailerPlugin
18
- register SinatraMore::RoutingPlugin
19
-
20
- # Requires the initializer modules which configure specific components
21
- Dir[File.dirname(__FILE__) + '/initializers/*.rb'].each do |file|
22
- # Each initializer file contains a module called 'XxxxInitializer' (i.e HassleInitializer)
23
- require file
24
- file_class = File.basename(file, '.rb').classify
25
- register "#{file_class}Initializer".constantize
26
- end
27
-
28
- # Returns the list of load paths for this sinatra application
29
- def self.file_loading_paths
30
- ["lib/**/*.rb", "app/helpers/**/*.rb", "app/routes/**/*.rb", "app/models/*.rb", "app/mailers/*.rb"]
31
- end
32
-
33
- # Require all the folders and files necessary to run the application
34
- file_loading_paths.each { |load_path| Dir[root_path(load_path)].each { |file| require file } }
35
-
36
- # Require Warden plugin below to allow User to be loaded
37
- register SinatraMore::WardenPlugin
38
-
39
- # Required helpers
40
- helpers ViewHelpers
41
- end