javan / javan/whenever

Multiple space in code will also become subject of squish

Open
#735 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Thank you for a wonderful library.

There is one thing in trouble. It is a little inconvenient to squish multiple spaces.
It is good to make one space before and after a line break. But, if possible, I do not want squish the space in the code. Please consider.

https://github.com/javan/whenever/blob/21ce00be97bb3c1c58994b6debb776e8259a303e/lib/whenever/job.rb#L44

Steps to reproduce
every 1.hour do
  runner "p '  '"
end
Expected behavior
0 * * * * /bin/bash -l -c 'cd /path/to/myapp && bin/rails runner -e production '\''p '\''\'\'''\''  '\''\'\'''\'''\'' >> log/cron.log'
Actual behavior
0 * * * * /bin/bash -l -c 'cd /path/to/myapp && bin/rails runner -e production '\''p '\''\'\'''\'' '\''\'\'''\'''\'' >> log/cron.log'

Multiple spaces are now one.

System configuration

whenever version: 0.10.0
Ruby version: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

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

Start at lib/whenever/job.rb around the linked line and reproduce the issue with the Ruby runner example from the report. Compare the generated crontab output with the expected output, then verify that multiple spaces inside the command remain intact while spacing around line breaks still behaves as intended.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.