bilbo 1.0.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/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +148 -0
- data/Rakefile +6 -0
- data/bilbo.gemspec +29 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/examples/capture_example.rb +11 -0
- data/examples/capture_example_2.rb +9 -0
- data/examples/capture_example_3.rb +9 -0
- data/examples/capture_example_4.rb +13 -0
- data/lib/bilbo/capture.rb +130 -0
- data/lib/bilbo/version.rb +3 -0
- data/lib/bilbo.rb +28 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8767616e7296e136fc055e44fdd92d587c8a4e25
|
4
|
+
data.tar.gz: 0efec03b0f85b474d87a93603656182b554aabf0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 16ae6cb8b3c5c698ae145e758ebdd133e108c9be0ac41cebdeeb9a18d8faa95b69a57d924213f1f63b47e53c91b7e892eba87a5edcf6ac8370b9bd78253edd6b
|
7
|
+
data.tar.gz: 90bbef7c1255f4fa73c33f9e40d478ffc8e90e8bac5d1fa2f55c4d622449eda4803f26fc17d3213660312521daff0e62b6cc313e91acc511e43bf284766e60ee
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at kgruber1@emich.edu. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Kent Gruber
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
# Bilbo
|
2
|
+
|
3
|
+
Bilbo is a tiny packet capture library built on [pcaprub](https://github.com/pcaprub/pcaprub) to interface with libpcap.
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
### Why?
|
8
|
+
|
9
|
+
You never know when you're going need a simple, hobbit-like ( small ) network packet burglaring ( capturing ) library such as Bilbo.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
$ gem install bilbo
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
Packet capturing with Bilbo is incredibly straight-forward.
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'bilbo'
|
21
|
+
|
22
|
+
Bilbo::Capture.new do |packet|
|
23
|
+
# do something with the packet
|
24
|
+
end
|
25
|
+
```
|
26
|
+
### Customizations
|
27
|
+
|
28
|
+
Of course!
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'bilbo'
|
32
|
+
|
33
|
+
cap = Bilbo::Capture.new
|
34
|
+
|
35
|
+
cap.iface = "en0" # interface en0
|
36
|
+
cap.promisc = true # promiscuous mode, on
|
37
|
+
cap.start # start capturing
|
38
|
+
|
39
|
+
cap.packets do |packet|
|
40
|
+
# do something with the packet
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
Pretty flexible, doing the same thing as above:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
require 'bilbo'
|
48
|
+
|
49
|
+
cap = Bilbo::Capture.new(iface: "en0", promisc: true)
|
50
|
+
cap.start do |packet|
|
51
|
+
# do something with the packet
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
### Packet Parsing?
|
56
|
+
|
57
|
+
Bilbo provides no packet parsing abstractions. You can use something like [PacketGen](https://github.com/sdaubert/packetgen) with Bilbo together:
|
58
|
+
|
59
|
+
### PacketGen
|
60
|
+
|
61
|
+
PacketGen works really well for parsing the packets into a human-friendly interface.
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
require 'bilbo'
|
65
|
+
require 'packetgen'
|
66
|
+
|
67
|
+
cap = Bilbo::Capture.new
|
68
|
+
|
69
|
+
cap do |packet|
|
70
|
+
parsed_packet = PacketGen.parse(packet)
|
71
|
+
# do something with the parsed packet
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
### PacketFu
|
76
|
+
|
77
|
+
Since Bilbo is simply capturing packets, you can easily use [PacketFu](https://github.com/packetfu/packetfu) if wanted to:
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
require 'bilbo'
|
81
|
+
require 'packetfu'
|
82
|
+
|
83
|
+
cap = Bilbo::Capture.new
|
84
|
+
|
85
|
+
cap do |packet|
|
86
|
+
parsed_packet = PacketFu::Packet.parse(packet)
|
87
|
+
# do something with the parsed packet
|
88
|
+
end
|
89
|
+
```
|
90
|
+
### TODO's
|
91
|
+
|
92
|
+
* Methods for checking state of the capture, like:
|
93
|
+
```ruby
|
94
|
+
require 'bilbo'
|
95
|
+
|
96
|
+
cap = Bilbo::Capture.new(start: true)
|
97
|
+
|
98
|
+
cap.capturing?
|
99
|
+
# => true
|
100
|
+
|
101
|
+
cap.started?
|
102
|
+
# => true
|
103
|
+
|
104
|
+
# stop capture
|
105
|
+
cap.stop
|
106
|
+
|
107
|
+
# but, we know it was started beforehand
|
108
|
+
cap.started?
|
109
|
+
# => true
|
110
|
+
|
111
|
+
# and we can check that we aren't capturing still
|
112
|
+
cap.capturing?
|
113
|
+
# => false
|
114
|
+
```
|
115
|
+
* Human friendly alias features?
|
116
|
+
```ruby
|
117
|
+
require 'bilbo'
|
118
|
+
|
119
|
+
cap = Bilbo::Capture.new
|
120
|
+
|
121
|
+
cap.promisc = true
|
122
|
+
# or
|
123
|
+
cap.promiscuous = true
|
124
|
+
# or
|
125
|
+
cap.promiscuous!
|
126
|
+
# and
|
127
|
+
cap.promiscuous?
|
128
|
+
|
129
|
+
# stuff like that
|
130
|
+
```
|
131
|
+
* Check internal documentation and inline documentation for ma' errorz.
|
132
|
+
* More packet wrangle'n features for the `.packets()` method?
|
133
|
+
* Some sort of PacketFu/PacketGen shell like functionality.
|
134
|
+
* Specs? Because that'd be nice.
|
135
|
+
* Write some sort of ngrep like clone using Bilbo.
|
136
|
+
|
137
|
+
### ❤️ Ruby Community
|
138
|
+
|
139
|
+
Bilbo has taken inspriation from many ruby packet capturing / parsing gems:
|
140
|
+
|
141
|
+
* [PacketGen](https://github.com/sdaubert/packetgen)
|
142
|
+
* [PacketFu](https://github.com/packetfu/packetfu)
|
143
|
+
* [pcaprub](https://github.com/pcaprub/pcaprub)
|
144
|
+
|
145
|
+
## License
|
146
|
+
|
147
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
148
|
+
|
data/Rakefile
ADDED
data/bilbo.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bilbo/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "bilbo"
|
8
|
+
spec.version = Bilbo::VERSION
|
9
|
+
spec.authors = ["Kent 'picat' Gruber"]
|
10
|
+
spec.email = ["kgruber1@emich.edu"]
|
11
|
+
|
12
|
+
spec.summary = %q{A simple, hobbit-like network packet capturing gem.}
|
13
|
+
spec.description = %q{You never know when you're going need a simple, hobbit-like ( small ) network packet burglaring ( capturing ) library such as Bilbo.}
|
14
|
+
spec.homepage = "https://github.com/picatz/bilbo"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency 'pcaprub', '~>0.12.4'
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "bilbo"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# path setting magic for example directory only
|
2
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
require "bilbo"
|
4
|
+
|
5
|
+
# start a new capture instance
|
6
|
+
cap = Bilbo::Capture.new
|
7
|
+
|
8
|
+
# start the capture, optional block
|
9
|
+
cap.start do |packet|
|
10
|
+
# do something with the packet
|
11
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# path setting magic for example directory only
|
2
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
require "bilbo"
|
4
|
+
|
5
|
+
# start a new capture instance on interface en0
|
6
|
+
Bilbo::Capture.new(iface: 'en0') do |packet|
|
7
|
+
# do something with the packet
|
8
|
+
end
|
9
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# path setting magic for example directory only
|
2
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
require "bilbo"
|
4
|
+
|
5
|
+
# start a new capture instance on interface en0
|
6
|
+
cap = Bilbo::Capture.new(iface: 'en0')
|
7
|
+
cap.snaplen = 1234 # lol
|
8
|
+
|
9
|
+
cap.start
|
10
|
+
|
11
|
+
cap.packets do |packet|
|
12
|
+
# do something with the packet
|
13
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
module Bilbo
|
2
|
+
|
3
|
+
# Capture packets simply.
|
4
|
+
# @author Kent 'picat' Gruber
|
5
|
+
class Capture
|
6
|
+
# packet stream
|
7
|
+
# @return [PCAPRUB::Pcap]
|
8
|
+
attr_reader :packet_stream
|
9
|
+
|
10
|
+
# interface to capture on
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :iface
|
13
|
+
|
14
|
+
# amount of data for each frame that is actually captured
|
15
|
+
# @return [Integer]
|
16
|
+
attr_accessor :snaplen
|
17
|
+
|
18
|
+
# capture packets in promiscuous mode
|
19
|
+
# @return [Boolean]
|
20
|
+
attr_accessor :promisc
|
21
|
+
|
22
|
+
# capture packet timeout
|
23
|
+
# @return [Integer]
|
24
|
+
attr_accessor :timeout
|
25
|
+
|
26
|
+
# Create a new Bilbo capture instance.
|
27
|
+
#
|
28
|
+
# == Simple Defaults
|
29
|
+
# You can let bilbo take care of things for you with its defaults:
|
30
|
+
# cap = Bilbo::Capture.new(start: true)
|
31
|
+
#
|
32
|
+
# == Custom Options
|
33
|
+
# You can also set you own options with defaults and check them easily:
|
34
|
+
# cap = Bilbo::Capture.new(iface: "eth0")
|
35
|
+
# cap.iface
|
36
|
+
# # => "eth0"
|
37
|
+
#
|
38
|
+
def initialize(args={})
|
39
|
+
@iface = args[:iface] || Pcap.lookupdev # lookup default interface
|
40
|
+
@snaplen = args[:snaplen] || 65535 # default snaplen
|
41
|
+
@promisc = args[:promisc] || false # default promisc
|
42
|
+
@timeout = args[:timeout] || 0 # default timeout
|
43
|
+
start(args) if args[:start]
|
44
|
+
if block_given?
|
45
|
+
start
|
46
|
+
@packet_stream.each { |packet| yield packet }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Start the actual packet capturing.
|
51
|
+
# @param [Hash] args capture options when started
|
52
|
+
# @option options [String] :iface interface to capture on
|
53
|
+
# @option options [Integer] :snaplen ammount of data for each frame that is actually captured
|
54
|
+
# @option options [Boolean] :promisc whether to capture in promiscuous mode or not
|
55
|
+
# @option options [Integer] :timeout ammount for timeout on capture
|
56
|
+
# @return [PCAPRUB::Pcap]
|
57
|
+
#
|
58
|
+
# == Example
|
59
|
+
#
|
60
|
+
# cap = Bilbo::Capture(iface: "eth0")
|
61
|
+
# cap.start
|
62
|
+
#
|
63
|
+
# == Block Example
|
64
|
+
#
|
65
|
+
# cap = Bilbo::Capture(iface: "eth0")
|
66
|
+
# cap.start do |packet|
|
67
|
+
# # do something with packet
|
68
|
+
# end
|
69
|
+
#
|
70
|
+
def start(args={})
|
71
|
+
iface = args[:iface] || @iface # default interface
|
72
|
+
snaplen = args[:snaplen] || @snaplen # default snaplen
|
73
|
+
promisc = args[:promisc] || @promisc # default promisc
|
74
|
+
timeout = args[:timeout] || @timeout # default timeout
|
75
|
+
@packet_stream = Pcap.open_live(iface, snaplen, promisc, timeout)
|
76
|
+
if block_given?
|
77
|
+
@packet_stream.each { |packet| yield packet }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Simple interface to work with the +packet stream+.
|
82
|
+
#
|
83
|
+
# @param [Hash] args options to wrangle streaming packets, totally optional
|
84
|
+
# @option options [Integer] :count ammount of packets to wrangle up
|
85
|
+
#
|
86
|
+
# @example Block
|
87
|
+
#
|
88
|
+
# cap = Bilbo::Capture(iface: "eth0")
|
89
|
+
# cap.start
|
90
|
+
# cap.packets do |packet|
|
91
|
+
#
|
92
|
+
# end
|
93
|
+
#
|
94
|
+
# @example Direct PCAP:Pcap Access
|
95
|
+
#
|
96
|
+
# cap = Bilbo::Capture(iface: "eth0")
|
97
|
+
# cap.start
|
98
|
+
# cap.packets
|
99
|
+
# # => <PCAPRUB::Pcap>
|
100
|
+
# cap.packets.each do |packet|
|
101
|
+
# # do something with the packet
|
102
|
+
# end
|
103
|
+
# cap.packets.stats
|
104
|
+
#
|
105
|
+
# @example Wrangle a few packets
|
106
|
+
#
|
107
|
+
# cap = Bilbo::Capture(iface: "eth0")
|
108
|
+
# cap.start
|
109
|
+
# cap.packets(count: 30)
|
110
|
+
#
|
111
|
+
#
|
112
|
+
def packets(args={})
|
113
|
+
if block_given?
|
114
|
+
@packet_stream.each { |packet| yield packet }
|
115
|
+
else
|
116
|
+
if args[:count]
|
117
|
+
packets = []
|
118
|
+
@packet_stream.each do |packet|
|
119
|
+
packets << packet
|
120
|
+
break if packets.count.eql? args[:count]
|
121
|
+
end
|
122
|
+
return packets
|
123
|
+
end
|
124
|
+
@packet_stream
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
data/lib/bilbo.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "bilbo/version"
|
2
|
+
require "bilbo/capture"
|
3
|
+
require "pcaprub"
|
4
|
+
|
5
|
+
|
6
|
+
# Bilbo is a simple, +hobbit-like+ ( small ) network packet +burglaring+ ( capturing ) library.
|
7
|
+
# # @author Kent 'picat' Gruber
|
8
|
+
module Bilbo
|
9
|
+
|
10
|
+
# A few quotes from dear 'ol Mr. Bilbo Baggins
|
11
|
+
# @easter_egg
|
12
|
+
QUOTES = [
|
13
|
+
"It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to.",
|
14
|
+
"Go back? No good at all! Go sideways? Impossible! Go forward? Only thing to do! On we go!",
|
15
|
+
"Now I know what a piece of bacon feels like when it is suddenly picked out of the pan on a fork and put back on the shelf!",
|
16
|
+
"I will give you a name, and I shall call you Sting.",
|
17
|
+
"I came from the end of bag, but no bag went over me. I am the friend of bears and the guest of eagles. I am Ring-winner and Luckwearer; and I am Barrel-rider.",
|
18
|
+
"I don’t know half of you half as well as I should like; and I like less than half of you half as well as you deserve."
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
# Get a random quote from Bilbo.
|
22
|
+
#
|
23
|
+
# @return [String]
|
24
|
+
def quote
|
25
|
+
QUOTES.sample
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bilbo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kent 'picat' Gruber
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pcaprub
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.12.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.12.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.14'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.14'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
description: You never know when you're going need a simple, hobbit-like ( small )
|
70
|
+
network packet burglaring ( capturing ) library such as Bilbo.
|
71
|
+
email:
|
72
|
+
- kgruber1@emich.edu
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".travis.yml"
|
80
|
+
- CODE_OF_CONDUCT.md
|
81
|
+
- Gemfile
|
82
|
+
- LICENSE.txt
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- bilbo.gemspec
|
86
|
+
- bin/console
|
87
|
+
- bin/setup
|
88
|
+
- examples/capture_example.rb
|
89
|
+
- examples/capture_example_2.rb
|
90
|
+
- examples/capture_example_3.rb
|
91
|
+
- examples/capture_example_4.rb
|
92
|
+
- lib/bilbo.rb
|
93
|
+
- lib/bilbo/capture.rb
|
94
|
+
- lib/bilbo/version.rb
|
95
|
+
homepage: https://github.com/picatz/bilbo
|
96
|
+
licenses:
|
97
|
+
- MIT
|
98
|
+
metadata: {}
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
requirements: []
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 2.6.8
|
116
|
+
signing_key:
|
117
|
+
specification_version: 4
|
118
|
+
summary: A simple, hobbit-like network packet capturing gem.
|
119
|
+
test_files: []
|