Sha256: 64c7ef010ee2644cf162c81dbf22302f5f5ffb92f19c303f4a9352bea59fb142
Contents?: true
Size: 642 Bytes
Versions: 3
Compression:
Stored size: 642 Bytes
Contents
require 'yaml' require 'fileutils' module Socialcast def config_dir config_dir = File.expand_path '~/.socialcast' FileUtils.mkdir config_dir, :mode => 0700 unless File.exist?(config_dir) config_dir end def credentials_file File.join config_dir, 'credentials.yml' end def save_credentials(options) File.open(credentials_file, "w") do |f| f.write(options.to_yaml) end File.chmod 0600, credentials_file end def credentials raise 'Unknown Socialcast credentials. Run `socialcast authenticate` to initialize' unless File.exist?(credentials_file) YAML.load_file(credentials_file) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
socialcast-1.0.2 | lib/socialcast.rb |
socialcast-1.0.1 | lib/socialcast.rb |
socialcast-1.0.0.beta1 | lib/socialcast.rb |