conch 0.0.6 → 0.0.7

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 (4) hide show
  1. data/conch.gemspec +1 -1
  2. data/lib/client.rb +12 -0
  3. data/lib/conch.rb +1 -1
  4. metadata +2 -2
data/conch.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'conch'
3
- s.version = '0.0.6'
3
+ s.version = '0.0.7'
4
4
  s.summary = 'shell in the browser'
5
5
  s.authors = ['limadelic']
6
6
  s.email = 'limadelic@gmail.com'
data/lib/client.rb CHANGED
@@ -3,6 +3,18 @@ require 'em-websocket'
3
3
  module Client
4
4
 
5
5
  def self.run socket, cmd
6
+ if respond_to? cmd
7
+ send cmd
8
+ else
9
+ shell socket, cmd
10
+ end
11
+ end
12
+
13
+ def self.exit
14
+ exit! true
15
+ end
16
+
17
+ def self.shell socket, cmd
6
18
  socket.send `#{cmd}`
7
19
  rescue
8
20
  socket.send ''
data/lib/conch.rb CHANGED
@@ -2,7 +2,7 @@ require_relative 'client'
2
2
 
3
3
  home = 'http://www.c0nch.com'
4
4
 
5
- `start chrome --app=#{home}`
6
5
  Client.start
6
+ `start chrome --app=#{home}`
7
7
 
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-27 00:00:00.000000000 Z
12
+ date: 2013-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: em-websocket