Class: SimpleTemplater::Hooks::GithubUser

Inherits:
Hook
  • Object
show all
Defined in:
lib/simple-templater/hooks/preprocess/github.rb

Instance Attribute Summary

Attributes inherited from Hook

#context, #reply

Instance Method Summary collapse

Methods inherited from Hook

find, hooks, inherited, #initialize, invoke, #key, #will_run?

Constructor Details

This class inherits a constructor from SimpleTemplater::Hooks::Hook

Instance Method Details

#questionObject



7
8
9
# File 'lib/simple-templater/hooks/preprocess/github.rb', line 7

def question
  ENV["USER"] # don't bother users with asking, it's very likely that github username will be same as $USER variable. If not, user can specify it from CLI as --github-user=botanicus
end

#runObject



11
12
13
# File 'lib/simple-templater/hooks/preprocess/github.rb', line 11

def run
  self.context.reverse_merge!(self.key => self.reply)
end