Class: BenchBloc::Bloc::Task
- Inherits:
-
BenchBloc::Bloc
- Object
- BenchBloc::Bloc
- BenchBloc::Bloc::Task
- Defined in:
- lib/bench_bloc/bloc/bloc_task.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#to_profile ⇒ Object
readonly
Returns the value of attribute to_profile.
Attributes inherited from BenchBloc::Bloc
Instance Method Summary collapse
-
#initialize(namespace, bloc_task) ⇒ Task
constructor
A new instance of Task.
- #rake_task ⇒ Object
Methods inherited from BenchBloc::Bloc
#[], #generate_bloc, #rake_bloc
Constructor Details
#initialize(namespace, bloc_task) ⇒ Task
Returns a new instance of Task.
12 13 14 15 16 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 12 def initialize namespace, bloc_task super(bloc_task) @namespace = namespace parse_bloc_task bloc_task end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 4 def description @description end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
4 5 6 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 4 def label @label end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 4 def namespace @namespace end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
4 5 6 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 4 def profile @profile end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 4 def title @title end |
#to_profile ⇒ Object (readonly)
Returns the value of attribute to_profile.
4 5 6 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 4 def to_profile @to_profile end |
Instance Method Details
#rake_task ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/bench_bloc/bloc/bloc_task.rb', line 18 def rake_task desc description task namespace => :environment do BenchBloc::Logger.new(run_benchmark, description).log_results BenchBloc::Logger::RubyProf .new(run_ruby_prof, description) .log_results if @ruby_prof == true end end |