ask_stack 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/ask_stack.gemspec +1 -1
  2. data/bin/ask_stack +14 -1
  3. metadata +1 -1
@@ -2,7 +2,7 @@
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "ask_stack"
5
- s.version = '0.0.3'
5
+ s.version = '0.0.4'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.required_ruby_version = '>= 1.9.0'
8
8
 
@@ -1,10 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'ask_stack'
3
3
 
4
+
5
+ if `which java` == ''
6
+ abort "ask_stack require Java. Please install Java."
7
+ end
8
+
4
9
  if ARGV.first == '-s'
5
10
  jarfile = File.join(File.dirname(__FILE__), '..', 'vendor/selenium-server-standalone-2.0b3.jar')
6
11
  exec("java -jar #{jarfile}")
7
12
  exit
8
13
  end
9
14
 
10
- AskStack.run
15
+ if STDIN.tty?
16
+ abort "Usage: ask_stack < question.txt\n\nPlease see README https://github.com/danchoi/ask_stack"
17
+ end
18
+
19
+ begin
20
+ AskStack.run
21
+ rescue Errno::ECONNREFUSED
22
+ abort "Selenium stand-alone server appears not to be running.\nRun with ask_stack -s in another window."
23
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ask_stack
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Choi