Module: Doc::Configurator::Ruby::Stdlib

Included in:
Doc::Configurator::Ruby
Defined in:
lib/doc/configurator/ruby/stdlib.rb

Constant Summary collapse

STDLIB_CONFIG_URL =
'http://stdlib-doc.rubyforge.org/svn/trunk/data/gendoc.yaml'

Instance Method Summary collapse

Instance Method Details

#download_stdlib_configObject



26
27
28
# File 'lib/doc/configurator/ruby/stdlib.rb', line 26

def download_stdlib_config
  stdlib_config_path.write(Net::HTTP.get(URI.parse(STDLIB_CONFIG_URL)))
end

#read_stdlib_configObject



22
23
24
# File 'lib/doc/configurator/ruby/stdlib.rb', line 22

def read_stdlib_config
  YAML.load_file stdlib_config_path if stdlib_config_path.readable?
end

#stdlib_config(update) ⇒ Object



11
12
13
14
15
16
# File 'lib/doc/configurator/ruby/stdlib.rb', line 11

def stdlib_config(update)
  if update || !read_stdlib_config
    download_stdlib_config
  end
  read_stdlib_config
end

#stdlib_config_pathObject



18
19
20
# File 'lib/doc/configurator/ruby/stdlib.rb', line 18

def stdlib_config_path
  sources_dir / 'stdlib-config.yaml'
end