Module: Rda::Helper

Included in:
App, Nginx
Defined in:
lib/rda/helper.rb

Instance Method Summary collapse

Instance Method Details

#configured?(fname, conf) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
12
13
# File 'lib/rda/helper.rb', line 3

def configured?(fname, conf)
  IO.readlines(fname).each do |l|
    if l.strip.start_with?(conf)
      $stderr.puts "INFO: #{conf} has already been set!"

      return true
    end
  end

  false
end