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 bundle install to jekyll new command #5237

Merged
merged 2 commits into from Sep 20, 2016

Conversation

Projects
None yet
7 participants
@ashmaroli
Member

ashmaroli commented Aug 12, 2016

This PR proposes to extend the jekyll new command with following:

  • Automatically cd my_blog and initiate bundle install

After you run jekyll new my_blog the command shell automatically cd into the new directory and runs bundle install.
If bundler is not installed, an exception is raised gracefully.
The user may choose to skip 'bundle install' if they plan to edit their new gemfile and change the theme gem, or if they want to inspect the new directory before running the bundle install command by using the new switch --skip-bundle

ref: #5225

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Aug 12, 2016

Member

Add bundler as a runtime dependency to gemspec?

Member

ashmaroli commented Aug 12, 2016

Add bundler as a runtime dependency to gemspec?

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks Aug 12, 2016

Contributor

I don't think that's a good idea, that could lead to problems on a system.

Contributor

envygeeks commented Aug 12, 2016

I don't think that's a good idea, that could lead to problems on a system.

@ashmaroli ashmaroli referenced this pull request Aug 21, 2016

Closed

Add --classic switch to 'jekyll new' command #5217

1 of 1 task complete
@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Aug 22, 2016

Member

Thanks for this PR! I'm not sure how I feel about this either. The current code is interactive, which I'm not such a big fan of. rails new always ran bundle install which I liked as a newcomer, but the Rails community is pretty different from the Jekyll community, I think. Not sure how I feel about this.

In general, we are headed in the direction of "always use bundler" so this isn't problematic from that perspective. But we should gracefully fail if bundler isn't available and mention that the user should run bundle install before running jekyll. 😄

Member

parkr commented Aug 22, 2016

Thanks for this PR! I'm not sure how I feel about this either. The current code is interactive, which I'm not such a big fan of. rails new always ran bundle install which I liked as a newcomer, but the Rails community is pretty different from the Jekyll community, I think. Not sure how I feel about this.

In general, we are headed in the direction of "always use bundler" so this isn't problematic from that perspective. But we should gracefully fail if bundler isn't available and mention that the user should run bundle install before running jekyll. 😄

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Aug 23, 2016

Member

Hi @parkr, I'm pretty confused..

But we should gracefully fail if bundler isn't available

PR does that already..

mention that the user should run bundle install before running jekyll.

??
There wont be a Gemfile to run bundle against until jekyll new has been called.
Running bundle after blog install will install minima theme gem for first time users; update minima if necessary for existing customers on J3.2.
Running bundle interactively lets the user edit their Gemfile / view the installed directory contents before having a request sent to rubygems.org. Once they make their decision, the new theme has to be bundled before being served.

Member

ashmaroli commented Aug 23, 2016

Hi @parkr, I'm pretty confused..

But we should gracefully fail if bundler isn't available

PR does that already..

mention that the user should run bundle install before running jekyll.

??
There wont be a Gemfile to run bundle against until jekyll new has been called.
Running bundle after blog install will install minima theme gem for first time users; update minima if necessary for existing customers on J3.2.
Running bundle interactively lets the user edit their Gemfile / view the installed directory contents before having a request sent to rubygems.org. Once they make their decision, the new theme has to be bundled before being served.

@ashmaroli ashmaroli referenced this pull request Sep 9, 2016

Closed

Jekyll's Philosophy #5342

@mattr-

This comment has been minimized.

Show comment
Hide comment
@mattr-

mattr- Sep 9, 2016

Member

I'm 👍 with the idea of running bundler when you create a new Jekyll site. Let's just run it all the time though, instead of asking the user if we should run it. I see no use case where a user would not want to run bundler after getting a new site.

Member

mattr- commented Sep 9, 2016

I'm 👍 with the idea of running bundler when you create a new Jekyll site. Let's just run it all the time though, instead of asking the user if we should run it. I see no use case where a user would not want to run bundler after getting a new site.

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 9, 2016

Member

@mattr- Thanks for the +1. 😃

I see no use case where a user would not want to run bundler after getting a new site.

I mentioned a possible scenario in the PR desc.:
The user may choose to skip 'bundle install' if they plan to edit their new gemfile and change the theme gem, or if they want to inspect the new directory before running the bundle install command

Member

ashmaroli commented Sep 9, 2016

@mattr- Thanks for the +1. 😃

I see no use case where a user would not want to run bundler after getting a new site.

I mentioned a possible scenario in the PR desc.:
The user may choose to skip 'bundle install' if they plan to edit their new gemfile and change the theme gem, or if they want to inspect the new directory before running the bundle install command

@mattr-

This comment has been minimized.

Show comment
Hide comment
@mattr-

mattr- Sep 9, 2016

Member

Those are technical use cases that I don't want to solve for, especially the directory inspection. While I expect that a large set of Jekyll's users are going to be on the more technical side, it's ridiculously easy to run bundle after we've done it as part of site generation after editing the Gemfile. I see where you're coming from on this, but I feel like it's only going to be used in a tiny set of cases and I'd rather come back and add it later if it's a highly requested feature.

Member

mattr- commented Sep 9, 2016

