Class: Appraisal::Customize

Inherits:
Object
  • Object
show all
Defined in:
lib/appraisal/customize.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Customize

Returns a new instance of Customize.



5
6
7
8
9
10
# File 'lib/appraisal/customize.rb', line 5

def initialize(options = {})
  heading = options.fetch(:heading, nil)
  single_quotes = options.fetch(:single_quotes, false)
  @@heading = !heading.nil? && heading.chomp
  @@single_quotes = single_quotes
end

Class Method Details

.heading(gemfile = nil) ⇒ Object



13
14
15
16
17
18
# File 'lib/appraisal/customize.rb', line 13

def heading(gemfile = nil)
  @@heading ||= nil
  return @@heading unless gemfile

  customize(@@heading, gemfile)
end

.reset!Object

Reset class state - useful for testing



25
26
27
28
# File 'lib/appraisal/customize.rb', line 25

def reset!
  @@heading = nil
  @@single_quotes = false
end

.single_quotesObject



20
21
22
# File 'lib/appraisal/customize.rb', line 20

def single_quotes
  @@single_quotes ||= false
end