Class: Isstempl::Core
- Inherits:
-
Object
- Object
- Isstempl::Core
- Defined in:
- lib/isstempl_core.rb
Overview
Isstempl Core
Constant Summary collapse
- ISSTEMPL_FILE =
rubocop:disable LineLength
'Isstempl'
- ISSTEMPL_TEMPLATE =
<<-EOS # encoding: utf-8 # GitHub Account # account is required # account allow only String # account's default value => "" account "" # GitHub Repository # repository is required # repository allow only String # repository's default value => "" repository "" # Issue Title # title is required # title allow only String # title's default value => "" title "" # Issue Body # body is required # body allow only String # body's default value => "" body "" # Issue Labels # labels is required # labels allow only String # labels => bug / duplicate / enhancement / help wanted / invalid / question / wontfix / or user defined Label # labels's default value => "" labels "" EOS
- URL_TEMPLATE =
"https://github.com/<%= account%>/<%= repository%>/issues/new?title=<%= title%>&body=<%= body%>&labels=<%= label%>"
Instance Method Summary collapse
-
#generate ⇒ Object
generate GitHub Issue template from Issuetempl.
-
#init ⇒ Object
generate Isstemplfile to current directory.
Instance Method Details
#generate ⇒ Object
generate GitHub Issue template from Issuetempl.
56 57 58 59 60 61 62 |
# File 'lib/isstempl_core.rb', line 56 def generate src = read_dsl dsl = Isstempl::Dsl.new dsl.instance_eval(src) url = apply_erb(dsl.isstempl) URI.escape(url) end |
#init ⇒ Object
generate Isstemplfile to current directory.
49 50 51 52 53 |
# File 'lib/isstempl_core.rb', line 49 def init File.open(ISSTEMPL_FILE, 'w') do |f| f.puts ISSTEMPL_TEMPLATE end end |