Sha256: 18f56f3ee0b4bd4f278fbc9e6c355f090ddcd149b1a89bedacdf09e385f88ee9
Contents?: true
Size: 825 Bytes
Versions: 12
Compression:
Stored size: 825 Bytes
Contents
# encoding: utf-8 require 'singleton' require 'yaml' module Sonar class RCFile include Singleton attr_accessor :path FILENAME = 'sonar.rc' def initialize @path = File.join(File.expand_path('~'), FILENAME) @data = load_file end def create_file File.open(@path, 'w') do |f| f.puts 'email: YOUR_EMAIL' f.puts 'access_token: SONAR_TOKEN' f.puts 'api_url: https://sonar.labs.rapid7.com' f.puts 'format: flat' f.puts 'record_limit: 10000' end warn = "Please set your email and API token in sonar.rc" puts "=" * warn.size puts "Config file setup at: #{@path}" puts warn puts "=" * warn.size end def load_file create_file unless File.exist?(@path) YAML.load_file(@path) end end end
Version data entries
12 entries across 12 versions & 1 rubygems