Module: DragonrubyEgg::Modules

Defined in:
lib/dragonruby_egg/modules.rb

Class Method Summary collapse

Class Method Details

.get_module_url(repo_module) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dragonruby_egg/modules.rb', line 5

def get_module_url(repo_module)
  modules = Database.get_modules()

  modules.each do |_module|
    author = _module["author"]
    name = _module["name"]
    url = _module["github_url"]
    
    if repo_module.index(/^(#{author}.)?#{name}$/)
      is_correct = Event.emit(:input_correct, author, name)
      if is_correct
        return url
      end
    end
  end # modules each

  return nil
end