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 CHANGED
@@ -1,5 +1,7 @@
1
1
  *.gem
2
+ *.log
2
3
  *.rbc
4
+ .rbx/
3
5
  .bundle
4
6
  .config
5
7
  .yardoc
data/Gemfile CHANGED
@@ -1,7 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in sanford-protocol.gemspec
4
3
  gemspec
5
4
 
5
+ gem 'rake'
6
+ gem 'pry'
7
+
6
8
  gem 'bson_ext', '~>1.7'
7
- gem 'rake', '~>0.9.2'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 jcredding
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
@@ -1,6 +1,6 @@
1
1
  # Sanford Protocol
2
2
 
3
- Ruby implementation of the Sanford communication protocol.
3
+ Ruby implementation of Sanford TCP communication protocol.
4
4
 
5
5
  ## The Protocol
6
6
 
@@ -1,5 +1,4 @@
1
- module Sanford; end
2
-
1
+ require 'sanford-protocol/version'
3
2
  require 'sanford-protocol/connection'
4
3
  require 'sanford-protocol/request'
5
4
  require 'sanford-protocol/response'
@@ -1,6 +1,7 @@
1
- require 'sanford-protocol/msg_data'
2
1
  require 'socket'
2
+ require 'sanford-protocol/msg_data'
3
3
 
4
+ module Sanford; end
4
5
  module Sanford::Protocol
5
6
 
6
7
  # Sanford Protocol's connection class wraps a socket and provides a `read` and
@@ -1,3 +1,4 @@
1
+ module Sanford; end
1
2
  module Sanford::Protocol
2
3
 
3
4
  class BadMessageError < RuntimeError
@@ -2,6 +2,7 @@
2
2
  # a defined structure for it. A request requires a message body to contain a
3
3
  # version, name and params.
4
4
 
5
+ module Sanford; end
5
6
  module Sanford::Protocol
6
7
 
7
8
  BadRequestError = Class.new(RuntimeError)
@@ -4,6 +4,7 @@ require 'sanford-protocol/response_status'
4
4
  # a defined structure for it. A response requires a message body to contain a
5
5
  # status and some data.
6
6
 
7
+ module Sanford; end
7
8
  module Sanford::Protocol
8
9
 
9
10
  class Response < Struct.new(:status, :data)
@@ -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; end
15
- def to_s; code_obj.to_s; end
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
 
@@ -1,5 +1,5 @@
1
1
  module Sanford
2
2
  module Protocol
3
- GEM_VERSION = "0.5.5"
3
+ GEM_VERSION = "0.5.6"
4
4
  end
5
5
  end
@@ -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's communication protocol."
12
- gem.summary = "Ruby implementation of Sanford's communication protocol."
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", ["~>1.7"])
20
+ gem.add_dependency("bson", ["~> 1.7"])
21
21
 
22
- gem.add_development_dependency("assert", ["~> 2.0"])
23
- gem.add_development_dependency("assert-mocha", ["~> 1.0"])
22
+ gem.add_development_dependency("assert", ["~> 2.0"])
23
+ gem.add_development_dependency("assert-mocha", ["~> 1.0"])
24
24
  end
@@ -1,4 +1,11 @@
1
- ROOT = File.expand_path('../..', __FILE__)
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: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 5
10
- version: 0.5.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-14 00:00:00 Z
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's communication protocol.
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's communication protocol.
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