-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add base Github wiki #317
Add base Github wiki #317
Conversation
a57184b
to
6232cda
Compare
282f122
to
7677332
Compare
7677332
to
5e1492b
Compare
f4cb941
to
f89b08a
Compare
attr_reader :errors | ||
end | ||
end | ||
class Template::Errors < Template::Messages; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this architecture implementation as it feels a bit unnatural/strange 🤔
Just like flashes, how about instead having one class/object e.g. Template::Messages
and when adding a new message to the list, one has to add a type e.g. {type: :info, text: "Please set up ..."}, {type: :error, text: "Please set up ..."}. Then when looping for messages, the messages will be filtered by type.
Note that there could be some convenience methods like Template::Messages.add_info, Template::Messages.add_error. These could be created automatically for each type using define_method:
class Template::Messages
#...
def add(type message)
messages << { type: type: message: message.chomp }
end
["error", "info"].each do |type|
define_method(:"add_#{type}") do |message|
add(type, message)
end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me rework the message system in another PR. I need to revisit all the places that we add the message and also deal with how to print out all messages of specific type 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be working on it when doing Issue: Refactor Template Helpers
#286
What happened
Github
now is an optional addonGithub
addonInsight
Keep the
README.md
in the base template. WhenGithub
addon is selected:.github/workflow/README.md
->.github/wiki/CI-CD.md
Revamp template message
Now that we add the manual instruction, I took the opportunity to refactor the whole message when the project creation is completed.
tmp/template_rubocop.txt
With multiple errors + instructions:
Proof Of Work
You can try on your local with:
Enable
Github
Addon, it should generate wiki pagesPlease review the content in the PR