opendns-dnsdb 0.1.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.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +4 -0
  4. data/Gemfile +8 -0
  5. data/LICENSE +20 -0
  6. data/README.md +64 -0
  7. data/Rakefile +6 -0
  8. data/THANKS +1 -0
  9. data/docs/Makefile +177 -0
  10. data/docs/_themes/LICENSE +45 -0
  11. data/docs/_themes/README.rst +25 -0
  12. data/docs/_themes/flask_theme_support.py +86 -0
  13. data/docs/_themes/kr/layout.html +32 -0
  14. data/docs/_themes/kr/relations.html +19 -0
  15. data/docs/_themes/kr/static/flasky.css_t +469 -0
  16. data/docs/_themes/kr/static/small_flask.css +70 -0
  17. data/docs/_themes/kr/theme.conf +7 -0
  18. data/docs/_themes/kr_small/layout.html +22 -0
  19. data/docs/_themes/kr_small/static/flasky.css_t +287 -0
  20. data/docs/_themes/kr_small/theme.conf +10 -0
  21. data/docs/conf.py +261 -0
  22. data/docs/index.rst +101 -0
  23. data/docs/make.bat +242 -0
  24. data/docs/operations/by_ip.rst +229 -0
  25. data/docs/operations/by_name.rst +256 -0
  26. data/docs/operations/label.rst +217 -0
  27. data/docs/operations/related.rst +127 -0
  28. data/docs/operations/traffic.rst +126 -0
  29. data/lib/opendns-dnsdb.rb +5 -0
  30. data/lib/opendns-dnsdb/dnsdb.rb +58 -0
  31. data/lib/opendns-dnsdb/dnsdb/by_ip.rb +69 -0
  32. data/lib/opendns-dnsdb/dnsdb/by_name.rb +93 -0
  33. data/lib/opendns-dnsdb/dnsdb/label.rb +105 -0
  34. data/lib/opendns-dnsdb/dnsdb/related.rb +92 -0
  35. data/lib/opendns-dnsdb/dnsdb/response.rb +41 -0
  36. data/lib/opendns-dnsdb/dnsdb/rrutils.rb +11 -0
  37. data/lib/opendns-dnsdb/dnsdb/siphash.rb +94 -0
  38. data/lib/opendns-dnsdb/dnsdb/traffic.rb +80 -0
  39. data/lib/opendns-dnsdb/version.rb +5 -0
  40. data/opendns-dnsdb.gemspec +20 -0
  41. data/spec/by_ip_spec.rb +54 -0
  42. data/spec/by_name_spec.rb +88 -0
  43. data/spec/label_spec.rb +88 -0
  44. data/spec/related_spec.rb +92 -0
  45. data/spec/spec_helper.rb +5 -0
  46. data/spec/traffic_spec.rb +36 -0
  47. metadata +123 -0
