padrino-gen 0.7.0 → 0.7.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.7.0
1
+ 0.7.1
@@ -1,12 +1,38 @@
1
1
  class <%= @class_name %> < Padrino::Application
2
2
  configure do
3
+ ##
3
4
  # Application-specific configuration options
4
- # set :sessions, false # Enabled by default
5
- # set :log_to_file, true # Log to file instead of stdout (default is stdout in development)
6
- # set :reload, false # Reload application files (default in development)
7
- # set :locale, :it # Set the current locale (default is :en)
8
- # disable :padrino_helpers # Disables padrino markup helpers (enabled by default)
9
- # disable :flash # Disables rack-flash (enabled by default)
10
- # enable :auto_locale # Enable auto localization inspecting "/:locale/your/path" or browser languages
5
+ #
6
+ # set :raise_errors, true # Show exceptions (default for development)
7
+ # set :public, "foo/bar" # Location for static assets (default root/public)
8
+ # set :sessions, false # Enabled by default
9
+ # set :reload, false # Reload application files (default in development)
10
+ # set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
11
+ # set :locale, :en # Set the current I18n.locale (default :en)
12
+ # set :translations, "bar" # Set path for I18n translations (default your_app/locales)
13
+ # enable :autolocale # Auto Set locale if url match /:lang/foo/bar (disabled by default)
14
+ # disable :padrino_helpers # Disables padrino markup helpers (enabled by default if present)
15
+ # disable :padrino_mailer # Disables padrino mailer (enabled by default if present)
16
+ # disable :flash # Disables rack-flash (enabled by default)
17
+ # enable :authentication # Enable padrino-admin authentication (disabled by default)
18
+ # layout :foo # Layout can be in views/layouts/foo.ext or views/foo.ext (:application is default)
19
+ #
11
20
  end
21
+
22
+ ##
23
+ # You can configure for a specified environment like:
24
+ #
25
+ # configure :development do
26
+ # set :foo, :bar
27
+ # end
28
+ #
29
+
30
+ ##
31
+ # You can manage errors like:
32
+ #
33
+ # errors 404 do
34
+ # render 'errors/404'
35
+ # end
36
+ #
37
+
12
38
  end
@@ -1,9 +1,27 @@
1
+ ##
1
2
  # Initializers can be used to configure information about your padrino app
2
3
  # The following format is used because initializers are applied as plugins into the application
3
-
4
+ #
4
5
  module ExampleInitializer
5
6
  def self.registered(app)
6
- # Manipulate 'app' here to register components or adjust configuration
7
- # app.set :example, "foo"
7
+ ##
8
+ # Simple Redmine Issue
9
+ #
10
+ # app.error 500 do
11
+ # # Delivery error to our server
12
+ # boom = env['sinatra.error']
13
+ # body = ["#{boom.class} - #{boom.message}:", *boom.backtrace].join("\n ")
14
+ # redmine = ["project: foo", "tracker: Bug", "priority: high"].join("\n")
15
+ # logger.error body
16
+ # Padrino::Mailer::MailObject.new(
17
+ # :subject => "[PROJECT] #{boom.class} - #{boom.message}",
18
+ # :to => "exceptions@foo.com",
19
+ # :from => "help@foo.com",
20
+ # :body => [body, redmine].join("\n\n")
21
+ # ).deliver
22
+ # response.status = 500
23
+ # content_type 'text/html', :charset => "utf-8"
24
+ # render "errors"
25
+ # end
8
26
  end
9
27
  end
@@ -1,3 +1,3 @@
1
- RACK_ENV = ENV["RACK_ENV"] ||= "development" unless defined? RACK_ENV
1
+ PADRINO_ENV = ENV["PADRINO_ENV"] ||= ENV["RACK_ENV"] ||= "development" unless defined?(PADRINO_ENV)
2
2
  require File.dirname(__FILE__) + '/config/boot.rb'
3
3
  run Padrino.application
@@ -5,8 +5,8 @@ module Padrino
5
5
 
6
6
  module JqueryGen
7
7
  def setup_script
8
- copy_file('templates/scripts/jquery.js', destination_root("/app/public/javascripts/jquery.js"))
9
- create_file(destination_root('/app/public/javascripts/application.js'), "// Put your application scripts here")
8
+ copy_file('templates/scripts/jquery.js', destination_root("/public/javascripts/jquery.js"))
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
10
  end
11
11
  end
12
12
 
@@ -5,9 +5,9 @@ module Padrino
5
5
 
6
6
  module PrototypeGen
7
7
  def setup_script
8
- copy_file('templates/scripts/protopak.js', destination_root("/app/public/javascripts/protopak.js"))
9
- copy_file('templates/scripts/lowpro.js', destination_root("/app/public/javascripts/lowpro.js"))
10
- create_file(destination_root('/app/public/javascripts/application.js'), "// Put your application scripts here")
8
+ copy_file('templates/scripts/protopak.js', destination_root("/public/javascripts/protopak.js"))
9
+ copy_file('templates/scripts/lowpro.js', destination_root("/public/javascripts/lowpro.js"))
10
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
11
11
  end
12
12
  end
13
13
 
@@ -5,8 +5,8 @@ module Padrino
5
5
 
6
6
  module RightjsGen
7
7
  def setup_script
8
- copy_file('templates/scripts/right.js', destination_root("/app/public/javascripts/right.js"))
9
- create_file(destination_root('/app/public/javascripts/application.js'), "// Put your application scripts here")
8
+ copy_file('templates/scripts/right.js', destination_root("/public/javascripts/right.js"))
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
10
  end
11
11
  end
12
12
  end
data/lib/padrino-gen.rb CHANGED
@@ -1,8 +1,4 @@
1
1
  require 'padrino-core/support_lite'
2
2
  require 'padrino-gen/generators'
3
-
4
- ##
5
- # Add our rakes when padrino core require this file.
6
- #
7
3
  require 'padrino-core/tasks'
8
4
  Padrino::Tasks.files << Dir[File.dirname(__FILE__) + "/padrino-gen/padrino-tasks/**/*.rb"]
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.7.0"
8
+ s.version = "0.7.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{2010-01-31}
12
+ s.date = %q{2010-02-03}
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}
@@ -35,15 +35,15 @@ Gem::Specification.new do |s|
35
35
  "lib/padrino-gen/generators/app/app/app.rb.tt",
36
36
  "lib/padrino-gen/generators/app/app/controllers/.empty_directory",
37
37
  "lib/padrino-gen/generators/app/app/helpers/.empty_directory",
38
- "lib/padrino-gen/generators/app/app/public/images/.empty_directory",
39
- "lib/padrino-gen/generators/app/app/public/javascripts/.empty_directory",
40
- "lib/padrino-gen/generators/app/app/public/stylesheets/.empty_directory",
41
38
  "lib/padrino-gen/generators/app/app/views/.empty_directory",
42
39
  "lib/padrino-gen/generators/app/config.ru",
43
40
  "lib/padrino-gen/generators/app/config/apps.rb.tt",
44
41
  "lib/padrino-gen/generators/app/config/boot.rb",
45
42
  "lib/padrino-gen/generators/app/config/initializers/.empty_directory",
46
43
  "lib/padrino-gen/generators/app/config/initializers/example.rb",
44
+ "lib/padrino-gen/generators/app/public/images/.empty_directory",
45
+ "lib/padrino-gen/generators/app/public/javascripts/.empty_directory",
46
+ "lib/padrino-gen/generators/app/public/stylesheets/.empty_directory",
47
47
  "lib/padrino-gen/generators/app/tmp/.empty_directory",
48
48
  "lib/padrino-gen/generators/components/actions.rb",
49
49
  "lib/padrino-gen/generators/components/mocks/mocha_gen.rb",
@@ -98,7 +98,7 @@ Gem::Specification.new do |s|
98
98
 
99
99
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
100
100
  s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
101
- s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.0"])
101
+ s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.1"])
102
102
  s.add_runtime_dependency(%q<thor>, [">= 0.11.8"])
103
103
  s.add_runtime_dependency(%q<bundler>, [">= 0.5.0"])
104
104
  s.add_development_dependency(%q<haml>, [">= 2.2.1"])
@@ -109,7 +109,7 @@ Gem::Specification.new do |s|
109
109
  s.add_development_dependency(%q<fakeweb>, [">= 1.2.3"])
110
110
  else
111
111
  s.add_dependency(%q<sinatra>, [">= 0.9.2"])
112
- s.add_dependency(%q<padrino-core>, ["= 0.7.0"])
112
+ s.add_dependency(%q<padrino-core>, ["= 0.7.1"])
113
113
  s.add_dependency(%q<thor>, [">= 0.11.8"])
114
114
  s.add_dependency(%q<bundler>, [">= 0.5.0"])
115
115
  s.add_dependency(%q<haml>, [">= 2.2.1"])
@@ -121,7 +121,7 @@ Gem::Specification.new do |s|
121
121
  end
122
122
  else
