Cross Reference: config.rb
xref
: /
ontohub
/
lib
/
git_repository
/
config.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
config.rb revision ee5342a8882c2fc7631fcffb5497e6597747887c
429
N/A
module
GitRepository
::
Config
429
N/A
429
N/A
protected
429
N/A
429
N/A
def
get_config
(
key
)
429
N/A
git_exec
'config'
,
key
429
N/A
end
429
N/A
429
N/A
def
set_section
(
section
,
options
)
429
N/A
section
=
Array.wrap
(
section
)
429
N/A
429
N/A
remove_section
section
429
N/A
add_section
section
,
options
429
N/A
end
429
N/A
429
N/A
def
add_section
(
section
,
options
)
429
N/A
mainsection
,
subsection
= *
section
429
N/A
429
N/A
File.open
(
"#{local_path}/config"
,
"a"
)
do
|f|
429
N/A
f.puts
"[#{mainsection}"
<<
(
subsection
?
" \"#{subsection}\""
:
''
)
<<
"]"
429
N/A
options.each
do
|
key
,
value
|
941
N/A
f.puts
"\t#{key} = #{value}"
941
N/A
end
1653
N/A
end
429
N/A
end
941
N/A
429
N/A
# Removes a config section
429
N/A
def
remove_section
(
section
)
429
N/A
git_exec
'config'
,
'--remove-section'
,
section.join
(
"."
)
429
N/A
true
1516
N/A
rescue
Exception
=> e
546
N/A
raise
unless
e.message.include
?
(
'No such section'
)
429
N/A
false
429
N/A
end
429
N/A
429
N/A
end
1026
N/A