Sha256: cf475117062d52921ff29ed79d3e0e86929f4f9fe59e9024895318bf8a1e9e12

Contents?: true

Size: 695 Bytes

Versions: 24

Compression:

Stored size: 695 Bytes

Contents

require "timeout"

module Frank
    class MacLauncher

        def initialize(app_path)
            @app_path = app_path
        end

        def launch
            `open "#{@app_path}"`
        end

        def quit_if_running
            pid = `ps -ax | grep "#{@app_path}" | grep -v grep`

            if pid != ""
                pid = pid.strip.split[0]
                `kill #{pid}`
            end

            Timeout::timeout(60) {
                while pid != ""
                    pid = `ps -ax | grep "#{@app_path}" | grep -v grep`
                end
            }

        end

        def relaunch
            self.quit_if_running
            self.launch
        end
    end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
sc-frank-ios-1.2.3 lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.bba52d7.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.e1e3ccb.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.1a856ca.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.b7791c5.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.3256dc1.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.9c95c03.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.1dcc760.debug lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.1dcc760 lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.902fa34 lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.d2d00d2 lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.c13cb90 lib/frank-cucumber/mac_launcher.rb
sc-frank-cucumber-1.2.1.00af28c lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.2.0 lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.2.0.pre1 lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.1.13.pre1 lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.1.12 lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.1.11.pre1 lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.1.10 lib/frank-cucumber/mac_launcher.rb
frank-cucumber-1.1.9.pre1 lib/frank-cucumber/mac_launcher.rb