{"id":15448142,"url":"https://github.com/maxlap/winever","last_synced_at":"2025-08-08T04:40:22.898Z","repository":{"id":17827894,"uuid":"20731314","full_name":"MaxLap/winever","owner":"MaxLap","description":"Use the Whenever gem's clean ruby syntax for writing and deploying tasks in the windows scheduler, using the same schedule file.","archived":false,"fork":false,"pushed_at":"2023-12-06T18:10:44.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T15:55:46.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxLap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-11T15:53:29.000Z","updated_at":"2023-12-06T18:10:07.000Z","dependencies_parsed_at":"2024-12-06T04:28:05.075Z","dependency_job_id":"b19e7a79-94e3-4836-b337-cdaa342ae78a","html_url":"https://github.com/MaxLap/winever","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":0.08333333333333337,"last_synced_commit":"c5bfe8e0afd0dd05eea958f4e896ec5949f15307"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/MaxLap/winever","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxLap%2Fwinever","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxLap%2Fwinever/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxLap%2Fwinever/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxLap%2Fwinever/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxLap","download_url":"https://codeload.github.com/MaxLap/winever/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxLap%2Fwinever/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262393111,"owners_count":23304048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T20:22:08.779Z","updated_at":"2025-06-28T07:35:06.433Z","avatar_url":"https://github.com/MaxLap.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Winever\n\nWinever is a gem that adds features to the [whenever](https://github.com/javan/whenever) gem, making it also compatible\nwith Windows, without breaking anything when using Whenever only.\n\nWinever creates and removes tasks in the Windows task scheduler using [win32-taskscheduler](https://github.com/djberg96/win32-taskscheduler).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'winever'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install\n\n## Usage\n\nWinever adds the command `winever` which behaves similarly to `whenever`.\n\nYou can use `winever` without parameters to list a \"cron file\" using an internal syntax. It will tell you which of the\njobs of your schedule are supported and which ones aren't. Just like with Whenever, you can use `winever -i` to install/update\nthe jobs on your Windows machine and `winever -c` to remove them.\n\nWinever creates tasks in Windows' task scheduler. In order for a job to be compatible with Winever, it needs to have an\nadditional option: task_name. Note that this task_name will have an identifier (similar to Whenever's comment in the crontab)\nadded as suffix to enable Winever to remove old tasks when needed.\n\n```ruby\nevery 1.day, at: '00:30 am' do\n  rake 'my_backup_task', :task_name =\u003e 'MyAppBackup'\nend\n```\n\nIf you define new job_types in your schedule. Then you will need to define them differently for Winever. To do so, first add\n`require 'winever'` to the top of your schedule file. This will add the function `winever?` to your schedule, which you can\nuse to define some tasks only for Windows or for Linux, and to define a job_type differently for Whenever and for Winever.\nThis is the basic line for create a job_type for Winever.\n\n```ruby\nif winever?\n  job_type :something, \":task_folder|:task_name|:path|command_you_want_executed_here :output\"\nelse\n  job_type :something, \"cd :path \u0026\u0026 command_you_want_executed_here :output\"\nend\n```\n\nThe pipes (|) are important, so make sure not to remove any.\nIf your job_type doesn't need to be run in the folder of your application (like the existing job_type \"command\" of Whenever),\nthen remove the :path (leaving the pipes around it intact).\n\nAs of right now the only type of schedule that is supported are the daily ones (run once per day, at a specific time, every day).\nPull requests welcomed to add more, cron_time.rb and test_cron_time.rb should be the only files needing edit for that.\n\n## Limitations/warnings\n\n* As mentioned previously, only once-per-day-everyday tasks are supported.\n* Since RVM doesn't support windows, the tasks will call the global executables. Meaning if you have multiple Ruby installed, the first executable found on the PATH will be used.\n* Windows may not deal with single and double quotes in the same way as Linux. This is especially apparent when using `bundle exec` before the actual command, which happens automatically for rake and script job_types. Make sure to test on both environment that the behavior is as expected. Also, see the section Ruby-Windows bug.\n* See the section Ruby-Windows bug.\n\n## Ruby-Windows bug\nThere is currently a bug in Ruby ([#10128](https://bugs.ruby-lang.org/issues/10128)) related to argument passing through functions such as Kernel.exec, Kernel.system, which makes arguments be split around metacharacters by Windows when they shouldn't. This can be a problem when using bundle exec, which happens for the `rake` and `script` job_types. \n\nAs an example, in your console on Windows, the following will all fail because `bundle exec` relies on Kernel.exec. It will try to call the command world]: \n```\n    bundle exec rake my_task[hello\u0026world]\n    bundle exec rake my_task[\"hello\u0026world\"]\n    bundle exec rake \"my_task[hello\u0026world]\"\n```\n\nThe problematic metacharacters are the following: \n\n* \u003c\u003e\u0026|;\n* the ^ gets removed\n* the \" is not escaped correctly, most likely breaking things. (no workaround)\n\nThe workaround is to have a space somewhere in the argument that contains those characters, Ruby will then wrap those parameters in quote and things will got correctly. For rake tasks, this can usually be handled easily by adding an empty parameter, which won't even be considered by rake. (no need to change your task). The above would work as `bundle exec rake \"my_task[hello\u0026world, ]\"`.\n\nIn your schedule, your line for the rake task should therefore include the double quotes: \n\n```\nrake '\"my_task[hello\u0026world, ]\"'\n```\n\n\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Run test (`bundle install` followed by `rake`).\n4. Commit your changes (`git commit -am 'Add some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlap%2Fwinever","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxlap%2Fwinever","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlap%2Fwinever/lists"}