Class: Gem::Specification
- Inherits:
-
Object
- Object
- Gem::Specification
- Defined in:
- lib/gembox/extensions.rb
Instance Method Summary collapse
- #files_tree ⇒ Object
- #has_rdoc? ⇒ Boolean
- #has_rdoc_checked? ⇒ Object
- #on_github? ⇒ Boolean
- #rdoc_path ⇒ Object
Instance Method Details
#files_tree ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/gembox/extensions.rb', line 4 def files_tree tree = {} files.each do |file| split_dirs = file.split(/\//) keyed_hash = {} split_dirs.reverse.each do |key| keyed_hash = {key => keyed_hash} end tree.deep_merge!(keyed_hash) end tree end |
#has_rdoc? ⇒ Boolean
22 23 24 |
# File 'lib/gembox/extensions.rb', line 22 def has_rdoc? has_rdoc_checked? && File.exists?(rdoc_path) end |
#has_rdoc_checked? ⇒ Object
21 |
# File 'lib/gembox/extensions.rb', line 21 alias :has_rdoc_checked? :has_rdoc? |
#on_github? ⇒ Boolean
17 18 19 |
# File 'lib/gembox/extensions.rb', line 17 def on_github? homepage =~ /github\.com\/([\w\d\-\_]+)\/([\w\d\-\_]+)\/tree/ end |
#rdoc_path ⇒ Object
26 27 28 |
# File 'lib/gembox/extensions.rb', line 26 def rdoc_path File.join(installation_path, 'doc', full_name, 'rdoc') end |