-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prototype version and rename to Rexer
- Loading branch information
1 parent
5d3972a
commit 1d05dc2
Showing
52 changed files
with
1,376 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- "dev/**" | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.3" | ||
bundler-cache: true | ||
|
||
- name: Lint | ||
run: bundle exec rake standard | ||
|
||
- name: Set up test | ||
run: bundle exec rake rexer:test:build_integration_test_image | ||
|
||
- name: Run tests | ||
run: bundle exec rake test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ | |
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
/Gemfile.lock | ||
/*.gem |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in redminep.gemspec | ||
gemspec | ||
|
||
gem "rake", "~> 13.0" | ||
|
||
gem "test-unit", "~> 3.0" | ||
|
||
gem "standard", "~> 1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "rake/testtask" | ||
require "standard/rake" | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << "test" | ||
t.libs << "lib" | ||
t.test_files = FileList["test/**/*_test.rb"] | ||
t.warning = false | ||
end | ||
|
||
require "standard/rake" | ||
|
||
task default: %i[test standard] | ||
|
||
namespace :rexer do | ||
namespace :test do | ||
desc "Build the integration test image" | ||
task :build_integration_test_image do | ||
system "docker build -f test/integration/Dockerfile -t rexer-test .", exception: true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require_relative "../lib/rexer" | ||
|
||
Rexer::Cli.start(ARGV) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require "rexer" | ||
|
||
begin | ||
Rexer::Cli.start(ARGV) | ||
rescue => e | ||
puts "ERROR (#{e.class}): #{e.message}" | ||
puts e.backtrace if ENV["VERBOSE"] | ||
exit 1 | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Rexer | ||
def self.definition_file | ||
".extensions.rb" | ||
end | ||
|
||
def self.definition_lock_file | ||
".extensions.lock" | ||
end | ||
end | ||
|
||
require "pathname" | ||
require "zeitwerk" | ||
|
||
loader = Zeitwerk::Loader.for_gem | ||
loader.setup | ||
loader.eager_load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require "thor" | ||
|
||
module Rexer | ||
class Cli < Thor | ||
def self.exit_on_failure? = true | ||
|
||
class_option :verbose, type: :boolean, aliases: "-v", desc: "Detailed output" | ||
|
||
desc "install [ENV]", "Install the definitions in .extensions.rb for the specified environment" | ||
def install(env = "default") | ||
Commands::Install.new.call(env&.to_sym) | ||
end | ||
|
||
desc "uninstall", "Uninstall extensions for the currently installed environment based on the state in .extensions.lock and remove the lock file" | ||
def uninstall | ||
Commands::Uninstall.new.call | ||
end | ||
|
||
desc "switch [ENV]", "Uninstall extensions for the currently installed environment and install extensions for the specified environment" | ||
def switch(env = "default") | ||
Commands::Switch.new.call(env&.to_sym) | ||
end | ||
|
||
desc "update", "Update extensions for the currently installed environment to the latest version" | ||
def update | ||
Commands::Update.new.call | ||
end | ||
|
||
desc "state", "Show the current state of the installed extensions" | ||
def state | ||
Commands::State.new.call | ||
end | ||
|
||
desc "version", "Show Rexer version" | ||
def version | ||
puts Rexer::VERSION | ||
end | ||
|
||
def initialize(*) | ||
super | ||
initialize_options | ||
end | ||
|
||
private | ||
|
||
def initialize_options | ||
ENV["VERBOSE"] = "1" if options[:verbose] | ||
end | ||
end | ||
end |
Oops, something went wrong.