Ruby on Rails (3.x >= 3.2.9) のためのブログです (どっちかというと社内ブログ的な感じで、基礎から書いてきます) 。
Comments

以下のコマンドで、一覧を見れます。

$ rake -T
rake about                          # List versions of all Rails frameworks and the environment
rake assets:clean                # Remove compiled assets
rake assets:precompile       # Compile all the assets named in config.assets.precompile
rake db:create                     # Create the database from DATABASE_URL or config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)
rake db:drop                       # Drops the database using DATABASE_URL or the current Rails.env (use db:drop:all to drop all databases)
rake db:fixtures:load           # Load fixtures into the current environment's database.
rake db:migrate                   # Migrate the database (options: VERSION=x, VERBOSE=false).
rake db:migrate:status        # Display status of migrations
rake db:rollback                   # Rolls the schema back to the previous version (specify steps w/ STEP=n).
rake db:schema:dump         # Create a db/schema.rb file that can be portably used against any DB supported by AR
rake db:schema:load           # Load a schema.rb file into the database
rake db:seed                        # Load the seed data from db/seeds.rb
rake db:setup                      # Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the db first)
rake db:structure:dump       # Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql
rake db:version                    # Retrieves the current schema version number
rake doc:app                       # Generate docs for the app -- also available doc:rails, doc:guides, doc:plugins (options: TEMPLATE=/rdoc-template.rb, TITLE="Custom Title")
rake log:clear                      # Truncates all *.log files in log/ to zero bytes
rake middleware                  # Prints out your Rack middleware stack
rake notes                          # Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)
rake notes:custom             # Enumerate a custom annotation, specify with ANNOTATION=CUSTOM
rake rails:template              # Applies the template supplied by LOCATION=(/path/to/template) or URL
rake rails:update                 # Update configs and some other initially generated files (or use just update:configs, update:scripts, or update:application_controller)
rake routes                         # Print out all defined routes in match order, with names.
rake secret                         # Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions).
rake stats                          # Report code statistics (KLOCs, etc) from the application
rake test                            # Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)
rake test:recent                 # Run tests for {:recent=>"test:prepare"} / Test recent changes
rake test:single                  # Run tests for {:single=>"test:prepare"}
rake test:uncommitted      # Run tests for {:uncommitted=>"test:prepare"} / Test changes since last checkin (only Subversion and Git)
rake time:zones:all             # Displays all time zones, also available: time:zones:us, time:zones:local -- filter with OFFSET parameter, e.g., OFFSET=-6
rake tmp:clear                    # Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear)
rake tmp:create                  # Creates tmp directories for sessions, cache, sockets, and pids

でも、実際は rake db:migrate:reset など、他にもコマンドがあるんですが、この中には載ってないようです。。。。。
全部観たい!!と思ってたのですが、よく調べ方がわかりませんでした。。。


description が載っていないのでよければ、以下のコマンドで調べれらます。

$ rake -P | grep rake
rake about
rake assets:clean
rake assets:clean:all
rake assets:environment
rake assets:precompile
rake assets:precompile:all
rake assets:precompile:nondigest
rake assets:precompile:primary
rake db:_dump
rake db:abort_if_pending_migrations
rake db:charset
rake db:collation
rake db:create
rake db:create:all
rake db:drop
rake db:drop:all
rake db:fixtures:identify
rake db:fixtures:load
rake db:forward
rake db:load_config
rake db:migrate
rake db:migrate:down
rake db:migrate:redo
rake db:migrate:reset
rake db:migrate:status
rake db:migrate:up
rake db:reset
rake db:rollback
rake db:schema:dump
rake db:schema:load
rake db:schema:load_if_ruby
rake db:seed
rake db:sessions:clear
rake db:sessions:create
rake db:setup
rake db:structure:dump
rake db:structure:load
rake db:structure:load_if_sql
rake db:test:clone
rake db:test:clone_structure
rake db:test:load
rake db:test:load_schema
rake db:test:load_structure
rake db:test:prepare
rake db:test:purge
rake db:version
rake default
rake doc
rake doc/api
rake doc/api/index.html
rake doc/app
rake doc/app/index.html
rake doc:app
rake doc:clobber
rake doc:clobber_app
rake doc:clobber_plugins
rake doc:clobber_rails
rake doc:guides
rake doc:plugins
rake doc:rails
rake doc:reapp
rake doc:rerails
rake environment
rake log:clear
rake middleware
rake notes
rake notes:custom
rake notes:fixme
rake notes:optimize
rake notes:todo
rake rails:template
rake rails:templates:copy
rake rails:update
rake rails:update:application_controller
rake rails:update:configs
rake rails:update:scripts
rake rails_env
rake railties:install:migrations
rake routes
rake secret
rake stats
rake test
rake test:benchmark
rake test:functionals
rake test:integration
rake test:plugins
rake test:prepare
rake test:profile
rake test:recent
rake test:run
rake test:single
rake test:uncommitted
rake test:units
rake time:zones:all
rake time:zones:local
rake time:zones:us
rake tmp:cache:clear
rake tmp:clear
rake tmp:create
rake tmp:pids:clear
rake tmp:sessions:clear
rake tmp:sockets:clear


こんな感じですね。
ちなみに Rails 3.2.9 です。どっかのバージョンでは、rake -T で全部見れたらしいのですが。。いちおうそれが載ってる記事があったので、紹介します。

rake --helpとrake -Tの実行結果 ]

以上〜。



Categories: , , ,

Leave a Reply