class GitBlog::Storage
Constants
- BASE_PATH
Public Class Methods
commit_msg_script_path()
click to toggle source
# File lib/git-blog/storage.rb 21 def self.commit_msg_script_path 22 File.join storage_base_path, "commit-msg" 23 end
config_dict()
click to toggle source
# File lib/git-blog/storage.rb 25 def self.config_dict 26 dict = nil 27 28 path = Storage::config_path 29 if File.exists? path 30 dict = JSON.parse(File.read(path)) 31 end 32 33 dict 34 end
config_path()
click to toggle source
# File lib/git-blog/storage.rb 13 def self.config_path 14 File.join storage_base_path, "config.json" 15 end
prepare_commit_msg_template_path()
click to toggle source
# File lib/git-blog/storage.rb 17 def self.prepare_commit_msg_template_path 18 File.join storage_base_path, "prepare-commit-msg" 19 end
save_config_dict(dict)
click to toggle source
# File lib/git-blog/storage.rb 36 def self.save_config_dict dict 37 FileUtils.mkdir_p Storage::storage_base_path 38 path = Storage::config_path 39 File.open(path, "w") { |file| file.write dict.to_json } 40 end
storage_base_path()
click to toggle source
# File lib/git-blog/storage.rb 9 def self.storage_base_path 10 File.expand_path BASE_PATH 11 end