Skip to content

Commit cc99031

Browse files
committed
Replace Thor with Rake
1 parent 92a192d commit cc99031

File tree

7 files changed

+22
-119
lines changed

7 files changed

+22
-119
lines changed

exe/boxing

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
# frozen_string_literal: true
33

44
require 'boxing'
5+
require 'rake'
56

6-
Boxing::Command.start(ARGV)
7+
Rake.application = Boxing::Command.new
8+
Rake.application.run

lib/boxing/command.rb

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
# frozen_string_literal: true
22

3-
require 'thor'
3+
require 'rake'
44

55
module Boxing
66
# The Main Command
77
#
88
# @since 0.1.0
9-
class Command < Thor
10-
# :nodoc:
11-
def self.exit_on_failure?
12-
true
9+
class Command < Rake::Application
10+
# @since 0.11.0
11+
TASK_ROOT = File.expand_path('./tasks', __dir__)
12+
13+
# @see Rake::Application#run
14+
def run(argv = ARGV)
15+
standard_exception_handling do
16+
init('boxing', argv)
17+
load_rakefile
18+
top_level
19+
end
1320
end
1421

15-
require_relative 'commands/base'
16-
require_relative 'commands/generate'
17-
require_relative 'commands/compose'
18-
require_relative 'commands/update'
22+
# @see Rake::Application#load_rakefile
23+
def load_rakefile
24+
glob("#{TASK_ROOT}/**/*.rake").each { |task| add_import task }
25+
load_imports
26+
end
1927
end
2028
end

lib/boxing/commands/base.rb

-35
This file was deleted.

lib/boxing/commands/compose.rb

-24
This file was deleted.

lib/boxing/commands/generate.rb

-26
This file was deleted.

lib/boxing/commands/update.rb

-24
This file was deleted.

lib/boxing/generator.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require 'tempfile'
4+
35
module Boxing
46
# Generate file from template
57
#

0 commit comments

Comments
 (0)