class LetsencryptPlugin::FileStore

Public Class Methods

new(challenge_content, challenge_dir_name) click to toggle source
Calls superclass method LetsencryptPlugin::ChallengeStore::new
# File lib/letsencrypt_plugin/file_store.rb, line 5
def initialize(challenge_content, challenge_dir_name)
  super(challenge_content)
  @challenge_dir_name = challenge_dir_name
end

Public Instance Methods

store_content() click to toggle source
# File lib/letsencrypt_plugin/file_store.rb, line 10
def store_content
  full_challenge_dir = File.join(Rails.root, @challenge_dir_name)
  Dir.mkdir(full_challenge_dir) unless File.directory?(full_challenge_dir)
  File.open(File.join(full_challenge_dir, 'challenge'), 'w') { |file| file.write(@content) }
end