Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/listen/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class CLI < Thor

class_option :directory,
type: :array,
default: '.',
default: ['.'],
aliases: '-d',
banner: 'The directory to listen to'
banner: 'One or more directories to listen to'

class_option :relative,
type: :boolean,
Expand Down Expand Up @@ -55,7 +55,7 @@ def start
end
end

listener = Listen.to(directory, relative: relative, &callback)
listener = Listen.to(*directory, relative: relative, &callback)

listener.start

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/listen/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
let(:options) { %w[] }
it 'is set to local directory' do
expect(Listen::Forwarder).to receive(:new) do |options|
expect(options[:directory]).to eq('.')
expect(options[:directory]).to eq(['.'])
forwarder
end
described_class.start(options)
Expand Down Expand Up @@ -108,7 +108,7 @@
it 'passes relative option to Listen' do
value = double('value')
expect(Listen).to receive(:to).
with(nil, hash_including(relative: value)).
with(hash_including(relative: value)).
and_return(listener)

described_class.new(relative: value).start
Expand Down