Class: Pear::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/pear/configuration.rb

Constant Summary collapse

CONFIG_FILE =
'.pear.yml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorsObject (readonly)

Returns the value of attribute authors.



5
6
7
# File 'lib/pear/configuration.rb', line 5

def authors
  @authors
end

#emailObject (readonly)

Returns the value of attribute email.



5
6
7
# File 'lib/pear/configuration.rb', line 5

def email
  @email
end

Instance Method Details

#write_sample_configurationObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/pear/configuration.rb', line 7

def write_sample_configuration
  abort('This doesn\'t look like a Git repository.') \
    unless Dir.exists?('.git')

  abort('Whoa there! A configuration file is already present.') \
    if File.exists?('.pear.yml')

  File.write(CONFIG_FILE, <<-config)
email: [email protected]
authors:
  - ad Alice Doe
  - bd Bob Doe
  config
end