Skip to content

Commit

Permalink
Merge pull request #463 from cablegram/windows-fix-dev-null-2
Browse files Browse the repository at this point in the history
Replace use of '/dev/null' with DEV_NULL throughout the gem
  • Loading branch information
thibaudgg committed Jul 15, 2013
2 parents 9313615 + 6b87a62 commit 0e7a284
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/guard/interactor.rb
Expand Up @@ -120,7 +120,7 @@ def add_hooks

if stty_exists?
Pry.config.hooks.add_hook :after_eval, :restore_visibility do
system('stty echo 2>/dev/null')
system("stty echo 2>#{ DEV_NULL }")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/notifiers/tmux.rb
Expand Up @@ -164,7 +164,7 @@ def turn_off(options = { })
private

def system(args)
args += " >/dev/null 2>&1" if ENV['GUARD_ENV'] == 'test'
args += " >#{ DEV_NULL } 2>&1" if ENV['GUARD_ENV'] == 'test'
super
end

Expand Down
8 changes: 4 additions & 4 deletions spec/guard/watcher_spec.rb
Expand Up @@ -78,7 +78,7 @@
described_class.new('hash.rb', lambda { Hash[:foo, 'bar'] }),
described_class.new('array.rb', lambda { ['foo', 'bar'] }),
described_class.new('blank.rb', lambda { '' }),
described_class.new(/^uptime\.rb/, lambda { `uptime > /dev/null` })
described_class.new(/^uptime\.rb/, lambda { `uptime > #{ DEV_NULL }` })
]
end

Expand Down Expand Up @@ -115,7 +115,7 @@
described_class.new('hash.rb', lambda { Hash[:foo, 'bar'] }),
described_class.new('array.rb', lambda { ['foo', 'bar'] }),
described_class.new('blank.rb', lambda { '' }),
described_class.new(/^uptime\.rb/, lambda { `uptime > /dev/null` })
described_class.new(/^uptime\.rb/, lambda { `uptime > #{ DEV_NULL }` })
]
end

Expand Down Expand Up @@ -156,7 +156,7 @@
described_class.new('hash.rb', lambda { |m| Hash[:foo, 'bar'] }),
described_class.new(/array(.*)\.rb/, lambda { |m| ['foo', 'bar'] }),
described_class.new(/blank(.*)\.rb/, lambda { |m| '' }),
described_class.new(/uptime(.*)\.rb/, lambda { |m| `uptime > /dev/null` })
described_class.new(/uptime(.*)\.rb/, lambda { |m| `uptime > #{ DEV_NULL }` })
]
end

Expand Down Expand Up @@ -193,7 +193,7 @@
described_class.new('hash.rb', lambda { |m| Hash[:foo, 'bar', :file_name, m[0]] }),
described_class.new(/array(.*)\.rb/, lambda { |m| ['foo', 'bar', m[0]] }),
described_class.new(/blank(.*)\.rb/, lambda { |m| '' }),
described_class.new(/uptime(.*)\.rb/, lambda { |m| `uptime > /dev/null` })
described_class.new(/uptime(.*)\.rb/, lambda { |m| `uptime > #{ DEV_NULL }` })
]
end

Expand Down

0 comments on commit 0e7a284

Please sign in to comment.