@@ -0,0 +1,70 @@
1
+ /*
2
+ * small_flask.css_t
3
+ * ~~~~~~~~~~~~~~~~~
4
+ *
5
+ * :copyright: Copyright 2010 by Armin Ronacher.
6
+ * :license: Flask Design License, see LICENSE for details.
7
+ */
8
+
9
+ body {
10
+ margin: 0;
11
+ padding: 20px 30px;
12
+ }
13
+
14
+ div.documentwrapper {
15
+ float: none;
16
+ background: white;
17
+ }
18
+
19
+ div.sphinxsidebar {
20
+ display: block;
21
+ float: none;
22
+ width: 102.5%;
23
+ margin: 50px -30px -20px -30px;
24
+ padding: 10px 20px;
25
+ background: #333;
26
+ color: white;
27
+ }
28
+
29
+ div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
30
+ div.sphinxsidebar h3 a {
31
+ color: white;
32
+ }
33
+
34
+ div.sphinxsidebar a {
35
+ color: #aaa;
36
+ }
37
+
38
+ div.sphinxsidebar p.logo {
39
+ display: none;
40
+ }
41
+
42
+ div.document {
43
+ width: 100%;
44
+ margin: 0;
45
+ }
46
+
47
+ div.related {
48
+ display: block;
49
+ margin: 0;
50
+ padding: 10px 0 20px 0;
51
+ }
52
+
53
+ div.related ul,
54
+ div.related ul li {
55
+ margin: 0;
56
+ padding: 0;
57
+ }
58
+
59
+ div.footer {
60
+ display: none;
61
+ }
62
+
63
+ div.bodywrapper {
64
+ margin: 0;
65
+ }
66
+
67
+ div.body {
68
+ min-height: 0;
69
+ padding: 0;
70
+ }
@@ -0,0 +1,7 @@
1
+ [theme]
2
+ inherit = basic
3
+ stylesheet = flasky.css
4
+ pygments_style = flask_theme_support.FlaskyStyle
5
+
6
+ [options]
7
+ touch_icon =
@@ -0,0 +1,22 @@
1
+ {% extends "basic/layout.html" %}
2
+ {% block header %}
3
+ {{ super() }}
4
+ {% if pagename == 'index' %}
5
+ <div class=indexwrapper>
6
+ {% endif %}
7
+ {% endblock %}
8
+ {% block footer %}
9
+ {% if pagename == 'index' %}
10
+ </div>
11
+ {% endif %}
12
+ {% endblock %}
13
+ {# do not display relbars #}
14
+ {% block relbar1 %}{% endblock %}
15
+ {% block relbar2 %}
16
+ {% if theme_github_fork %}
17
+ <a href="http://github.com/{{ theme_github_fork }}"><img style="position: fixed; top: 0; right: 0; border: 0;"
18
+ src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
19
+ {% endif %}
20
+ {% endblock %}
21
+ {% block sidebar1 %}{% endblock %}
22
+ {% block sidebar2 %}{% endblock %}
@@ -0,0 +1,287 @@
1
+ /*
2
+ * flasky.css_t
3
+ * ~~~~~~~~~~~~
4
+ *
5
+ * Sphinx stylesheet -- flasky theme based on nature theme.
6
+ *
7
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
8
+ * :license: BSD, see LICENSE for details.
9
+ *
10
+ */
11
+
12
+ @import url("basic.css");
13
+
14
+ /* -- page layout ----------------------------------------------------------- */
15
+
16
+ body {
17
+ font-family: 'Georgia', serif;
18
+ font-size: 17px;
19
+ color: #000;
20
+ background: white;
21
+ margin: 0;
22
+ padding: 0;
23
+ }
24
+
25
+ div.documentwrapper {
26
+ float: left;
27
+ width: 100%;
28
+ }
29
+
30
+ div.bodywrapper {
31
+ margin: 40px auto 0 auto;
32
+ width: 700px;
33
+ }
34
+
35
+ hr {
36
+ border: 1px solid #B1B4B6;
37
+ }
38
+
39
+ div.body {
40
+ background-color: #ffffff;
41
+ color: #3E4349;
42
+ padding: 0 30px 30px 30px;
43
+ }
44
+
45
+ img.floatingflask {
46
+ padding: 0 0 10px 10px;
47
+ float: right;
48
+ }
49
+
50
+ div.footer {
51
+ text-align: right;
52
+ color: #888;
53
+ padding: 10px;
54
+ font-size: 14px;
55
+ width: 650px;
56
+ margin: 0 auto 40px auto;
57
+ }
58
+
59
+ div.footer a {
60
+ color: #888;
61
+ text-decoration: underline;
62
+ }
63
+
64
+ div.related {
65
+ line-height: 32px;
66
+ color: #888;
67
+ }
68
+
69
+ div.related ul {
70
+ padding: 0 0 0 10px;
71
+ }
72
+
73
+ div.related a {
74
+ color: #444;
75
+ }
76
+
77
+ /* -- body styles ----------------------------------------------------------- */
78
+
79
+ a {
80
+ color: #004B6B;
81
+ text-decoration: underline;
82
+ }
83
+
84
+ a:hover {
85
+ color: #6D4100;
86
+ text-decoration: underline;
87
+ }
88
+
89
+ div.body {
90
+ padding-bottom: 40px; /* saved for footer */
91
+ }
92
+
93
+ div.body h1,
94
+ div.body h2,
95
+ div.body h3,
96
+ div.body h4,
97
+ div.body h5,
98
+ div.body h6 {
99
+ font-family: 'Garamond', 'Georgia', serif;
100
+ font-weight: normal;
101
+ margin: 30px 0px 10px 0px;
102
+ padding: 0;
103
+ }
104
+
105
+ {% if theme_index_logo %}
106
+ div.indexwrapper h1 {
107
+ text-indent: -999999px;
108
+ background: url({{ theme_index_logo }}) no-repeat center center;
109
+ height: {{ theme_index_logo_height }};
110
+ }
111
+ {% endif %}
112
+
113
+ div.body h2 { font-size: 180%; }
114
+ div.body h3 { font-size: 150%; }
115
+ div.body h4 { font-size: 130%; }
116
+ div.body h5 { font-size: 100%; }
117
+ div.body h6 { font-size: 100%; }
118
+
119
+ a.headerlink {
120
+ color: white;
121
+ padding: 0 4px;
122
+ text-decoration: none;
123
+ }
124
+
125
+ a.headerlink:hover {
126
+ color: #444;
127
+ background: #eaeaea;
128
+ }
129
+
130
+ div.body p, div.body dd, div.body li {
131
+ line-height: 1.4em;
132
+ }
133
+
134
+ div.admonition {
135
+ background: #fafafa;
136
+ margin: 20px -30px;
137
+ padding: 10px 30px;
138
+ border-top: 1px solid #ccc;
139
+ border-bottom: 1px solid #ccc;
140
+ }
141
+
142
+ div.admonition p.admonition-title {
143
+ font-family: 'Garamond', 'Georgia', serif;
144
+ font-weight: normal;
145
+ font-size: 24px;
146
+ margin: 0 0 10px 0;
147
+ padding: 0;
148
+ line-height: 1;
149
+ }
150
+
151
+ div.admonition p.last {
152
+ margin-bottom: 0;
153
+ }
154
+
155
+ div.highlight{
156
+ background-color: white;
157
+ }
158
+
159
+ dt:target, .highlight {
160
+ background: #FAF3E8;
161
+ }
162
+
163
+ div.note {
164
+ background-color: #eee;
165
+ border: 1px solid #ccc;
166
+ }
167
+
168
+ div.seealso {
169
+ background-color: #ffc;
170
+ border: 1px solid #ff6;
171
+ }
172
+
173
+ div.topic {
174
+ background-color: #eee;
175
+ }
176
+
177
+ div.warning {
178
+ background-color: #ffe4e4;
179
+ border: 1px solid #f66;
180
+ }
181
+
182
+ p.admonition-title {
183
+ display: inline;
184
+ }
185
+
186
+ p.admonition-title:after {
187
+ content: ":";
188
+ }
189
+
190
+ pre, tt {
191
+ font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
192
+ font-size: 0.85em;
193
+ }
194
+
195
+ img.screenshot {
196
+ }
197
+
198
+ tt.descname, tt.descclassname {
199
+ font-size: 0.95em;
200
+ }
201
+
202
+ tt.descname {
203
+ padding-right: 0.08em;
204
+ }
205
+
206
+ img.screenshot {
207
+ -moz-box-shadow: 2px 2px 4px #eee;
208
+ -webkit-box-shadow: 2px 2px 4px #eee;
209
+ box-shadow: 2px 2px 4px #eee;
210
+ }
211
+
212
+ table.docutils {
213
+ border: 1px solid #888;
214
+ -moz-box-shadow: 2px 2px 4px #eee;
215
+ -webkit-box-shadow: 2px 2px 4px #eee;
216
+ box-shadow: 2px 2px 4px #eee;
217
+ }
218
+
219
+ table.docutils td, table.docutils th {
220
+ border: 1px solid #888;
221
+ padding: 0.25em 0.7em;
222
+ }
223
+
224
+ table.field-list, table.footnote {
225
+ border: none;
226
+ -moz-box-shadow: none;
227
+ -webkit-box-shadow: none;
228
+ box-shadow: none;
229
+ }
230
+
231
+ table.footnote {
232
+ margin: 15px 0;
233
+ width: 100%;
234
+ border: 1px solid #eee;
235
+ }
236
+
237
+ table.field-list th {
238
+ padding: 0 0.8em 0 0;
239
+ }
240
+
241
+ table.field-list td {
242
+ padding: 0;
243
+ }
244
+
245
+ table.footnote td {
246
+ padding: 0.5em;
247
+ }
248
+
249
+ dl {
250
+ margin: 0;
251
+ padding: 0;
252
+ }
253
+
254
+ dl dd {
255
+ margin-left: 30px;
256
+ }
257
+
258
+ pre {
259
+ padding: 0;
260
+ margin: 15px -30px;
261
+ padding: 8px;
262
+ line-height: 1.3em;
263
+ padding: 7px 30px;
264
+ background: #eee;
265
+ border-radius: 2px;
266
+ -moz-border-radius: 2px;
267
+ -webkit-border-radius: 2px;
268
+ }
269
+
270
+ dl pre {
271
+ margin-left: -60px;
272
+ padding-left: 60px;
273
+ }
274
+
275
+ tt {
276
+ background-color: #ecf0f3;
277
+ color: #222;
278
+ /* padding: 1px 2px; */
279
+ }
280
+
281
+ tt.xref, a tt {
282
+ background-color: #FBFBFB;
283
+ }
284
+
285
+ a:hover tt {
286
+ background: #EEE;
287
+ }
@@ -0,0 +1,10 @@
1
+ [theme]
2
+ inherit = basic
3
+ stylesheet = flasky.css
4
+ nosidebar = true
5
+ pygments_style = flask_theme_support.FlaskyStyle
6
+
7
+ [options]
8
+ index_logo = ''
9
+ index_logo_height = 120px
10
+ github_fork = ''
@@ -0,0 +1,261 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # OpenDNS DNS Database Client Library documentation build configuration file, created by
4
+ # sphinx-quickstart on Wed Oct 16 22:03:30 2013.
5
+ #
6
+ # This file is execfile()d with the current directory set to its
7
+ # containing dir.
8
+ #
9
+ # Note that not all possible configuration values are present in this
10
+ # autogenerated file.
11
+ #
12
+ # All configuration values have a default; values that are commented out
13
+ # serve to show the default.
14
+
15
+ import sys
16
+ import os
17
+
18
+ # If extensions (or modules to document with autodoc) are in another directory,
19
+ # add these directories to sys.path here. If the directory is relative to the
20
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
21
+ #sys.path.insert(0, os.path.abspath('.'))
22
+
23
+ # -- General configuration ------------------------------------------------
24
+
25
+ # If your documentation needs a minimal Sphinx version, state it here.
26
+ #needs_sphinx = '1.0'
27
+
28
+ # Add any Sphinx extension module names here, as strings. They can be
29
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30
+ # ones.
31
+ extensions = []
32
+
33
+ # Add any paths that contain templates here, relative to this directory.
34
+ templates_path = ['_templates']
35
+
36
+ # The suffix of source filenames.
37
+ source_suffix = '.rst'
38
+
39
+ # The encoding of source files.
40
+ #source_encoding = 'utf-8-sig'
41
+
42
+ # The master toctree document.
43
+ master_doc = 'index'
44
+
45
+ # General information about the project.
46
+ project = u'OpenDNS DNS Database Client Library'
47
+ copyright = u'2013, Frank Denis'
48
+
49
+ # The version info for the project you're documenting, acts as replacement for
50
+ # |version| and |release|, also used in various other places throughout the
51
+ # built documents.
52
+ #
53
+ # The short X.Y version.
54
+ version = '0.1'
55
+ # The full version, including alpha/beta/rc tags.
56
+ release = '0.1'
57
+
58
+ # The language for content autogenerated by Sphinx. Refer to documentation
59
+ # for a list of supported languages.
60
+ #language = None
61
+
62
+ # There are two options for replacing |today|: either, you set today to some
63
+ # non-false value, then it is used:
64
+ #today = ''
65
+ # Else, today_fmt is used as the format for a strftime call.
66
+ #today_fmt = '%B %d, %Y'
67
+
68
+ # List of patterns, relative to source directory, that match files and
69
+ # directories to ignore when looking for source files.
70
+ exclude_patterns = ['_build']
71
+
72
+ # The reST default role (used for this markup: `text`) to use for all
73
+ # documents.
74
+ #default_role = None
75
+
76
+ # If true, '()' will be appended to :func: etc. cross-reference text.
77
+ #add_function_parentheses = True
78
+
79
+ # If true, the current module name will be prepended to all description
80
+ # unit titles (such as .. function::).
81
+ #add_module_names = True
82
+
83
+ # If true, sectionauthor and moduleauthor directives will be shown in the
84
+ # output. They are ignored by default.
85
+ #show_authors = False
86
+
87
+ # The name of the Pygments (syntax highlighting) style to use.
88
+ pygments_style = 'sphinx'
89
+
90
+ # A list of ignored prefixes for module index sorting.
91
+ #modindex_common_prefix = []
92
+
93
+ # If true, keep warnings as "system message" paragraphs in the built documents.
94
+ #keep_warnings = False
95
+
96
+
97
+ # -- Options for HTML output ----------------------------------------------
98
+
99
+ # The theme to use for HTML and HTML Help pages. See the documentation for
100
+ # a list of builtin themes.
101
+
102
+ sys.path.append(os.path.abspath('_themes'))
103
+ html_theme_path = ['_themes']
104
+ html_theme = 'kr'
105
+
106
+ # Theme options are theme-specific and customize the look and feel of a theme
107
+ # further. For a list of options available for each theme, see the
108
+ # documentation.
109
+ #html_theme_options = {}
110
+
111
+ # Add any paths that contain custom themes here, relative to this directory.
112
+ #html_theme_path = []
113
+
114
+ # The name for this set of Sphinx documents. If None, it defaults to
115
+ # "<project> v<release> documentation".
116
+ #html_title = None
117
+
118
+ # A shorter title for the navigation bar. Default is the same as html_title.
119
+ #html_short_title = None
120
+
121
+ # The name of an image file (relative to this directory) to place at the top
122
+ # of the sidebar.
123
+ #html_logo = None
124
+
125
+ # The name of an image file (within the static path) to use as favicon of the
126
+ # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
127
+ # pixels large.
128
+ #html_favicon = None
129
+
130
+ # Add any paths that contain custom static files (such as style sheets) here,
131
+ # relative to this directory. They are copied after the builtin static files,
132
+ # so a file named "default.css" will overwrite the builtin "default.css".
133
+ html_static_path = ['_static']
134
+
135
+ # Add any extra paths that contain custom files (such as robots.txt or
136
+ # .htaccess) here, relative to this directory. These files are copied
137
+ # directly to the root of the documentation.
138
+ #html_extra_path = []
139
+
140
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
141
+ # using the given strftime format.
142
+ #html_last_updated_fmt = '%b %d, %Y'
143
+
144
+ # If true, SmartyPants will be used to convert quotes and dashes to
145
+ # typographically correct entities.
146
+ #html_use_smartypants = True
147
+
148
+ # Custom sidebar templates, maps document names to template names.
149
+ #html_sidebars = {}
150
+
151
+ # Additional templates that should be rendered to pages, maps page names to
152
+ # template names.
153
+ #html_additional_pages = {}
154
+
155
+ # If false, no module index is generated.
156
+ #html_domain_indices = True
157
+
158
+ # If false, no index is generated.
159
+ #html_use_index = True
160
+
161
+ # If true, the index is split into individual pages for each letter.
162
+ #html_split_index = False
163
+
164
+ # If true, links to the reST sources are added to the pages.
165
+ #html_show_sourcelink = True
166
+
167
+ # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
168
+ #html_show_sphinx = True
169
+
170
+ # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
171
+ #html_show_copyright = True
172
+
173
+ # If true, an OpenSearch description file will be output, and all pages will
174
+ # contain a <link> tag referring to it. The value of this option must be the
175
+ # base URL from which the finished HTML is served.
176
+ #html_use_opensearch = ''
177
+
178
+ # This is the file name suffix for HTML files (e.g. ".xhtml").
179
+ #html_file_suffix = None
180
+
181
+ # Output file base name for HTML help builder.
182
+ htmlhelp_basename = 'OpenDNSDNSDatabaseClientLibrarydoc'
183
+
184
+
185
+ # -- Options for LaTeX output ---------------------------------------------
186
+
187
+ latex_elements = {
188
+ # The paper size ('letterpaper' or 'a4paper').
189
+ #'papersize': 'letterpaper',
190
+
191
+ # The font size ('10pt', '11pt' or '12pt').
192
+ #'pointsize': '10pt',
193
+
194
+ # Additional stuff for the LaTeX preamble.
195
+ #'preamble': '',
196
+ }
197
+
198
+ # Grouping the document tree into LaTeX files. List of tuples
199
+ # (source start file, target name, title,
200
+ # author, documentclass [howto, manual, or own class]).
201
+ latex_documents = [
202
+ ('index', 'OpenDNSDNSDatabaseClientLibrary.tex', u'OpenDNS DNS Database Client Library Documentation',
203
+ u'Frank Denis', 'manual'),
204
+ ]
205
+
206
+ # The name of an image file (relative to this directory) to place at the top of
207
+ # the title page.
208
+ #latex_logo = None
209
+
210
+ # For "manual" documents, if this is true, then toplevel headings are parts,
211
+ # not chapters.
212
+ #latex_use_parts = False
213
+
214
+ # If true, show page references after internal links.
215
+ #latex_show_pagerefs = False
216
+
217
+ # If true, show URL addresses after external links.
218
+ #latex_show_urls = False
219
+
220
+ # Documents to append as an appendix to all manuals.
221
+ #latex_appendices = []
222
+
223
+ # If false, no module index is generated.
224
+ #latex_domain_indices = True
225
+
226
+
227
+ # -- Options for manual page output ---------------------------------------
228
+
229
+ # One entry per manual page. List of tuples
230
+ # (source start file, name, description, authors, manual section).
231
+ man_pages = [
232
+ ('index', 'opendnsdnsdatabaseclientlibrary', u'OpenDNS DNS Database Client Library Documentation',
233
+ [u'Frank Denis'], 1)
234
+ ]
235
+
236
+ # If true, show URL addresses after external links.
237
+ #man_show_urls = False
238
+
239
+
240
+ # -- Options for Texinfo output -------------------------------------------
241
+
242
+ # Grouping the document tree into Texinfo files. List of tuples
243
+ # (source start file, target name, title, author,
244
+ # dir menu entry, description, category)
245
+ texinfo_documents = [
246
+ ('index', 'OpenDNSDNSDatabaseClientLibrary', u'OpenDNS DNS Database Client Library Documentation',
247
+ u'Frank Denis', 'OpenDNSDNSDatabaseClientLibrary', 'One line description of project.',
248
+ 'Miscellaneous'),
249
+ ]
250
+
251
+ # Documents to append as an appendix to all manuals.
252
+ #texinfo_appendices = []
253
+
254
+ # If false, no module index is generated.
255
+ #texinfo_domain_indices = True
256
+
257
+ # How to display URL addresses: 'footnote', 'no', or 'inline'.
258
+ #texinfo_show_urls = 'footnote'
259
+
260
+ # If true, do not generate a @detailmenu in the "Top" node's menu.
261
+ #texinfo_no_detailmenu = False