Skip to content

Invoke configlet to create README during generate process.#722

Closed
ghost wants to merge 2 commits intomasterfrom
unknown repository
Closed

Invoke configlet to create README during generate process.#722
ghost wants to merge 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Sep 9, 2017

Why?

According to the docs, README are auto-generated but that is not the case: https://github.com/exercism/ruby#readmes

Manually copy-pasting README from problem-specifications can lead to errors. This creates consistency across all READMEs.

What?

README is generated by calling configlet command
./configlet generate . --only=acronym

How Has This Been Tested?

  1. Removal of README inside of directory
    rm exercises/acronym/README.md
  2. Run bin/generate acronym -f
  3. Verify README is generated for acronym

Types of changes

  • Add configlet invocation to generator

Checklist:

  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

@ghost ghost mentioned this pull request Sep 9, 2017
6 tasks
@Insti
Copy link
Copy Markdown
Contributor

Insti commented Sep 9, 2017

According to the docs, README are auto-generated but that is not the case: https://github.com/exercism/ruby#readmes

They ARE generated on the existing exercism.io site, they will not be on the new v2.exercism.io site.

Comment thread bin/generate
configletPath = "#{EXERCISM_RUBY_ROOT}/bin/configlet"
unless File.file?(configletPath)
raise Exception.new("Unable to find configlet, fetch using bin/fetch_configlet")
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the configlet availability check happen earlier in the process?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, moving it earlier

Comment thread bin/generate

generators.each do |generator|
system("#{configletPath} generate #{EXERCISM_RUBY_ROOT} --only=#{generator.exercise.slug}")
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure if this is the right way to be approaching this problem, I'll have to think about it for a while.

Is README generation related to test suite generation?
Will we always want to do both at the same time?
Should the code for doing this live inside the Generator with the other 3 things that it does already?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be able to ONLY regenerate the readme for a problem?
Does this need to be controlled by command line arguments to bin/generate?

@ghost ghost closed this Sep 10, 2017
@ghost ghost deleted the configlet branch September 10, 2017 05:16
@Insti
Copy link
Copy Markdown
Contributor

Insti commented Sep 10, 2017

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant