Class: BunBo::ContentGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/bun_bo/content_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(root_path) ⇒ ContentGenerator

Returns a new instance of ContentGenerator.



3
4
5
# File 'lib/bun_bo/content_generator.rb', line 3

def initialize(root_path)
  @root_path = root_path
end

Instance Method Details

#generateObject



7
8
9
10
11
12
13
14
15
# File 'lib/bun_bo/content_generator.rb', line 7

def generate
  if root_path.join('spec', 'rails_helper.rb').exist?
    "require 'rails_helper'"
  elsif  root_path.join('spec', 'spec_helper.rb').exist?
    "require 'spec_helper'"
  else
    ''
  end
end