Class: LetsencryptPlugin::FileStore
- Inherits:
-
ChallengeStore
- Object
- ChallengeStore
- LetsencryptPlugin::FileStore
- Defined in:
- lib/letsencrypt_plugin/file_store.rb
Instance Method Summary collapse
-
#initialize(challenge_content, challenge_dir_name) ⇒ FileStore
constructor
A new instance of FileStore.
- #store_content ⇒ Object
Methods inherited from ChallengeStore
Constructor Details
#initialize(challenge_content, challenge_dir_name) ⇒ FileStore
Returns a new instance of FileStore.
5 6 7 8 |
# 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 |
Instance Method Details
#store_content ⇒ Object
10 11 12 13 14 |
# 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 |