mosbot 0.2.1 → 0.2.2

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. checksums.yaml +4 -4
  2. data/lib/mosbot.rb +41 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40f9c28a79bfbe8f0d5e6c0d64476ab0572e2043
4
- data.tar.gz: 11be776b9c4449857bf25dbba409805b86477075
3
+ metadata.gz: 24a00fa0645f53dcee744c19108591d4e68adee9
4
+ data.tar.gz: 39709fe845ce6e4106f3d9b93804b6a911b5e769
5
5
  SHA512:
6
- metadata.gz: fc0c714e5ad72d6c039c32d3629f24a4706071ad9c0e71f74fbcd0a94ea35cb16b8f512159c92151d24a5fe38f46e56b21e738e88582a87bdc790b335e3a9180
7
- data.tar.gz: 732f8f1425fc61642328a84f1d7f4dba5c4d89451a8730f5e4f40fe658bcf5815b91352cad7d8e73b392343487265a4d863101a6cc7748d3901c461092a198c2
6
+ metadata.gz: fe9b593938d4cfdcdafbf8462d38c53df6ed2b52a88ee8bb7190cdf9d77fce9d7c1f418513a738312af93167adcf09a2e84318881bbc748e3e26b156352e1f13
7
+ data.tar.gz: 0a6fc6c71ce62d773c62e7896409dc7a9c12f6ae0f6ef554e5bb7d7b8488d433fbd980882250fa36f7ebbe751bc68d7777d48d835e0dd9b91f213cb6d7e89994
data/lib/mosbot.rb ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rbconfig'
4
+
5
+ def os
6
+ @os ||= (
7
+ host_os = RbConfig::CONFIG['host_os']
8
+ case host_os
9
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
10
+ :windows
11
+ when /darwin|mac os/
12
+ :macosx
13
+ when /linux/
14
+ :linux
15
+ when /solaris|bsd/
16
+ :unix
17
+ else
18
+ raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
19
+ end
20
+ )
21
+ end
22
+
23
+ def handle_output(url)
24
+ puts url
25
+ if "#{MOS_COPY_URL}" == "true"
26
+ case "#{OS_CONST}"
27
+ when "macosx", "linux"
28
+ out = `echo "#{url}" | pbcopy`
29
+ when "windows"
30
+ out = `echo "#{url}" | clip`
31
+ end
32
+ end
33
+ if "#{MOS_OPEN_URL}" == "true"
34
+ case "#{OS_CONST}"
35
+ when "macosx"
36
+ out = `open #{url}`
37
+ when "windows"
38
+ out = `start #{url}`
39
+ end
40
+ end
41
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mosbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Iverson
@@ -20,6 +20,7 @@ extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
22
  - bin/mosbot
23
+ - lib/mosbot.rb
23
24
  homepage: https://github.com/psadmin-io/mosbot-cli
24
25
  licenses:
25
26
  - MIT