Skip to content

Commit 41ac68c

Browse files
committed
🔧 Add ability to change cuberfile path
1 parent ee294e2 commit 41ac68c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/cuber/cli.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
module Cuber
1313
class CLI
1414

15-
def initialize
15+
def initialize(file_path = 'Cuberfile')
1616
@options = {}
1717
parse_command!
18-
parse_cuberfile
18+
parse_cuberfile(file_path)
1919
validate_cuberfile
2020
execute
2121
end
@@ -26,9 +26,9 @@ def parse_command!
2626
@options[:cmd] = ARGV.shift&.to_sym
2727
end
2828

29-
def parse_cuberfile
30-
abort 'Cuberfile not found in current directory' unless File.exist? 'Cuberfile'
31-
content = File.read 'Cuberfile'
29+
def parse_cuberfile(file_path)
30+
abort 'Cuberfile not found in current directory' unless File.exist? file_path
31+
content = File.read file_name
3232
parser = CuberfileParser.new
3333
parser.instance_eval(content)
3434
cuberfile_options = parser.instance_variables.map do |name|

0 commit comments

Comments
 (0)