class WhosIn::Application

Public Class Methods

open_app() click to toggle source
# File lib/whos_in.rb, line 37
def self.open_app
        puts "Opening your application"
        sleep 2
        `open #{@heroku_app}`
        sleep 3
end
run_app(app_name) click to toggle source
# File lib/whos_in.rb, line 44
def self.run_app app_name
        @heroku_app = "http://#{app_name}.herokuapp.com"
        @heroku_url = @heroku_app + "/people"
        self.open_app
        self.run_script
end
run_script() click to toggle source
# File lib/whos_in.rb, line 28
def self.run_script
        tell_user_and_scan_network
        scheduler = Rufus::Scheduler.new
        scheduler.every '2m' do
                tell_user_and_scan_network
        end
        scheduler.join
end
tell_user_and_scan_network() click to toggle source

MAKE RUN SCRIPT

# File lib/whos_in.rb, line 20
def self.tell_user_and_scan_network
        script =  File.expand_path('../../bin/local_scanner', __FILE__)

        puts "Scanning local network and posting to #{@heroku_url}"
        puts "Press Ctrl+C to interrupt"
        `#{script} #{@heroku_url}`
end

Public Instance Methods

launch_heroku_deploy() click to toggle source
# File lib/whos_in.rb, line 8
def launch_heroku_deploy
        puts "Launching deployment setup... \n\n When you're done run 'whos_in run *your_app_name* " 
        sleep 2
        `open https://heroku.com/deploy?template=https://github.com/jpatel531/whos_in`
end
setup() click to toggle source
# File lib/whos_in.rb, line 14
def setup
        launch_heroku_deploy
end