Class: Rails::Generators::BenchmarkGenerator
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Rails::Generators::NamedBase
|
Defined in: | railties/lib/rails/generators/rails/benchmark/benchmark_generator.rb |
Constant Summary
-
IPS_GEM_NAME =
# File 'railties/lib/rails/generators/rails/benchmark/benchmark_generator.rb', line 8"benchmark-ips"
-
IPS_GEM_USED_REGEXP =
# File 'railties/lib/rails/generators/rails/benchmark/benchmark_generator.rb', line 9/gem.*\b#{IPS_GEM_NAME}\b.*/
Class Method Summary
Base
- Inherited
.base_root | Returns the base root for a common set of generators. |
.default_source_root | Returns the default source root for a given generator. |
.desc | Tries to get the description from a USAGE file one folder above the source root otherwise uses a default description. |
.hide! | Convenience method to hide this generator from the available ones when running rails generator command. |
.hook_for | Invoke a generator based on the value supplied by the user to the given option named “name”. |
.namespace | Convenience method to get the namespace from the class name. |
.remove_hook_for | Remove a previously added hook. |
.source_root | Returns the source root for this generator using default_source_root as default. |
Instance Method Summary
Actions
- Included
#add_source | Add the given source to |
#application | Alias for Actions#environment. |
#environment | Adds configuration code to a Rails runtime environment. |
#gem | Adds a |
#gem_group | Wraps gem entries inside a group. |
#generate | Runs another generator. |
#git | Runs one or more git commands. |
#github, | |
#initializer | Creates an initializer file in |
#lib | Creates a file in |
#rails_command | Runs the specified Rails command. |
#rake | Runs the specified Rake task. |
#rakefile | Creates a Rake tasks file in |
#readme | Reads the given file at the source root and prints it in the console. |
#route | Make an entry in Rails routing file |
#vendor | Creates a file in |
Instance Method Details
#generate_layout
[ GitHub ]# File 'railties/lib/rails/generators/rails/benchmark/benchmark_generator.rb', line 13
def generate_layout add_ips_to_gemfile unless ips_installed? template("benchmark.rb.tt", "script/benchmarks/#{file_name}.rb") end