conch 0.0.4 → 0.0.5

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 (6) hide show
  1. data/LICENSE.txt +22 -0
  2. data/README.md +13 -0
  3. data/Rakefile +1 -0
  4. data/conch.gemspec +4 -1
  5. data/lib/conch.rb +14 -3
  6. metadata +39 -3
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 mike suarez
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,13 @@
1
+ ![logo](https://raw.github.com/limadelic/conch/master/docs/banner.png)
2
+ > drive your computer from your browser
3
+ > (like a boss)
4
+
5
+ ## Install
6
+ ```
7
+ > gem install conch
8
+ ```
9
+
10
+ ## Run
11
+ ```
12
+ > conch
13
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
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.4'
3
+ s.version = '0.0.5'
4
4
  s.summary = 'shell in the browser'
5
5
  s.authors = ['limadelic']
6
6
  s.email = 'limadelic@gmail.com'
@@ -8,6 +8,9 @@ Gem::Specification.new do |s|
8
8
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
9
9
  s.require_paths = ['lib']
10
10
  s.homepage = 'http://www.c0nch.com'
11
+ s.license = 'MIT'
11
12
 
12
13
  s.add_dependency 'em-websocket', '>= 0.5.0'
14
+ s.add_development_dependency 'bundler', "~> 1.3"
15
+ s.add_development_dependency 'rake'
13
16
  end
data/lib/conch.rb CHANGED
@@ -2,8 +2,19 @@ require 'em-websocket'
2
2
 
3
3
  `start www.c0nch.com`
4
4
 
5
+ def run(socket, cmd)
6
+ socket.send `#{cmd}`
7
+ rescue
8
+ socket.send ''
9
+ end
10
+
11
+ def listen_on(socket)
12
+ socket.onmessage {|cmd| run socket, cmd}
13
+ end
14
+
5
15
  EM.run do
6
- EM::WebSocket.run host: 'localhost', port: 8888 do |ws|
7
- ws.onmessage { |msg| ws.send `#{msg}` }
8
- end
16
+ EM::WebSocket.run(
17
+ host: 'localhost',
18
+ port: 8888
19
+ ) { |socket| listen_on socket }
9
20
  end
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.4
4
+ version: 0.0.5
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-17 00:00:00.000000000 Z
12
+ date: 2013-07-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: em-websocket
@@ -27,6 +27,38 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.5.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
30
62
  description:
31
63
  email: limadelic@gmail.com
32
64
  executables:
@@ -35,11 +67,15 @@ extensions: []
35
67
  extra_rdoc_files: []
36
68
  files:
37
69
  - Gemfile
70
+ - LICENSE.txt
71
+ - README.md
72
+ - Rakefile
38
73
  - bin/conch
39
74
  - conch.gemspec
40
75
  - lib/conch.rb
41
76
  homepage: http://www.c0nch.com
42
- licenses: []
77
+ licenses:
78
+ - MIT
43
79
  post_install_message:
44
80
  rdoc_options: []
45
81
  require_paths: