Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Padrino is now 100% YARD documented, no undocumented warnings!
  • Loading branch information
nesquena committed Oct 6, 2011
1 parent de347a6 commit 746de95
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .yardopts
@@ -1,4 +1,4 @@
--exclude /support_lite|padrino-tasks|padrino-core\/cli/
--exclude /support_lite|padrino-tasks|padrino-core\/cli|generators\/components/
--output-dir doc/
--readme README.rdoc
--no-private
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rdoc
Expand Up @@ -7,7 +7,7 @@
* FIX #692 ensure :static_cache_control is properly applied
* FIX #689 status messages to common padrino logger (@udzura)
* Fixes logger issue when displaying cache logs
* Silence YARD undocumented warnings in admin and helpers
* Silence YARD undocumented warnings in *all* padrino gems (100% documented)

== 0.10.3

Expand Down
6 changes: 5 additions & 1 deletion padrino-gen/.yardopts
@@ -1 +1,5 @@
--title 'Padrino Gen Documentation' --protected
--title 'Padrino Gen Documentation'
--charset utf-8
--protected
--exclude lib/padrino-gen/generators/components
lib/**/*.rb
2 changes: 1 addition & 1 deletion padrino-gen/lib/padrino-gen.rb
Expand Up @@ -35,7 +35,7 @@ def self.bin_gen(*args)
# Padrino::Generators.load_paths << "custom_generator.rb"
#
module Generators

# Defines the absolute path to the padrino source folder
DEV_PATH = File.expand_path("../../", File.dirname(__FILE__))

class << self
Expand Down
6 changes: 5 additions & 1 deletion padrino-gen/lib/padrino-gen/generators/actions.rb
@@ -1,7 +1,10 @@
module Padrino
module Generators
# Raised when an application does not have a resolved root path.
class AppRootNotFound < RuntimeError; end

##
# Common actions needed to support project and component generation.
#
module Actions

def self.included(base)
Expand Down Expand Up @@ -435,6 +438,7 @@ def valid_constant?(name)
end
end

# Class methods for Thor generators to support the generators and component choices.
module ClassMethods
# Defines a class option to allow a component to be chosen and add to component type list
# Also builds the available_choices hash of which component choices are supported
Expand Down
4 changes: 4 additions & 0 deletions padrino-gen/lib/padrino-gen/generators/app.rb
@@ -1,13 +1,17 @@
module Padrino
module Generators

##
# Responsible for applications within a Padrino project. Creates and mounts the application and gives the user related information.
#
class App < Thor::Group

# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:app, self)

# Define the source template root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen project [name]"; end

# Include related modules
Expand Down
3 changes: 2 additions & 1 deletion padrino-gen/lib/padrino-gen/generators/cli.rb
Expand Up @@ -37,7 +37,8 @@ def load_boot
end
end

# @api private
# Loads the components available for all generators.
# @private
def setup
Padrino::Generators.load_components!

Expand Down
5 changes: 4 additions & 1 deletion padrino-gen/lib/padrino-gen/generators/controller.rb
@@ -1,13 +1,16 @@
module Padrino
module Generators

##
# Responsible for generating route controllers and associated tests within a Padrino application.
#
class Controller < Thor::Group

# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:controller, self)

# Define the source template root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen controller [name]"; end

# Include related modules
Expand Down
5 changes: 4 additions & 1 deletion padrino-gen/lib/padrino-gen/generators/mailer.rb
@@ -1,13 +1,16 @@
module Padrino
module Generators

##
# Responsible for the generating mailers and message definitions.
#
class Mailer < Thor::Group

# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:mailer, self)

# Define the source template root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen mailer [name]"; end

# Include related modules
Expand Down
6 changes: 5 additions & 1 deletion padrino-gen/lib/padrino-gen/generators/migration.rb
@@ -1,13 +1,16 @@
module Padrino
module Generators

##
# Responsible for generating migration files for the appropriate ORM component.
#
class Migration < Thor::Group

# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:migration, self)

# Define the source template root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen migration [name] [fields]"; end

# Include related modules
Expand All @@ -25,6 +28,7 @@ def self.banner; "padrino-gen migration [name] [fields]"; end
# Show help if no argv given
require_arguments!

# Creates the migration file within a Padrino project.
def create_migration
self.destination_root = options[:root]
if in_app_root?
Expand Down
5 changes: 4 additions & 1 deletion padrino-gen/lib/padrino-gen/generators/model.rb
@@ -1,13 +1,16 @@
module Padrino
module Generators

##
# Responsible for generating new models for the specified ORM component within a project or application.
#
class Model < Thor::Group

# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:model, self)

# Define the source template root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen model [name] [fields]"; end

# Include related modules
Expand Down
5 changes: 5 additions & 0 deletions padrino-gen/lib/padrino-gen/generators/plugin.rb
Expand Up @@ -3,13 +3,18 @@

module Padrino
module Generators
##
# Responsible for executing plugins instructions within a Padrino project.
#
class Plugin < Thor::Group
# Defines the default URL for official padrino recipe plugins
PLUGIN_URL = 'https://github.com/padrino/padrino-recipes/tree/master/plugins'
# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:plugin, self)

# Define the source plugin root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen plugin [plugin_identifier] [options]"; end

# Include related modules
Expand Down
4 changes: 4 additions & 0 deletions padrino-gen/lib/padrino-gen/generators/project.rb
Expand Up @@ -3,13 +3,17 @@

module Padrino
module Generators
##
# Responsible for generating new Padrino projects based on the specified project components.
#
class Project < Thor::Group

# Add this generator to our padrino-gen
Padrino::Generators.add_generator(:project, self)

# Define the source template root
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
# Defines the banner for this CLI generator
def self.banner; "padrino-gen project [name] [options]"; end

# Include related modules
Expand Down
3 changes: 3 additions & 0 deletions padrino-gen/lib/padrino-gen/generators/runner.rb
Expand Up @@ -2,6 +2,9 @@

module Padrino
module Generators
##
# Responsible for executing plugin and template instructions including common actions for modifying a project or application.
#
module Runner

# Generates project scaffold based on a given template file
Expand Down

0 comments on commit 746de95

Please sign in to comment.