socketlogger 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d90f4c2e9b207907d32c4be8b124963b50b97142
4
+ data.tar.gz: f558a46f3216eae48704a3f481508acf93333d00
5
+ SHA512:
6
+ metadata.gz: fd9c70514fe48d225a733bd16d37067ffa6d3eb251c0312e9c5680437e4022e77459c5732ff43a0d5c8d06388bd14c418dcb36f15370c9ddedf4a747602528d7
7
+ data.tar.gz: 849827bb6fc83c6a022ed43d7e4e199df8ae9e5ffebc1163561d457f90c35fc5e7964fb9426ac89557766553de09f2bf681d6d1c25b2f95bc5d2e8f82fbbcef9
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ vendor
2
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,27 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ coderay (1.1.0)
5
+ ezmq (0.4.4)
6
+ ffi-rzmq (~> 2.0)
7
+ ffi (1.9.10)
8
+ ffi-rzmq (2.0.4)
9
+ ffi-rzmq-core (>= 1.0.1)
10
+ ffi-rzmq-core (1.0.3)
11
+ ffi (~> 1.9)
12
+ method_source (0.8.2)
13
+ pry (0.10.1)
14
+ coderay (~> 1.1.0)
15
+ method_source (~> 0.8.1)
16
+ slop (~> 3.4)
17
+ slop (3.6.0)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ ezmq
24
+ pry
25
+
26
+ BUNDLED WITH
27
+ 1.10.4
@@ -0,0 +1,11 @@
1
+ require 'ezmq'
2
+
3
+ module Logger
4
+
5
+ @logger = EZMQ::Publisher.new :connect
6
+
7
+ def self.log message
8
+ @logger.send message, topic: 'logging'
9
+ end
10
+
11
+ end
@@ -0,0 +1,18 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.name = 'socketlogger'
3
+ gem.version = '0.0.1'
4
+ gem.licenses = 'MIT'
5
+ gem.authors = ['Kinnan Kwok']
6
+ gem.email = 'kkwoker@gmail.com'
7
+ gem.summary = 'Socket logging by pubsub'
8
+
9
+ gem.files = `git ls-files`.split("\n")
10
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
12
+ gem.require_paths = ['lib']
13
+
14
+ gem.add_runtime_dependency 'ezmq', '~> 0.4.4'
15
+
16
+ gem.add_development_dependency 'pry'
17
+ gem.add_development_dependency 'kintama'
18
+ end
@@ -0,0 +1,17 @@
1
+ require 'kintama'
2
+ require 'pry'
3
+
4
+ context "Logger module" do
5
+ setup do
6
+ require_relative '../lib/socketlogger'
7
+ end
8
+
9
+ it "should publish to a socket and return a number equal to length of message + length of topic + 1" do
10
+ message = 'sike!'
11
+ topic = 'logging'
12
+ sent = Logger::log message
13
+ characters_sent = message.length + topic.length + 1
14
+ assert_equal characters_sent, sent
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: socketlogger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kinnan Kwok
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ezmq
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.4.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.4.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: kintama
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email: kkwoker@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".gitignore"
62
+ - Gemfile
63
+ - Gemfile.lock
64
+ - lib/socketlogger.rb
65
+ - socketlogger.gemspec
66
+ - tests/socketlogger.rb
67
+ homepage:
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.4.6
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: Socket logging by pubsub
91
+ test_files: []