Module: AuthKeys

Defined in:
lib/auth_keys.rb,
lib/auth_keys/version.rb,
lib/auth_keys/github/org.rb,
lib/auth_keys/github/team.rb,
lib/auth_keys/utility/main.rb,
lib/auth_keys/github/member.rb,
lib/auth_keys/utility/config.rb,
lib/auth_keys/utility/request.rb

Defined Under Namespace

Classes: Config, Member, Org, Request, Team

Constant Summary collapse

VERSION =
"0.0.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configuration=(value) ⇒ Object (writeonly)

Sets the attribute configuration

Parameters:

  • value

    the value to set the attribute configuration to.



3
4
5
# File 'lib/auth_keys/utility/main.rb', line 3

def configuration=(value)
  @configuration = value
end

Class Method Details

.configObject



6
7
8
# File 'lib/auth_keys/utility/main.rb', line 6

def self.config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



10
11
12
# File 'lib/auth_keys/utility/main.rb', line 10

def self.configure
  yield(config)
end

.goObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/auth_keys.rb', line 15

def self.go
  return "invalid_config" if invalid_config
  if keys.empty?
    "No keys to write. Make sure your config is setup correctly"
  else
    puts "Writing keys to file: #{AuthKeys.config.file_path}" if AuthKeys.config.verbose
    File.open(AuthKeys.config.file_path, 'w') do |file|
      keys.each { |key| file.puts key}
    end
    if File.chmod(0644, AuthKeys.config.file_path) == 1
      "success™"
    else
      "failure"
    end
  end
end