arpdb 0.1.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: 20917df1e411474569a22b54290795fade72743e
4
+ data.tar.gz: 89791379105170de77c39a4408c8542f56bc09ec
5
+ SHA512:
6
+ metadata.gz: d3cba2c245185d598754f369d84b7800ae674b4d8f0fbcd46fa30a8d01906b987a97ca8417623dbdfe0a50247484c82ac27941ba90d706735442c062ac6a8431
7
+ data.tar.gz: e72abb5ff963e869d04cc88dd8920133eb275f0406a9e03151989accc67f5781fead88a60fb43bcce4b4b6499093e1f9137635dddbdbb6c0e8a63e857c3b3c3d
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
data/.idea/.rakeTasks ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build arpdb-0.1.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install arpdb-0.1.1.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install arpdb-0.1.1.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.1 and build and push arpdb-0.1.1.gem to Rubygems" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
data/.idea/arpdb.iml ADDED
@@ -0,0 +1,159 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Ruby Gem">
5
+ <configuration>
6
+ <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
7
+ <option name="GEM_APP_TEST_PATH" value="$MODULE_DIR$/test" />
8
+ <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="ModuleRunConfigurationManager">
13
+ <configuration default="false" name="Run spec 'arpdb_spec': arpdb" type="RSpecRunConfigurationType" factoryName="RSpec">
14
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
15
+ <module name="arpdb" />
16
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
17
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$/test" />
18
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
19
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
20
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
21
+ <envs>
22
+ <env name="JRUBY_OPTS" value="-X+O" />
23
+ </envs>
24
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
25
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
26
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
27
+ <COVERAGE_PATTERN ENABLED="true">
28
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
29
+ </COVERAGE_PATTERN>
30
+ </EXTENSION>
31
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
32
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
33
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/arpdb_spec.rb" />
34
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="$MODULE_DIR$/test/arpdb_spec.rb" />
35
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
36
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
37
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
38
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
39
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
40
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="true" />
41
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
42
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
43
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
44
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
45
+ <method />
46
+ </configuration>
47
+ <configuration default="false" name="All tests in spec: arpdb" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true">
48
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
49
+ <module name="arpdb" />
50
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
51
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$/spec" />
52
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
53
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
54
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
55
+ <envs>
56
+ <env name="JRUBY_OPTS" value="-X+O" />
57
+ </envs>
58
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
59
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
60
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
61
+ <COVERAGE_PATTERN ENABLED="true">
62
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
63
+ </COVERAGE_PATTERN>
64
+ </EXTENSION>
65
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
66
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="$MODULE_DIR$/spec" />
67
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
68
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/{*_test,test_*}.rb" />
69
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
70
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="ALL_IN_FOLDER" />
71
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
72
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
73
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
74
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
75
+ <method />
76
+ </configuration>
77
+ <configuration default="false" name="Run spec 'arp_spec': arpdb" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
78
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
79
+ <module name="arpdb" />
80
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
81
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
82
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
83
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
84
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
85
+ <envs>
86
+ <env name="JRUBY_OPTS" value="-X+O" />
87
+ </envs>
88
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
89
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
90
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
91
+ <COVERAGE_PATTERN ENABLED="true">
92
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
93
+ </COVERAGE_PATTERN>
94
+ </EXTENSION>
95
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
96
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
97
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/arp_spec.rb" />
98
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
99
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
100
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
101
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
102
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
103
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
104
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
105
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
106
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
107
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
108
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
109
+ <method />
110
+ </configuration>
111
+ </component>
112
+ <component name="NewModuleRootManager">
113
+ <content url="file://$MODULE_DIR$">
114
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
115
+ </content>
116
+ <orderEntry type="inheritedJdk" />
117
+ <orderEntry type="sourceFolder" forTests="false" />
118
+ <orderEntry type="library" scope="PROVIDED" name="awesome_print (v1.6.1, ruby-2.1.2-p95) [gem]" level="application" />
119
+ <orderEntry type="library" scope="PROVIDED" name="celluloid (v0.16.0, ruby-2.1.2-p95) [gem]" level="application" />
120
+ <orderEntry type="library" scope="PROVIDED" name="coderay (v1.1.0, ruby-2.1.2-p95) [gem]" level="application" />
121
+ <orderEntry type="library" scope="PROVIDED" name="coveralls (v0.8.1, ruby-2.1.2-p95) [gem]" level="application" />
122
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, ruby-2.1.2-p95) [gem]" level="application" />
123
+ <orderEntry type="library" scope="PROVIDED" name="docile (v1.1.5, ruby-2.1.2-p95) [gem]" level="application" />
124
+ <orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.24, ruby-2.1.2-p95) [gem]" level="application" />
125
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.8, ruby-2.1.2-p95) [gem]" level="application" />
126
+ <orderEntry type="library" scope="PROVIDED" name="formatador (v0.2.5, ruby-2.1.2-p95) [gem]" level="application" />
127
+ <orderEntry type="library" scope="PROVIDED" name="guard (v2.12.6, ruby-2.1.2-p95) [gem]" level="application" />
128
+ <orderEntry type="library" scope="PROVIDED" name="guard-compat (v1.2.1, ruby-2.1.2-p95) [gem]" level="application" />
129
+ <orderEntry type="library" scope="PROVIDED" name="guard-rspec (v4.5.2, ruby-2.1.2-p95) [gem]" level="application" />
130
+ <orderEntry type="library" scope="PROVIDED" name="hitimes (v1.2.2, ruby-2.1.2-p95) [gem]" level="application" />
131
+ <orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.2, ruby-2.1.2-p95) [gem]" level="application" />
132
+ <orderEntry type="library" scope="PROVIDED" name="json (v1.8.3, ruby-2.1.2-p95) [gem]" level="application" />
133
+ <orderEntry type="library" scope="PROVIDED" name="listen (v2.10.0, ruby-2.1.2-p95) [gem]" level="application" />
134
+ <orderEntry type="library" scope="PROVIDED" name="lumberjack (v1.0.9, ruby-2.1.2-p95) [gem]" level="application" />
135
+ <orderEntry type="library" scope="PROVIDED" name="mime-types (v2.6.1, ruby-2.1.2-p95) [gem]" level="application" />
136
+ <orderEntry type="library" scope="PROVIDED" name="nenv (v0.2.0, ruby-2.1.2-p95) [gem]" level="application" />
137
+ <orderEntry type="library" scope="PROVIDED" name="netrc (v0.10.3, ruby-2.1.2-p95) [gem]" level="application" />
138
+ <orderEntry type="library" scope="PROVIDED" name="notiffany (v0.0.6, ruby-2.1.2-p95) [gem]" level="application" />
139
+ <orderEntry type="library" scope="PROVIDED" name="pry (v0.10.1, ruby-2.1.2-p95) [gem]" level="application" />
140
+ <orderEntry type="library" scope="PROVIDED" name="rb-fsevent (v0.9.5, ruby-2.1.2-p95) [gem]" level="application" />
141
+ <orderEntry type="library" scope="PROVIDED" name="rb-inotify (v0.9.5, ruby-2.1.2-p95) [gem]" level="application" />
142
+ <orderEntry type="library" scope="PROVIDED" name="rest-client (v1.8.0, ruby-2.1.2-p95) [gem]" level="application" />
143
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.3.0, ruby-2.1.2-p95) [gem]" level="application" />
144
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.3.0, ruby-2.1.2-p95) [gem]" level="application" />
145
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.3.0, ruby-2.1.2-p95) [gem]" level="application" />
146
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.3.0, ruby-2.1.2-p95) [gem]" level="application" />
147
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.3.0, ruby-2.1.2-p95) [gem]" level="application" />
148
+ <orderEntry type="library" scope="PROVIDED" name="shellany (v0.0.1, ruby-2.1.2-p95) [gem]" level="application" />
149
+ <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.10.0, ruby-2.1.2-p95) [gem]" level="application" />
150
+ <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.10.0, ruby-2.1.2-p95) [gem]" level="application" />
151
+ <orderEntry type="library" scope="PROVIDED" name="slop (v3.6.0, ruby-2.1.2-p95) [gem]" level="application" />
152
+ <orderEntry type="library" scope="PROVIDED" name="snmp (v1.2.0, ruby-2.1.2-p95) [gem]" level="application" />
153
+ <orderEntry type="library" scope="PROVIDED" name="term-ansicolor (v1.3.0, ruby-2.1.2-p95) [gem]" level="application" />
154
+ <orderEntry type="library" scope="PROVIDED" name="timers (v4.0.1, ruby-2.1.2-p95) [gem]" level="application" />
155
+ <orderEntry type="library" scope="PROVIDED" name="tins (v1.5.2, ruby-2.1.2-p95) [gem]" level="application" />
156
+ <orderEntry type="library" scope="PROVIDED" name="unf (v0.1.4, ruby-2.1.2-p95) [gem]" level="application" />
157
+ <orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.7.1, ruby-2.1.2-p95) [gem]" level="application" />
158
+ </component>
159
+ </module>
data/.idea/misc.xml ADDED
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
4
+ <OptionsSetting value="true" id="Add" />
5
+ <OptionsSetting value="true" id="Remove" />
6
+ <OptionsSetting value="true" id="Checkout" />
7
+ <OptionsSetting value="true" id="Update" />
8
+ <OptionsSetting value="true" id="Status" />
9
+ <OptionsSetting value="true" id="Edit" />
10
+ <ConfirmationsSetting value="0" id="Add" />
11
+ <ConfirmationsSetting value="0" id="Remove" />
12
+ </component>
13
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.1.2-p95" project-jdk-type="RUBY_SDK" />
14
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/arpdb.iml" filepath="$PROJECT_DIR$/.idea/arpdb.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <option name="TRACKING_ENABLED" value="true" />
5
+ <option name="SHOW_DIALOG" value="false" />
6
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
7
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
8
+ <option name="LAST_RESOLUTION" value="IGNORE" />
9
+ </component>
10
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
11
+ <component name="CreatePatchCommitExecutor">
12
+ <option name="PATCH_PATH" value="" />
13
+ </component>
14
+ <component name="NamedScopeManager">
15
+ <order />
16
+ </component>
17
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
18
+ <OptionsSetting value="true" id="Add" />
19
+ <OptionsSetting value="true" id="Remove" />
20
+ <OptionsSetting value="true" id="Checkout" />
21
+ <OptionsSetting value="true" id="Update" />
22
+ <OptionsSetting value="true" id="Status" />
23
+ <OptionsSetting value="true" id="Edit" />
24
+ <ConfirmationsSetting value="0" id="Add" />
25
+ <ConfirmationsSetting value="0" id="Remove" />
26
+ </component>
27
+ <component name="ShelveChangesManager" show_recycled="false" />
28
+ <component name="TaskManager">
29
+ <task active="true" id="Default" summary="Default task">
30
+ <option name="number" value="Default" />
31
+ </task>
32
+ <servers />
33
+ </component>
34
+ <component name="VcsContentAnnotationSettings">
35
+ <option name="myLimit" value="2678400000" />
36
+ </component>
37
+ <component name="XDebuggerManager">
38
+ <breakpoint-manager />
39
+ <watches-manager />
40
+ </component>
41
+ </project>
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
4
+ before_install: gem install bundler -v 1.10.3
5
+
6
+ script: 'bundle exec rspec spec'
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in arpdb.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,70 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.("routing/#{m[1]}_routing"),
51
+ rspec.spec.("controllers/#{m[1]}_controller"),
52
+ rspec.spec.("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ [![Build Status](https://travis-ci.org/jkvalk/arpdb.svg?branch=master)](https://travis-ci.org/jkvalk/arpdb)
2
+
3
+ # Arpdb
4
+
5
+ Arpdb is a Ruby gem for querying SNMP-enabled network devices for their ARP database.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'arpdb'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install arpdb
22
+
23
+ ## Usage
24
+ ```ruby
25
+ require 'arpdb'
26
+
27
+ routers = %w(192.168.1.1 10.1.1.1)
28
+ snmp_community = 'secret_community'
29
+
30
+ adb = Arpdb::Arp.new(routers, snmp_community)
31
+
32
+ puts adb.mac_to_ip 'aa:bb:cc:dd:ee:ff'
33
+ puts adb.ip_to_mac '192.168.1.100'
34
+ ```
35
+
36
+ ## Development
37
+
38
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
+
40
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
41
+
42
+ ## Contributing
43
+
44
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jkvalk/arpdb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
45
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/arpdb.gemspec ADDED
@@ -0,0 +1,43 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'arpdb/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "arpdb"
8
+ spec.version = Arpdb::VERSION
9
+ spec.authors = ["J.K.Valk"]
10
+ spec.email = ["jkvalk@mail.ru"]
11
+
12
+ spec.summary = %q{Arpdb is a Ruby gem for querying SNMP-enabled network devices for their ARP database.}
13
+ spec.description = ""
14
+ spec.homepage = ""
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ #if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = ""
20
+ #else
21
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ #end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.license = "MIT"
30
+
31
+ spec.add_development_dependency "bundler", "~> 1.10"
32
+ spec.add_development_dependency "rake", "~> 10.0"
33
+
34
+ spec.add_development_dependency "rspec"
35
+ spec.add_development_dependency "guard"
36
+ spec.add_development_dependency "guard-rspec"
37
+ spec.add_development_dependency "coveralls"
38
+ spec.add_development_dependency "pry"
39
+
40
+ spec.add_dependency "snmp", '~> 1.2'
41
+ spec.add_dependency "awesome_print", '~> 1.6'
42
+
43
+ end
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "arpdb"
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
+
11
+ require "pry"
12
+ Pry.start
13
+
14
+ #require "irb"
15
+ #IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/lib/arpdb/arp.rb ADDED
@@ -0,0 +1,84 @@
1
+ require 'snmp'
2
+ require 'ap'
3
+
4
+ # Class to fetch ARP tables from Juniper firewalls, maintain them in
5
+ # memory and perform search operations on the cached data.
6
+ module Arpdb
7
+
8
+ class Arp
9
+
10
+ attr_accessor :db
11
+
12
+ # * +hostlist+ - Array of hostnames (strings) who's ARP tables to fetch
13
+ def initialize(hostlist, community = 'public')
14
+ @hostlist = hostlist
15
+ @community = community
16
+ end
17
+
18
+ # Just an alias for refresh()
19
+ def scan
20
+ refresh
21
+ end
22
+
23
+ def refresh
24
+ @db = []
25
+ @hostlist.each do |host|
26
+ SNMP::Manager.open(host: host, community: @community) do |manager|
27
+ manager.walk(%w(1.3.6.1.2.1.4.22.1.2 1.3.6.1.2.1.4.22.1.3)) do |row|
28
+ mac = row[0].value.unpack('H*')[0]
29
+ ip = row[1].value.to_s
30
+ @db << {mac: mac, ip: ip, host: host}
31
+ end
32
+ end
33
+ end
34
+ self
35
+ end
36
+
37
+ # * +mac+ - MAC address. String.
38
+ # mac_to_ip("a7fea790ffa9")
39
+ def mac_to_ip(mac)
40
+ db.each do |line|
41
+ if line[:mac].eql?(mac.downcase.gsub(':',''))
42
+ return line[:ip]
43
+ end
44
+ end
45
+ ''
46
+ end
47
+
48
+ # * +ip+ - IP address. String, decimal notation.
49
+ # ip_to_mac("10.0.0.1")
50
+ def ip_to_mac(ip)
51
+ db.each do |line|
52
+ if line[:ip].eql?(ip)
53
+ return line[:mac]
54
+ end
55
+ end
56
+ ''
57
+ end
58
+
59
+ # Returns the host that has given MAC in it's ARP table
60
+ # * +mac+ - MAC address. String, hex, lowercase, no byte separators.
61
+ # locate_mac("a7fea790ffa9")
62
+ def locate_mac(mac)
63
+ db.each do |line|
64
+ if line[:mac].eql?(mac)
65
+ return line[:host]
66
+ end
67
+ end
68
+ ''
69
+ end
70
+
71
+ # Returns the host that has given IP in it's ARP table
72
+ # * +ip+ - IP address. String, decimal.
73
+ # locate_mac("10.0.0.1")
74
+ def locate_ip(ip)
75
+ db.each do |line|
76
+ if line[:ip].eql?(ip)
77
+ return line[:host]
78
+ end
79
+ end
80
+ ''
81
+ end
82
+
83
+ end
84
+ end
@@ -0,0 +1,3 @@
1
+ module Arpdb
2
+ VERSION = "0.1.1"
3
+ end
data/lib/arpdb.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "arpdb/version"
2
+ require "arpdb/arp"
3
+
4
+
5
+ module Arpdb
6
+ end
metadata ADDED
@@ -0,0 +1,192 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arpdb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - J.K.Valk
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
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
+ - !ruby/object:Gem::Dependency
56
+ name: guard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: snmp
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.2'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: awesome_print
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.6'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.6'
139
+ description: ''
140
+ email:
141
+ - jkvalk@mail.ru
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".coveralls.yml"
147
+ - ".gitignore"
148
+ - ".idea/.rakeTasks"
149
+ - ".idea/arpdb.iml"
150
+ - ".idea/misc.xml"
151
+ - ".idea/modules.xml"
152
+ - ".idea/vcs.xml"
153
+ - ".idea/workspace.xml"
154
+ - ".rspec"
155
+ - ".travis.yml"
156
+ - CODE_OF_CONDUCT.md
157
+ - Gemfile
158
+ - Guardfile
159
+ - README.md
160
+ - Rakefile
161
+ - arpdb.gemspec
162
+ - bin/console
163
+ - bin/setup
164
+ - lib/arpdb.rb
165
+ - lib/arpdb/arp.rb
166
+ - lib/arpdb/version.rb
167
+ homepage: ''
168
+ licenses:
169
+ - MIT
170
+ metadata: {}
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubyforge_project:
187
+ rubygems_version: 2.2.2
188
+ signing_key:
189
+ specification_version: 4
190
+ summary: Arpdb is a Ruby gem for querying SNMP-enabled network devices for their ARP
191
+ database.
192
+ test_files: []