Class: Guard::Jasmine::CLI
- Inherits:
-
Thor
- Object
- Thor
- Guard::Jasmine::CLI
- Extended by:
- Util
- Defined in:
- lib/guard/jasmine/cli.rb
Overview
Small helper class to run the Jasmine runner_options once from the command line. This can be useful to integrate guard-jasmine into a continuous integration server.
This outputs the specdoc and disables any notifications.
Instance Method Summary collapse
-
#spec(*paths) ⇒ Object
Run the Guard::Jasmine::Runner with options from the command line.
-
#version ⇒ Object
Shows the current version of Guard::Jasmine.
Methods included from Util
find_free_server_port, phantomjs_bin_valid?, runner_available?, which
Instance Method Details
#spec(*paths) ⇒ Object
Run the Guard::Jasmine::Runner with options from the command line.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/guard/jasmine/cli.rb', line 164 def spec(*paths) = paths = [[:spec_dir]] if paths.empty? if CLI.phantomjs_bin_valid?([:phantomjs_bin]) catch(:task_has_failed) do ::Guard::Jasmine::Server.start() unless [:server] == :none end if CLI.runner_available?() result = ::Guard::Jasmine::Runner.new().run(paths) ::Guard::Jasmine::Server.stop Process.exit result.empty? ? 0 : 1 else Process.exit 2 end else Process.exit 2 end rescue => e Compat::UI.error "Something went wrong: #{e.}" Process.exit 2 ensure ::Guard::Jasmine::Server.stop end |
#version ⇒ Object
Shows the current version of Guard::Jasmine.
197 198 199 |
# File 'lib/guard/jasmine/cli.rb', line 197 def version Compat::UI.info "Guard::Jasmine version #{::Guard::JasmineVersion::VERSION}" end |