ruby on rails - Running gntp only on certain development VMs -
i'm doing rails development on virtual machine setup that's similar vagrant. it's portable have same ubuntu based virtual machine @ home , @ work - made copy of @ given moment.
my problem have set guard notify growl on mac @ home, since i'm on windows @ work disable notification feature on vm running on windows host.
here's line in question in guardfile.
notification :gntp, :host => '192.168.1.139' any ideas on how disable on 1 of vms?
from top of head, 1 thing that's different on 2 vms ip address guess modify hostname.
update
i half solved this, modifying above line to:
notification :gntp, :host => '192.168.1.139' if socket.gethostname == 'railsbox' # 'railsbox' vm on mac, renamed vm on windows 'railsbox-win' at least way doesn't try notify ip address tries localhost (which default behaviour). still error @ end of each spec run @ least won't hang precious seconds. error is:
error - error sending notification gntp: connection refused - connect(2) the question becomes how disable gntp on vm running on windows?
the reason why you're getting error in second case that, guard automatically selects available notifier going through installed ones on box(es). so, 1 way functionality want create 2 separate environments.
say, macdev , windev on computer , windows machine respectively, , in gemfile, you'd add gntp gem in group :macdev {..} part. more on creating custom environments in rails: http://railscasts.com/episodes/72-adding-an-environment
# gemfile group :macdev gem 'ruby_gntp' end group :windev # windows-specific notification gem, may be. end this should fix it.
alternatively, create environment variable each of vms:
# on mac export vm = "mac" # , similar command on windows. and in guardfile,
# guardfile notification :off if env['vm'] == "win" notification :gntp, :host => '192.168.1.139' if env['vm'] == "mac"
Comments
Post a Comment