Class: Gem::Specification

Inherits:
Object
  • Object
show all
Defined in:
lib/gembox/extensions.rb

Instance Method Summary collapse

Instance Method Details

#files_treeObject



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

Returns:

  • (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

Returns:

  • (Boolean)


17
18
19
# File 'lib/gembox/extensions.rb', line 17

def on_github?
  homepage =~ /github\.com\/([\w\d\-\_]+)\/([\w\d\-\_]+)\/tree/
end

#rdoc_pathObject



26
27
28
# File 'lib/gembox/extensions.rb', line 26

def rdoc_path
  File.join(installation_path, 'doc', full_name, 'rdoc')
end