-
Notifications
You must be signed in to change notification settings - Fork 96
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 cli new #233
add cli new #233
Conversation
=end | ||
|
||
if | ||
RUBY_VERSION == "2.0.0" # check Gemfile |
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.
Did you mean >= '2.0.0'
?
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.
coverage is calculated only on this single ruby, needed gems are restricted only to this ruby https://github.com/jish/pre-commit/pull/233/files#diff-528248a33c4d64f323b7c6b622a98c54R13
on one hand it was needed for older rubies (I think redcarpet was not installing)
but it also helps to save workers time / test time for what it counts
4d6d38e
to
ca92f63
Compare
|
||
module PreCommit | ||
class Template | ||
TEMPLATE_DIR = File.expand_path("../../../templates/gem", __FILE__) |
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.
We might want to call this templates/plugin
. Not a big deal though, this is fine.
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 was thinking later we could extend the new
command, then we could have a way to generate more things like just plugin in existing gem, possibly a plugin template could be called from gem template
looks good if we can get tests passing. |
1ad5caf
to
81a659d
Compare
81a659d
to
d8f9091
Compare
applied suggestions and tests are passing |
attr_reader :name, :author, :email, :description, :gem_name, :copyright | ||
|
||
def initialize(*args) | ||
@name, @author, @email, @description = args |
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'm really unhappy with this, it's good for start, but later on it would make sense to allow saving @author, @email
in configuration and only if missing require them maybe as last param in form 'Name <email@...>'
here is the extracted tool: https://github.com/mpapis/tree_renderer - @jish should I open new PR making use of it or you are fine with current implementation? |
I think the current implementation is ok. Good job extracting the functionality :) In this case I think it is small enough that it does not warrant adding a new gem dependency. Josh
|
@jish I hope you like it :) is there anything I could do better (except adding tests)?