evepi 0.2.0
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.
- checksums.yaml +7 -0
- data/lib/evepi.rb +21 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 1d44a4d372d1b4ea8aa6e5a58a3fe6da3eae939d
|
|
4
|
+
data.tar.gz: c2da03ea49a50dfbde9385dce676605eb52543b6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c5e9d5e9586b0b39a41ef362f5cb5b0b9c8d62ccf00fb08d35d8d16c997c9ee36a143e000c96e0d694f75594144d87bbc152d1e8dc9da6b679c1a400c6ebf102
|
|
7
|
+
data.tar.gz: 73e0a22d6dfca623471f32ee7fe1ac29bc858176cebcbcbfb036874642388635260f6bbe5414c7c9d716fd9dde5db16c8dc6d9cc8b70b533fa7a7dc9364af148
|
data/lib/evepi.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'socket' # Sockets 是标准库
|
|
2
|
+
require 'json'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Ultrason
|
|
6
|
+
|
|
7
|
+
fuck_json_path = open( "/etc/ultrason/fuckpath.md" ).read()
|
|
8
|
+
fuck_json_file = File.read( fuck_json_path )
|
|
9
|
+
@fuck_ultrason_json = JSON.parse( fuck_json_file )
|
|
10
|
+
|
|
11
|
+
def self.get_res ( name, cmd="fuck")
|
|
12
|
+
hostname = @fuck_ultrason_json[ name ][0]
|
|
13
|
+
port = @fuck_ultrason_json[ name ][1]
|
|
14
|
+
s = TCPSocket.open(hostname, port)
|
|
15
|
+
s.send cmd, 0
|
|
16
|
+
line = s.recv(1024)
|
|
17
|
+
puts line
|
|
18
|
+
s.close # 关闭 socket
|
|
19
|
+
return line
|
|
20
|
+
end
|
|
21
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: evepi
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.2.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Zhang Yiwei
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-11-15 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: evepi
|
|
14
|
+
email: Karl1991223@126.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/evepi.rb
|
|
20
|
+
homepage: http://rubygems.org/gems/evepi
|
|
21
|
+
licenses:
|
|
22
|
+
- MIT
|
|
23
|
+
metadata: {}
|
|
24
|
+
post_install_message:
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - '>='
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - '>='
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
requirements: []
|
|
39
|
+
rubyforge_project:
|
|
40
|
+
rubygems_version: 2.0.14
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: evepi
|
|
44
|
+
test_files: []
|