javan / javan/whenever

Fails generating crontab with currently empty crontab

Open
#611 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting-feedback bugfix
Dominant language
Ruby
Stars
8.9k
Forks
715
PR merge metrics
No merged PRs in 30d

Description

With a blank crontab:

rails runner -e staging "Whenever::CommandLine.execute(:update=>true,:identifier=>'myapp',:set=>'environment=staging', :cut => 3)"
/home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:114:in `prepare': undefined method `join' for nil:NilClass (NoMethodError)
    from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:64:in `read_crontab'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:92:in `updated_crontab'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:35:in `run'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:6:in `execute'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands/runner.rb:53:in `<top (required)>'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands/runner.rb:53:in `eval'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands/runner.rb:53:in `<top (required)>'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands.rb:84:in `require'
    from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands.rb:84:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Adding a few blank lines to the crontab makes it work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with a blank crontab using the Rails runner command in the issue. Start in lib/whenever/command_line.rb at prepare and read_crontab; done means an empty crontab no longer raises NoMethodError and crontab generation completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.