Skip to content
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

Generate empty lib/<project-name>.rb file #762

Merged
merged 2 commits into from Mar 31, 2017

Conversation

jodosha
Copy link
Member

@jodosha jodosha commented Mar 30, 2017

This PR implements a suggested solution to fix #758

/cc @ixti and @hanami/core for review.

@jodosha jodosha added the fix label Mar 30, 2017
@jodosha jodosha self-assigned this Mar 30, 2017
@jodosha jodosha added this to the v1.0.0.rc1 milestone Mar 30, 2017
@@ -44,7 +44,6 @@
# lib/<project>.rb
#
expect("lib/#{project}.rb").to have_file_content <<-END
Copy link
Member

Choose a reason for hiding this comment

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

can this be changed to just "" (or "\n"?) instead of using the HEREDOC?

Also, do we need this file at all, if it's blank? If so, could we put a comment in here saying something like

# This file is intentionally blank.

Copy link
Member Author

Choose a reason for hiding this comment

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

@cllns Yeah, I'm gonna switch from HEREDOC to simpler string representation.

I was thinking to define a blank module like:

module Bookshelf
end

Copy link

Choose a reason for hiding this comment

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

Ohh. I like this! (empty module)

Copy link
Member

Choose a reason for hiding this comment

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

I like an empty module too :)

Copy link
Member

Choose a reason for hiding this comment

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

Good idea with the empty module 👍
Maybe we also add the comment with this PR? I'm sure that some developers will have questions about this module in future.

@ixti
Copy link

ixti commented Mar 31, 2017

Just to confirm. This fixes #758 for me :D

Example:

    $ hanami new cool_project
    $ cd cool_project
    $ cat lib/cool_project.rb
    module CoolProject
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hanami::Utils.reload! is used in development regardless if code-reloading is used or not.
4 participants