Class: WayOfWorking::ReadmeBadge::Generators::Init

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/way_of_working/readme_badge/generators/init.rb

Overview

This generator adds the alexrc file

Instance Method Summary collapse

Instance Method Details

#copy_way_of_working_documentationObject



32
33
34
# File 'lib/way_of_working/readme_badge/generators/init.rb', line 32

def copy_way_of_working_documentation
  template 'docs/way_of_working/readme-badges.md'
end

#create_template_readme_if_missingObject



17
18
19
# File 'lib/way_of_working/readme_badge/generators/init.rb', line 17

def create_template_readme_if_missing
  template_if_missing 'README.md'
end

#insert_badge_holder_into_readmeObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/way_of_working/readme_badge/generators/init.rb', line 21

def insert_badge_holder_into_readme
  content = <<~MARKDOWN + HOLDER_END_TAG

    <!-- Way of Working: Main Badge Holder Start -->
    #{main_badge}
    <!-- Way of Working: Additional Badge Holder Start -->
  MARKDOWN

  insert_into_file 'README.md', content, after: /^#\s.*?\n/
end