sanford-protocol 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +3 -2
- data/LICENSE.txt +2 -2
- data/README.md +1 -1
- data/lib/sanford-protocol.rb +1 -2
- data/lib/sanford-protocol/connection.rb +2 -1
- data/lib/sanford-protocol/msg_data.rb +1 -0
- data/lib/sanford-protocol/request.rb +1 -0
- data/lib/sanford-protocol/response.rb +1 -0
- data/lib/sanford-protocol/response_status.rb +3 -2
- data/lib/sanford-protocol/test/fake_socket.rb +3 -3
- data/lib/sanford-protocol/version.rb +1 -1
- data/sanford-protocol.gemspec +5 -5
- data/test/helper.rb +8 -1
- metadata +6 -6
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2012
|
1
|
+
Copyright (c) 2012-Present Collin Redding and Kelly Redding
|
2
2
|
|
3
3
|
MIT License
|
4
4
|
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
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.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
data/lib/sanford-protocol.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The Response Status class models a code and optional message. This makes up
|
2
2
|
# part of a response and provides methods for building and displaying statuses.
|
3
3
|
|
4
|
+
module Sanford; end
|
4
5
|
module Sanford::Protocol
|
5
6
|
class ResponseStatus < Struct.new(:code_obj, :message)
|
6
7
|
|
@@ -11,8 +12,8 @@ module Sanford::Protocol
|
|
11
12
|
def code; code_obj.number; end
|
12
13
|
alias_method :to_i, :code
|
13
14
|
|
14
|
-
def name; code_obj.name;
|
15
|
-
def to_s; code_obj.to_s;
|
15
|
+
def name; code_obj.name; end
|
16
|
+
def to_s; code_obj.to_s; end
|
16
17
|
|
17
18
|
def inspect
|
18
19
|
reference = '0x0%x' % (self.object_id << 1)
|
@@ -1,10 +1,10 @@
|
|
1
|
+
require 'sanford-protocol'
|
2
|
+
require 'sanford-protocol/request'
|
3
|
+
|
1
4
|
# The FakeSocket class can be used to work with Sanford Protocol in a test
|
2
5
|
# environment. Instead of passing a real socket, pass an instance of this class.
|
3
6
|
# It mimics the socket API that sanford is concerned with.
|
4
7
|
|
5
|
-
require 'sanford-protocol'
|
6
|
-
require 'sanford-protocol/request'
|
7
|
-
|
8
8
|
module Sanford::Protocol::Test
|
9
9
|
class FakeSocket
|
10
10
|
|
data/sanford-protocol.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = Sanford::Protocol::GEM_VERSION
|
9
9
|
gem.authors = ["Collin Redding", "Kelly Redding"]
|
10
10
|
gem.email = ["collin.redding@me.com", "kelly@kellyredding.com"]
|
11
|
-
gem.description = "Ruby implementation of Sanford
|
12
|
-
gem.summary = "Ruby implementation of Sanford
|
11
|
+
gem.description = "Ruby implementation of the Sanford TCP communication protocol."
|
12
|
+
gem.summary = "Ruby implementation of the Sanford TCP communication protocol."
|
13
13
|
gem.homepage = "https://github.com/redding/sanford-protocol"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
@@ -17,8 +17,8 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_dependency("bson",
|
20
|
+
gem.add_dependency("bson", ["~> 1.7"])
|
21
21
|
|
22
|
-
gem.add_development_dependency("assert",
|
23
|
-
gem.add_development_dependency("assert-mocha",
|
22
|
+
gem.add_development_dependency("assert", ["~> 2.0"])
|
23
|
+
gem.add_development_dependency("assert-mocha", ["~> 1.0"])
|
24
24
|
end
|
data/test/helper.rb
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
# this file is automatically required when you run `assert`
|
2
|
+
# put any test helpers here
|
3
|
+
|
4
|
+
# add the root dir to the load path
|
5
|
+
$LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
|
6
|
+
|
7
|
+
# require pry for debugging (`binding.pry`)
|
8
|
+
require 'pry'
|
2
9
|
|
3
10
|
ENV['SANFORD_PROTOCOL_DEBUG'] = 'yes'
|
4
11
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanford-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 6
|
10
|
+
version: 0.5.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Collin Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-03-
|
19
|
+
date: 2013-03-25 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
prerelease: false
|
@@ -63,7 +63,7 @@ dependencies:
|
|
63
63
|
requirement: *id003
|
64
64
|
name: assert-mocha
|
65
65
|
type: :development
|
66
|
-
description: Ruby implementation of Sanford
|
66
|
+
description: Ruby implementation of the Sanford TCP communication protocol.
|
67
67
|
email:
|
68
68
|
- collin.redding@me.com
|
69
69
|
- kelly@kellyredding.com
|
@@ -130,7 +130,7 @@ rubyforge_project:
|
|
130
130
|
rubygems_version: 1.8.15
|
131
131
|
signing_key:
|
132
132
|
specification_version: 3
|
133
|
-
summary: Ruby implementation of Sanford
|
133
|
+
summary: Ruby implementation of the Sanford TCP communication protocol.
|
134
134
|
test_files:
|
135
135
|
- test/helper.rb
|
136
136
|
- test/unit/connection_tests.rb
|