123
123
  s.add_dependency(%q<sinatra>, [">= 0.9.2"])
124
- s.add_dependency(%q<padrino-core>, ["= 0.7.0"])
124
+ s.add_dependency(%q<padrino-core>, ["= 0.7.1"])
125
125
  s.add_dependency(%q<thor>, [">= 0.11.8"])
126
126
  s.add_dependency(%q<bundler>, [">= 0.5.0"])
127
127
  s.add_dependency(%q<haml>, [">= 2.2.1"])
@@ -154,23 +154,23 @@ class TestAppGenerator < Test::Unit::TestCase
154
154
  should "properly generate for jquery" do
155
155
  buffer = silence_logger { @app.start(['sample_app', '--root=/tmp', '--script=jquery']) }
156
156
  assert_match /Applying.*?jquery.*?script/, buffer
157
- assert_file_exists('/tmp/sample_app/app/public/javascripts/jquery.js')
158
- assert_file_exists('/tmp/sample_app/app/public/javascripts/application.js')
157
+ assert_file_exists('/tmp/sample_app/public/javascripts/jquery.js')
158
+ assert_file_exists('/tmp/sample_app/public/javascripts/application.js')
159
159
  end
160
160
 
161
161
  should "properly generate for prototype" do
162
162
  buffer = silence_logger { @app.start(['sample_app', '--root=/tmp', '--script=prototype']) }
163
163
  assert_match /Applying.*?prototype.*?script/, buffer
164
- assert_file_exists('/tmp/sample_app/app/public/javascripts/protopak.js')
165
- assert_file_exists('/tmp/sample_app/app/public/javascripts/lowpro.js')
166
- assert_file_exists('/tmp/sample_app/app/public/javascripts/application.js')
164
+ assert_file_exists('/tmp/sample_app/public/javascripts/protopak.js')
165
+ assert_file_exists('/tmp/sample_app/public/javascripts/lowpro.js')
166
+ assert_file_exists('/tmp/sample_app/public/javascripts/application.js')
167
167
  end
168
168
 
169
169
  should "properly generate for rightjs" do
170
170
  buffer = silence_logger { @app.start(['sample_app', '--root=/tmp', '--script=rightjs']) }
171
171
  assert_match /Applying.*?rightjs.*?script/, buffer
172
- assert_file_exists('/tmp/sample_app/app/public/javascripts/right.js')
173
- assert_file_exists('/tmp/sample_app/app/public/javascripts/application.js')
172
+ assert_file_exists('/tmp/sample_app/public/javascripts/right.js')
173
+ assert_file_exists('/tmp/sample_app/public/javascripts/application.js')
174
174
  end
175
175
  end
176
176
 
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.7.0
4
+ version: 0.7.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: 2010-01-31 00:00:00 +01:00
15
+ date: 2010-02-03 00:00:00 +01:00
16
16
  default_executable: padrino-gen
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -33,7 +33,7 @@ dependencies:
33
33
  requirements:
34
34
  - - "="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.7.0
36
+ version: 0.7.1
37
37
  version:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: thor
@@ -141,15 +141,15 @@ files:
141
141
  - lib/padrino-gen/generators/app/app/app.rb.tt
142
142
  - lib/padrino-gen/generators/app/app/controllers/.empty_directory
143
143
  - lib/padrino-gen/generators/app/app/helpers/.empty_directory
144
- - lib/padrino-gen/generators/app/app/public/images/.empty_directory
145
- - lib/padrino-gen/generators/app/app/public/javascripts/.empty_directory
146
- - lib/padrino-gen/generators/app/app/public/stylesheets/.empty_directory
147
144
  - lib/padrino-gen/generators/app/app/views/.empty_directory
148
145
  - lib/padrino-gen/generators/app/config.ru
149
146
  - lib/padrino-gen/generators/app/config/apps.rb.tt
150
147
  - lib/padrino-gen/generators/app/config/boot.rb
151
148
  - lib/padrino-gen/generators/app/config/initializers/.empty_directory
152
149
  - lib/padrino-gen/generators/app/config/initializers/example.rb
150
+ - lib/padrino-gen/generators/app/public/images/.empty_directory
151
+ - lib/padrino-gen/generators/app/public/javascripts/.empty_directory
152
+ - lib/padrino-gen/generators/app/public/stylesheets/.empty_directory
153
153
  - lib/padrino-gen/generators/app/tmp/.empty_directory
154
154
  - lib/padrino-gen/generators/components/actions.rb
155
155
  - lib/padrino-gen/generators/components/mocks/mocha_gen.rb