splat 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/splat.rb +24 -14
  2. metadata +2 -2
data/lib/splat.rb CHANGED
@@ -2,20 +2,26 @@ class Splat
2
2
  attr_reader :platform
3
3
 
4
4
  def initialize
5
- @platform = :unknown
6
- if Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
7
- @platform = :win32
8
- require 'splat/win32_clipboard'
9
- @clipboard = Splat::Win32Clipboard.new
10
- require 'splat/win32_launcher'
11
- @launcher = Splat::Win32Launcher.new
12
- end
13
- if Config::CONFIG['host_os'] =~ /darwin10/i
14
- @platform = :macosx
15
- require 'splat/darwin10_clipboard'
16
- @clipboard = Splat::Darwin10Clipboard.new
17
- require 'splat/darwin10_launcher'
18
- @launcher = Splat::Darwin10Launcher.new
5
+ case Config::CONFIG['host_os']
6
+ when /mswin|win32|dos|cygwin|mingw/i
7
+ @platform = :win32
8
+ require 'splat/win32_clipboard'
9
+ @clipboard = Splat::Win32Clipboard.new
10
+ require 'splat/win32_launcher'
11
+ @launcher = Splat::Win32Launcher.new
12
+ require 'watir'
13
+ @browser_class = Watir::IE
14
+ when /darwin10/i
15
+ @platform = :macosx
16
+ require 'splat/darwin10_clipboard'
17
+ @clipboard = Splat::Darwin10Clipboard.new
18
+ require 'splat/darwin10_launcher'
19
+ @launcher = Splat::Darwin10Launcher.new
20
+ require 'safariwatir'
21
+ @browser_class = Watir::Safari
22
+ else
23
+ @platform = :unknown
24
+ puts "I have no idea how to cope with \"#{Config::CONFIG['host_os']}\""
19
25
  end
20
26
  end
21
27
 
@@ -27,6 +33,10 @@ class Splat
27
33
  @clipboard.content = content if @clipboard
28
34
  end
29
35
 
36
+ def browser
37
+ @browser_class.new if @browser_class
38
+ end
39
+
30
40
  def launch content
31
41
  @launcher.launch content if @launcher
32
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Ryall
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-31 00:00:00 +11:00
12
+ date: 2010-02-06 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies: []
15
15