Those are technical use cases that I don't want to solve for, especially the directory inspection. While I expect that a large set of Jekyll's users are going to be on the more technical side, it's ridiculously easy to run bundle after we've done it as part of site generation after editing the Gemfile. I see where you're coming from on this, but I feel like it's only going to be used in a tiny set of cases and I'd rather come back and add it later if it's a highly requested feature.

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 9, 2016

Member

Okay. I'll modify the PR.

Member

ashmaroli commented Sep 9, 2016

Okay. I'll modify the PR.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 9, 2016

I'd prefer the simple option of an argument --no-bundler, there's no need to have an interactive prompt, Jekyll doesn't do this already for anything AFAIK. Other that that, 👍!

ghost commented Sep 9, 2016

I'd prefer the simple option of an argument --no-bundler, there's no need to have an interactive prompt, Jekyll doesn't do this already for anything AFAIK. Other that that, 👍!

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 12, 2016

Member

Replaced interactive bundle with running bundle install by default. Can be skipped by using a switch
--skip_bundle

Member

ashmaroli commented Sep 12, 2016

Replaced interactive bundle with running bundle install by default. Can be skipped by using a switch
--skip_bundle

ashmaroli added some commits Aug 12, 2016

add `bundle install` to `jekyll new`
 - automatically run `bundle install` from within the newly generated blog
   directory by default.
 - add a new switch to skip this default behaviour.
@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 13, 2016

Member

@jekyll/ecosystem : Since, this PR adds bundle install by default, should script/default-site be modified to avoid switching directories and then executing bundle install, as well?

Member

ashmaroli commented Sep 13, 2016

@jekyll/ecosystem : Since, this PR adds bundle install by default, should script/default-site be modified to avoid switching directories and then executing bundle install, as well?

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 13, 2016

Member

Updates:

  • changed skip switch to --skip-bundle
  • system(bundle install) replaced with system("bundle", "install")
  • modified test/test_new_command to test bundle-install-action and skip-switch
Member

ashmaroli commented Sep 13, 2016

Updates:

  • changed skip switch to --skip-bundle
  • system(bundle install) replaced with system("bundle", "install")
  • modified test/test_new_command to test bundle-install-action and skip-switch
def after_install(path, options = {})
Jekyll.logger.info "New jekyll site installed in #{path.cyan}."
Jekyll.logger.info "Bundle install skipped." if options["skip-bundle"]

This comment has been minimized.

@ghost

ghost Sep 13, 2016

Seems superfluous since --skip-bundle is an explicitly chosen command line option, unaffected by the environment in any way

@ghost

ghost Sep 13, 2016

Seems superfluous since --skip-bundle is an explicitly chosen command line option, unaffected by the environment in any way

This comment has been minimized.

@parkr

parkr Sep 16, 2016

Member

👍

@parkr

parkr Sep 16, 2016

Member

👍

@parkr

parkr approved these changes Sep 16, 2016

This LGTM. Would love another review from someone in @jekyll/core or @benbalter.

@benbalter

This comment has been minimized.

Show comment
Hide comment
@benbalter

benbalter Sep 19, 2016

Contributor

LGTM.

Contributor

benbalter commented Sep 19, 2016

LGTM.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Sep 20, 2016

Member

@jekyllbot: merge +minor

Member

parkr commented Sep 20, 2016

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit 504411e into jekyll:master Sep 20, 2016

1 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
jekyll/lgtm Awaiting approval from at least 2 maintainers.
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request Sep 20, 2016

@parkr parkr added this to the 3.3 milestone Sep 20, 2016

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 21, 2016

Member

TODO:

  • Update online documentation regarding this new feature. :
    • add a para under Quickstart

/cc @DirtyF
Whatsay? Is there any other place I should update?
Or will it be updated alongwith the Release Notes for 3.3?

Member

ashmaroli commented Sep 21, 2016

TODO:

  • Update online documentation regarding this new feature. :
    • add a para under Quickstart

/cc @DirtyF
Whatsay? Is there any other place I should update?
Or will it be updated alongwith the Release Notes for 3.3?

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Sep 21, 2016

Member

@parkr et al, All those bundle (show) reports in test logs might get frustrating at some point in future..
Your opinion?

Member

ashmaroli commented Sep 21, 2016

@parkr et al, All those bundle (show) reports in test logs might get frustrating at some point in future..
Your opinion?

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Sep 21, 2016

Member

All those bundle (show) reports in test logs might get frustrating at some point in future..
Your opinion?

Yeah definitely. If you can capture those and output them using Jekyll.logger then our current capture_stdout should ensure they're not written to actual stdout.

Member

parkr commented Sep 21, 2016

All those bundle (show) reports in test logs might get frustrating at some point in future..
Your opinion?

Yeah definitely. If you can capture those and output them using Jekyll.logger then our current capture_stdout should ensure they're not written to actual stdout.

@DirtyF

This comment has been minimized.

Show comment
Hide comment
@DirtyF

DirtyF Sep 21, 2016

Member

@ashmaroli yeah, homepage snippet will also be affected by this change, be sure to reflect changes here too.

Member

DirtyF commented Sep 21, 2016

@ashmaroli yeah, homepage snippet will also be affected by this change, be sure to reflect changes here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment