Class: SetConfig
- Inherits:
-
Object
- Object
- SetConfig
- Defined in:
- lib/qiita_org/old_programs/set_config.rb
Instance Method Summary collapse
-
#initialize ⇒ SetConfig
constructor
A new instance of SetConfig.
- #set_config ⇒ Object
Constructor Details
#initialize ⇒ SetConfig
Returns a new instance of SetConfig.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/qiita_org/old_programs/set_config.rb', line 5 def initialize() search = SearchConfPath.new(Dir.pwd, Dir.home) @lib = File.("../../../lib", __FILE__) @conf_dir = search.search_conf_path() if @conf_dir != Dir.home puts "config file path: #{@conf_dir.gsub(Dir.home, "~")}".green else puts "config file path: #{@conf_dir}" end end |
Instance Method Details
#set_config ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/qiita_org/old_programs/set_config.rb', line 16 def set_config() conf_path = File.join(@conf_dir, ".qiita.conf") conf = JSON.load(File.read(conf_path)) access_token = conf["access_token"] teams_url = conf["teams_url"] display = conf["display"] ox_qmd_load_path = File.join(@lib, "qiita_org", "ox-qmd", "ox-qmd") ErrorMessage.new().access_token_error(access_token) #== false # puts "Please setting ACCESS_TOKEN".red # exit return access_token, teams_url, display, ox_qmd_load_path end |