Class: Retest::Command::Ruby
- Inherits:
-
Object
- Object
- Retest::Command::Ruby
- Defined in:
- lib/retest/command/ruby.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#file_system ⇒ Object
readonly
Returns the value of attribute file_system.
Instance Method Summary collapse
- #format_batch(*files) ⇒ Object
-
#initialize(all:, file_system: FileSystem) ⇒ Ruby
constructor
A new instance of Ruby.
- #to_s ⇒ Object
Constructor Details
#initialize(all:, file_system: FileSystem) ⇒ Ruby
Returns a new instance of Ruby.
6 7 8 9 |
# File 'lib/retest/command/ruby.rb', line 6 def initialize(all:, file_system: FileSystem) @file_system = file_system @all = all end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
4 5 6 |
# File 'lib/retest/command/ruby.rb', line 4 def all @all end |
#file_system ⇒ Object (readonly)
Returns the value of attribute file_system.
4 5 6 |
# File 'lib/retest/command/ruby.rb', line 4 def file_system @file_system end |
Instance Method Details
#format_batch(*files) ⇒ Object
11 12 13 |
# File 'lib/retest/command/ruby.rb', line 11 def format_batch(*files) %Q{-e "#{files.map { |file| "require './#{file}';" }.join}"} end |
#to_s ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/retest/command/ruby.rb', line 15 def to_s if file_system.exist? 'Gemfile.lock' 'bundle exec ruby <test>' else 'ruby <test>' end end |