{"id":15603337,"url":"https://github.com/hidakatsuya/rexer","last_synced_at":"2025-04-24T07:35:42.721Z","repository":{"id":253009578,"uuid":"823184758","full_name":"hidakatsuya/rexer","owner":"hidakatsuya","description":"A command-line tool for managing Redmine Extension (Plugin and Theme)","archived":false,"fork":false,"pushed_at":"2025-04-22T15:11:23.000Z","size":1238,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T16:30:45.148Z","etag":null,"topics":["redmine","redmine-plugin","redmine-theme"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rexer","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/hidakatsuya.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,"zenodo":null}},"created_at":"2024-07-02T14:41:37.000Z","updated_at":"2025-04-22T15:11:25.000Z","dependencies_parsed_at":"2024-08-14T05:49:23.061Z","dependency_job_id":"964d6563-dc1f-46d1-88e1-c053cc62af6b","html_url":"https://github.com/hidakatsuya/rexer","commit_stats":{"total_commits":70,"total_committers":2,"mean_commits":35.0,"dds":0.05714285714285716,"last_synced_commit":"876852f170bc8f6cb128a8621924090f0e4f322c"},"previous_names":["hidakatsuya/remer","hidakatsuya/rexer"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidakatsuya%2Frexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidakatsuya%2Frexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidakatsuya%2Frexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidakatsuya%2Frexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hidakatsuya","download_url":"https://codeload.github.com/hidakatsuya/rexer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250583779,"owners_count":21454067,"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":["redmine","redmine-plugin","redmine-theme"],"created_at":"2024-10-03T03:02:44.456Z","updated_at":"2025-04-24T07:35:42.707Z","avatar_url":"https://github.com/hidakatsuya.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eRexer\u003c/h1\u003e\n  \u003cp\u003eRedmine Extension (Plugin and Theme) manager\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/hidakatsuya/rexer/actions/workflows/build.yml\"\u003e\n    \u003cimg src=\"https://github.com/hidakatsuya/rexer/actions/workflows/build.yml/badge.svg\" alt=\"Build\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://badge.fury.io/rb/rexer\"\u003e\n    \u003cimg src=\"https://badge.fury.io/rb/rexer.svg\" alt=\"Gem Version\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nRexer is a command-line tool for managing Redmine Extension (Plugin and Theme).\n\nIt is mainly aimed at helping with the development of Redmine and its plugins, allowing you to define extensions in a Ruby DSL and install, uninstall, update, and switch between different sets of the extensions.\n\n## What is Redmine Extension?\n\nRedmine [Plugin](https://www.redmine.org/projects/redmine/wiki/Plugins) and [Theme](https://www.redmine.org/projects/redmine/wiki/Themes) are called Redmine Extension in this tool.\n\n## Installation\n\n```\ngem install rexer\n```\n\n## Supported Redmine\n\nRexer is tested with Redmine v6.0 and trunk.\n\n## Usage\n\nRun the following command in the root directory of the Redmine application.\n\n```\nrex init\n```\n\nThis command generates a `.extensions.rb`, so define the extensions you want to install in the file like below.\n\n```ruby\ntheme :bleuclair, github: { repo: \"farend/redmine_theme_farend_bleuclair\", branch: \"master\" }\n\nplugin :redmine_issues_panel, git: { url: \"https://github.com/redmica/redmine_issues_panel\", tag: \"v1.0.2\" }\nplugin :redmica_ui_extension, github: { repo: \"redmica/redmica_ui_extension\", ref: \"4fdc298bc310be2ab295008c0ee522b0ec0e319a\" }\n```\n\nThen, run the following command in the root directory of the Redmine application.\n\n```\nrex install\n```\n\nThis command performs the following steps for each extension defined in the `.extensions.rb` to install it and generates a `.extensions.lock`.\n\nFor plugins:\n* Load the plugin from the specified `git` or `github` repository.\n* Run the `bundle install` command if the plugin has a `Gemfile`.\n* Run the `bundle exec rake redmine:plugins:migrate NAME=\u003cplugin_name\u003e` command if the plugin has any database migration.\n\nFor themes:\n* Load the theme from the specified `git` or `github` repository.\n\n\u003e [!NOTE]\n\u003e The `.extensions.lock` is a file for preserving the state of installed extensions, but not the version of an extension.\n\nIf you want to uninstall the extensions, run the following command.\n\n```\nrex uninstall\n```\n\nThis command uninstalls the extensions and deletes the `.extensions.lock`.\n\n## Commands\n\n```\n$ rex\nCommands:\n  rex edit                    # Edit .extensions.rb\n  rex envs                    # Show the list of environments and their extensions defined in .extensions.rb\n  rex help [COMMAND]          # Describe available commands or one specific command\n  rex init                    # Create a new .extensions.rb file\n  rex install [env]           # Install the definitions in .extensions.rb for the specified environment\n  rex reinstall [extension]   # Uninstall extensions for the currently installed environment and install them again\n  rex state                   # Show the current state of the installed extensions\n  rex switch [env]            # Uninstall extensions for the currently installed environment and install extensions for the specified environment\n  rex uninstall               # Uninstall extensions for the currently installed environment based on the state in .extensions.lock and remove the lock file\n  rex update [extensions...]  # Update extensions for the currently installed environment to the latest version if extensions are updateable. If no extensions are specified, all extensions are updated\n  rex version                 # Show Rexer version\n\nOptions:\n  -v, [--verbose], [--no-verbose], [--skip-verbose]  # Detailed output\n  -q, [--quiet], [--no-quiet], [--skip-quiet]        # Minimal output\n```\n\n### rex install [env]\n\nInstalls extensions in the specified ENV environment and makes them available for use. Specifically, it does the following:\n\nIf the specified ENV is NOT currently installed, it adds all extensions in the ENV environment in `.extensions.rb`.\n\nIf the specified ENV is currently installed, it compares the current `.extensions.lock` with `.extensions.rb` and does the following:\n* Installs additional extensions (the `installed` hook is executed).\n* Uninstalls deleted extensions (the `uninstalled` hook is executed).\n* Reload extensions whose source settings has changed (for example, the `branch` or `tag` has changed) and runs the database migration if necessary.\n\n\u003e [!TIP]\n\u003e Execute the install command when running the rex command without a subcommand.\n\n### rex update [extensions...]\n\nLoads `.extensions.lock` and updates the currently installed extensions to the latest version. `.extensions.rb` is NOT referenced in this command.\n\n### Short commands available\n\nThe command to execute is determined by a forward match, so you can use like the following short commands.\n\n```\nrex ins # means install\nrex st  # maens state\nrex sw  # means switch\nrex e   # means envs\nrex v   # means version\n\nand more...\n```\n\n## Advanced Usage\n\n### Defining for each environment and extension\n\nYou can define an environment and extensions for each environment using the `env ... do - end` block.\n\n```ruby\nplugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\", branch: \"master\" }\n\nenv :stable do\n  plugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\", tag: \"v1.0.2\" }\nend\n\nenv :default, :stable do\n  theme :bleuclair, github: { repo: \"farend/redmine_theme_farend_bleuclair\" }\nend\n```\n\nDefinitions other than `env ... do - end` are implicitly defined as `env :default do - end`. Therefore, the above is resolved as follows:\n\n* default env\n  * bleuclair (farend/redmine_theme_farend_bleuclair@main)\n  * redmine_issues_panel (redmica/redmine_issues_panel@master)\n* stable env\n  * bleuclair (farend/redmine_theme_farend_bleuclair@main)\n  * redmine_issues_panel (redmica/redmine_issues_panel@v1.0.2)\n\nIf you want to install extensions for the `default` environment, run the following command.\n\n```\nrex install\nor\nrex install default\n```\n\nSimilarly, if you want to install extensions for the `stable` environment, run the following command.\n\n```\nrex install stable\n```\n\nIn addition, you can switch between environments.\n\n```\nrex switch stable\nor\nrex install stable\n```\n\nThe above command uninstalls the extensions for the currently installed environment and installs the extensions for the `stable` environment.\n\nIn addition, you can define as many environments as you like, and list the defined environments with the `rex envs` command.\n\n```\n$ rex envs\ndefault\n  bleuclair (farend/redmine_theme_farend_bleuclair@main)\n  redmine_issues_panel (redmica/redmine_issues_panel@master)\n\nstable\n  bleuclair (farend/redmine_theme_farend_bleuclair@main)\n  redmine_issues_panel (redmica/redmine_issues_panel@v1.0.2)\n```\n\n### Defining hooks\n\nYou can define hooks for each extension.\n\n```ruby\nplugin :redmica_s3, github: { repo: \"redmica/redmica_s3\" } do\n  installed do\n    Pathname.new(\"config\", \"s3.yml\").write \u003c\u003c~YAML\n      access_key_id: ...\n    YAML\n  end\n\n  uninstalled do\n    Pathname.new(\"config\", \"s3.yml\").delete\n  end\nend\n```\n\n### Configuring the command prefix\n\nYou can set a prefix for the commands such as `bundle install` that Rexer executes with the `REXER_COMMAND_PREFIX` environment variable.\n\n```\nexport REXER_COMMAND_PREFIX=\"docker compose exec -T app\"\n```\n\nIn the above case, the `bin/rails redmine:plugins:migrate` command is executed as `docker compose exec -T app bin/rails redmine:plugins:migrate`.\n\n## Extensions.rb Syntax\n\n### Plugin\n\n```ruby\nplugin :plugin_name, \u003csource\u003e: { ... }\n```\n\n### Theme\n\n```ruby\ntheme :theme_name, \u003csource\u003e: { ... }\n```\n\n### Source\n\n#### Git\n\n```ruby\nplugin :redmine_issues_panel, git: { url: \"https://github.com/redmica/redmine_issues_panel\" }\n```\n```ruby\n# Specify the branch\nplugin :redmine_issues_panel, git: { url: \"https://github.com/redmica/redmine_issues_panel\", branch: \"main\" }\n# Specify the tag\nplugin :redmine_issues_panel, git: { url: \"https://github.com/redmica/redmine_issues_panel\", tag: \"v1.0.0\" }\n# Specify the commit\nplugin :redmine_issues_panel, git: { url: \"https://github.com/redmica/redmine_issues_panel\", ref: \"5cfb8ccbabb2fad2c8f2273a4dda3f16ef2de124\" }\n```\n\n#### GitHub\n\n```ruby\nplugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\", tag: \"v1.0.0\" }\n```\n\n### Env\n\n```ruby\nplugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\" }\n\n# This is the same as the above.\nenv :default do\n  plugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\" }\nend\n\nenv :stable do\n  plugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\", tag: \"v1.0.2\" }\nend\n\nenv :default, :stable do\n  theme :bleuclair, github: { repo: \"farend/redmine_theme_farend_bleuclair\" }\nend\n```\n\n### Hooks\n\n```ruby\nplugin :redmine_issues_panel, github: { repo: \"redmica/redmine_issues_panel\" } do\n  installed do\n    puts \"The plugin has been installed.\"\n  end\n\n  uninstalled do\n    puts \"The plugin has been uninstalled.\"\n  end\nend\n\ntheme :bleuclair, github: { repo: \"farend/redmine_theme_farend_bleuclair\" } do\n  installed do\n    puts \"The theme has been installed.\"\n  end\n\n  uninstalled do\n    puts \"The theme has been uninstalled.\"\n  end\nend\n```\n\n## Developing\n\n### Running the command\n\nYou can run the command in your local environment without installing the gem as follows.\n\nSetting up the development environment.\n\n```\n$ git clone \u003cthis repository\u003e\n$ cd rexer\n$ bundle install\n```\n\nRunning the command.\n\n```\n$ cd /path/to/your-local-redmine-source\n$ /your-local-rexer-source/bin/dev state\n```\n\n### Running tests\n\nFirst, you need to build the docker image for the integration tests.\n\n```\nrake test:prepare_integration\n```\n\nThen, you can run all tests.\n\n```\nrake test\n```\n\nOr, you can only the integration tests as follows.\n\n```\nrake test:integration\n```\n\n### Formatting and Linting code\n\nThis project uses [Standard](https://github.com/standardrb/standard) for code formatting and linting. You can format and check the code by running the following commands.\n\n```\nrake standard\nrake standard:fix\n```\n\n### Profiling\n\nPrint the call-stack profile.\n\n```\n$ PROFILE=s /your-local-rexer-source/bin/dev state\n...\n\n== Profile ==\n==================================\n  Mode: wall(1000)\n  Samples: 298 (1.97% miss rate)\n  GC: 36 (12.08%)\n==================================\n     TOTAL    (pct)     SAMPLES    (pct)     FRAME\n       261  (87.6%)         147  (49.3%)     Kernel#require\n       ...\n```\n\nPrint the benchmark.\n\n```\n$ PROFILE=b /your-local-rexer-source/bin/dev state\n...\n\n== Benchmark ==\n      user     system      total        real\n  0.253115   0.030599   0.283714 (  0.283681)\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/hidakatsuya/rexer.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidakatsuya%2Frexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidakatsuya%2Frexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidakatsuya%2Frexer/lists"}