Class: RubySlippers::Engine::Repo
- Includes:
- Template
- Defined in:
- lib/ruby_slippers/repo.rb
Constant Summary collapse
- README =
"https://github.com/%s/%s/raw/master/README.%s"
Instance Method Summary collapse
-
#initialize(name, config) ⇒ Repo
constructor
A new instance of Repo.
- #readme ⇒ Object (also: #content)
Methods included from Template
included, #markdown, #method_missing, #to_html
Constructor Details
#initialize(name, config) ⇒ Repo
8 9 10 |
# File 'lib/ruby_slippers/repo.rb', line 8 def initialize name, config self[:name], @config = name, config end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RubySlippers::Engine::Template
Instance Method Details
#readme ⇒ Object Also known as: content
12 13 14 15 16 17 |
# File 'lib/ruby_slippers/repo.rb', line 12 def readme markdown open(README % [@config[:github][:user], self[:name], @config[:github][:ext]]).read rescue Timeout::Error, OpenURI::HTTPError => e "This page isn't available." end |