ronin-web 0.2.1 → 0.3.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/.document +4 -0
  2. data/.gemtest +0 -0
  3. data/.rspec +1 -0
  4. data/.yardopts +1 -0
  5. data/COPYING.txt +674 -0
  6. data/{History.txt → ChangeLog.md} +39 -8
  7. data/Gemfile +49 -0
  8. data/{README.txt → README.md} +56 -40
  9. data/Rakefile +25 -24
  10. data/bin/ronin-web +18 -5
  11. data/gemspec.yml +30 -0
  12. data/lib/ronin/network/{helpers → mixins}/web.rb +74 -39
  13. data/lib/ronin/web.rb +7 -6
  14. data/lib/ronin/web/extensions.rb +7 -6
  15. data/lib/ronin/web/extensions/nokogiri.rb +22 -0
  16. data/lib/ronin/web/extensions/nokogiri/xml.rb +22 -0
  17. data/lib/ronin/web/extensions/nokogiri/xml/attr.rb +35 -1
  18. data/lib/ronin/web/extensions/nokogiri/xml/document.rb +34 -4
  19. data/lib/ronin/web/extensions/nokogiri/xml/element.rb +36 -2
  20. data/lib/ronin/web/extensions/nokogiri/xml/node.rb +59 -20
  21. data/lib/ronin/web/extensions/nokogiri/xml/text.rb +36 -2
  22. data/lib/ronin/web/middleware.rb +27 -0
  23. data/lib/ronin/web/middleware/base.rb +144 -0
  24. data/lib/ronin/web/middleware/directories.rb +177 -0
  25. data/lib/ronin/web/middleware/files.rb +142 -0
  26. data/lib/ronin/web/middleware/filters.rb +28 -0
  27. data/lib/ronin/web/middleware/filters/campaign_filter.rb +77 -0
  28. data/lib/ronin/web/middleware/filters/ip_filter.rb +73 -0
  29. data/lib/ronin/web/middleware/filters/path_filter.rb +73 -0
  30. data/lib/ronin/web/middleware/filters/referer_filter.rb +71 -0
  31. data/lib/ronin/web/middleware/filters/user_agent_filter.rb +71 -0
  32. data/lib/ronin/web/middleware/filters/vhost_filter.rb +71 -0
  33. data/lib/ronin/web/middleware/helpers.rb +145 -0
  34. data/lib/ronin/web/middleware/proxy.rb +265 -0
  35. data/lib/ronin/web/middleware/proxy_request.rb +262 -0
  36. data/lib/ronin/web/middleware/request.rb +58 -0
  37. data/lib/ronin/web/middleware/response.rb +33 -0
  38. data/lib/ronin/web/middleware/router.rb +167 -0
  39. data/lib/ronin/web/middleware/rule.rb +103 -0
  40. data/lib/ronin/web/proxy.rb +7 -6
  41. data/lib/ronin/web/proxy/app.rb +7 -6
  42. data/lib/ronin/web/proxy/base.rb +14 -9
  43. data/lib/ronin/web/proxy/web.rb +9 -6
  44. data/lib/ronin/web/server.rb +7 -6
  45. data/lib/ronin/web/server/app.rb +7 -6
  46. data/lib/ronin/web/server/base.rb +209 -82
  47. data/lib/ronin/web/server/web.rb +10 -6
  48. data/lib/ronin/web/spider.rb +38 -26
  49. data/lib/ronin/web/version.rb +8 -7
  50. data/lib/ronin/web/web.rb +122 -80
  51. data/ronin-web.gemspec +15 -0
  52. data/spec/helpers/output.rb +3 -0
  53. data/spec/spec_helper.rb +2 -3
  54. data/spec/web/extensions/nokogiri_spec.rb +7 -7
  55. data/spec/web/{server/helpers/server.rb → helpers/rack_app.rb} +3 -14
  56. data/spec/web/helpers/root.rb +15 -0
  57. data/spec/web/helpers/root/test1.txt +1 -0
  58. data/spec/web/helpers/root/test1/index.html +1 -0
  59. data/spec/web/helpers/root/test1/test1.txt +1 -0
  60. data/spec/web/helpers/root/test2.txt +1 -0
  61. data/spec/web/helpers/root/test2/test2.txt +1 -0
  62. data/spec/web/helpers/root/test3.txt +1 -0
  63. data/spec/web/helpers/root/test3/test3.txt +1 -0
  64. data/spec/web/middleware/directories_spec.rb +86 -0
  65. data/spec/web/middleware/files_spec.rb +57 -0
  66. data/spec/web/middleware/filters/campaign_filter_spec.rb +30 -0
  67. data/spec/web/middleware/filters/ip_filter_spec.rb +25 -0
  68. data/spec/web/middleware/filters/path_filter_spec.rb +29 -0
  69. data/spec/web/middleware/filters/referer_filter_spec.rb +25 -0
  70. data/spec/web/middleware/filters/user_agent_filter_spec.rb +25 -0
  71. data/spec/web/middleware/filters/vhost_filter_spec.rb +23 -0
  72. data/spec/web/middleware/proxy_spec.rb +67 -0
  73. data/spec/web/middleware/response_spec.rb +20 -0
  74. data/spec/web/middleware/router_spec.rb +65 -0
  75. data/spec/web/middleware/rule_spec.rb +37 -0
  76. data/spec/web/proxy/base_spec.rb +1 -2
  77. data/spec/web/server/base_spec.rb +4 -13
  78. data/spec/web/server/classes/sub_app.rb +2 -2
  79. data/spec/web/server/classes/test_app.rb +1 -1
  80. data/spec/web/web_spec.rb +57 -67
  81. metadata +171 -146
  82. data.tar.gz.sig +0 -0
  83. data/Manifest.txt +0 -64
  84. data/lib/ronin/scanners/web.rb +0 -52
  85. data/lib/ronin/web/server/files.rb +0 -92
  86. data/lib/ronin/web/server/helpers.rb +0 -25
  87. data/lib/ronin/web/server/helpers/files.rb +0 -126
  88. data/lib/ronin/web/server/helpers/hosts.rb +0 -72
  89. data/lib/ronin/web/server/helpers/proxy.rb +0 -153
  90. data/lib/ronin/web/server/helpers/rendering.rb +0 -36
  91. data/lib/ronin/web/server/hosts.rb +0 -86
  92. data/lib/ronin/web/server/proxy.rb +0 -116
  93. data/spec/scanners/web_spec.rb +0 -24
  94. data/spec/web/helpers/root/index.html +0 -1
  95. data/spec/web/helpers/root/test.txt +0 -1
  96. data/spec/web/helpers/server.rb +0 -10
  97. data/spec/web/server/classes/files/dir/file.txt +0 -1
  98. data/spec/web/server/classes/files/dir/index.html +0 -1
  99. data/spec/web/server/classes/files/dir2/file2.txt +0 -1
  100. data/spec/web/server/classes/files/dir3/page.xml +0 -4
  101. data/spec/web/server/classes/files/file.txt +0 -1
  102. data/spec/web/server/classes/files_app.rb +0 -27
  103. data/spec/web/server/classes/hosts_app.rb +0 -40
  104. data/spec/web/server/classes/proxy_app.rb +0 -45
  105. data/spec/web/server/files_spec.rb +0 -74
  106. data/spec/web/server/hosts_spec.rb +0 -55
  107. data/spec/web/server/proxy_spec.rb +0 -49
  108. data/tasks/spec.rb +0 -10
  109. data/tasks/yard.rb +0 -13
  110. metadata.gz.sig +0 -3
@@ -1,4 +1,35 @@
1
- === 0.2.1 / 2009-10-18
1
+ ### 0.3.0 / 2011-05-27
2
+
3
+ * Upgraded to the GPL-3 license.
4
+ * Require nokogiri ~> 1.4.
5
+ * Require mechanize ~> 1.0.
6
+ * Require spidr ~> 0.2.
7
+ * Require sinatra ~> 1.2.
8
+ * Require data_paths ~> 0.3.
9
+ * Require ronin-support ~> 0.2.
10
+ * Require ronin ~> 1.1.
11
+ * Added {Ronin::Web::Middleware::Base}.
12
+ * Added {Ronin::Web::Middleware::Request}.
13
+ * Added {Ronin::Web::Middleware::Response}.
14
+ * Added {Ronin::Web::Middleware::Helpers}.
15
+ * Added {Ronin::Web::Middleware::Files}.
16
+ * Added {Ronin::Web::Middleware::Directories}.
17
+ * Added {Ronin::Web::Middleware::Rule}.
18
+ * Added {Ronin::Web::Middleware::Filters::CampaignFilter}.
19
+ * Added {Ronin::Web::Middleware::Filters::IPFilter}.
20
+ * Added {Ronin::Web::Middleware::Filters::PathFilter}.
21
+ * Added {Ronin::Web::Middleware::Filters::RefererFilter}.
22
+ * Added {Ronin::Web::Middleware::Filters::UserAgentFilter}.
23
+ * Added {Ronin::Web::Middleware::Filters::VHostFilter}.
24
+ * Added {Ronin::Web::Middleware::Router}.
25
+ * Added {Ronin::Web::Middleware::Proxy}.
26
+ * Renamed `Ronin::Helpers::Web` to {Ronin::Network::Mixins::Web}.
27
+ * Renamed `Ronin::Web::Server::Proxy` to {Ronin::Web::Proxy}.
28
+ * Switched from [Jeweler](https://github.com/technicalpickles/jeweler)
29
+ to [Ore](http://github.com/ruby-ore/ore) and [Bundler](http://gembundler.com).
30
+ * Opted into [test.rubygems.org](http://test.rubygems.org/).
31
+
32
+ ### 0.2.1 / 2009-10-18
2
33
 
3
34
  * Require spidr >= 0.2.0.
4
35
  * Added Ronin::Scanners::Web.
@@ -6,7 +37,7 @@
6
37
  * Renamed Ronin::Web.proxy to Ronin::Web.proxy_server, to not conflict
7
38
  with the original Ronin::Web.proxy method.
8
39
 
9
- === 0.2.0 / 2009-09-24
40
+ ### 0.2.0 / 2009-09-24
10
41
 
11
42
  * Require ronin >= 0.3.0.
12
43
  * Require mechanize >= 0.9.3.
@@ -31,7 +62,7 @@
31
62
  * Refactored the Ronin::Web::Server to build ontop of Sinatra.
32
63
  * Refactored Ronin::Network::Helpers::Web.
33
64
 
34
- === 0.1.3 / 2009-07-02
65
+ ### 0.1.3 / 2009-07-02
35
66
 
36
67
  * Use Hoe >= 2.0.0.
37
68
  * Require spidr >= 0.1.9.
@@ -49,7 +80,7 @@
49
80
  * Removed Server.run.
50
81
  * Removed Server#config.
51
82
 
52
- === 0.1.2 / 2009-03-28
83
+ ### 0.1.2 / 2009-03-28
53
84
 
54
85
  * Added Ronin::Web::Proxy.
55
86
  * Added diagnostic messages to Ronin::Web::Spider.
@@ -59,10 +90,10 @@
59
90
  standard env Hash.
60
91
  * Updated specs for Ronin::Web::Server.
61
92
 
62
- === 0.1.1 / 2009-02-23
93
+ ### 0.1.1 / 2009-02-23
63
94
 
64
- * Added a git style sub-command (<tt>ronin-web</tt>) which starts the Ronin
65
- console with <tt>ronin/web</tt> preloaded.
95
+ * Added a git style sub-command (`ronin-web`) which starts the Ronin
96
+ console with `ronin/web` preloaded.
66
97
  * Require Nokogiri >= 1.2.0.
67
98
  * Require Ronin >= 0.2.1.
68
99
  * Updated Ronin::Web::Server:
@@ -72,7 +103,7 @@
72
103
  * Fixed a bug when loading the Nokogiri extensions with Nokogiri >= 1.2.0.
73
104
  * Updated README.txt.
74
105
 
75
- === 0.1.0 / 2009-01-22
106
+ ### 0.1.0 / 2009-01-22
76
107
 
77
108
  * Initial release.
78
109
  * Provides Web.html and Web.xml methods, which use Nokogiri::HTML and
data/Gemfile ADDED
@@ -0,0 +1,49 @@
1
+ source 'https://rubygems.org'
2
+
3
+ DM_URI = 'http://github.com/datamapper'
4
+ DM_VERSION = '~> 1.1.0'
5
+ RONIN_URI = 'http://github.com/ronin-ruby'
6
+
7
+ gemspec
8
+
9
+ # gem 'rack', '~> 1.2', :git => 'http://github.com/rack/rack.git'
10
+ # gem 'sinatra', '~> 1.2', :git => 'http://github.com/sinatra/sinatra.git'
11
+
12
+ # Ronin dependencies
13
+ # gem 'ronin-support', '~> 0.2', :git => "#{RONIN_URI}/ronin-support.git"
14
+ # gem 'ronin', '~> 1.1', :git => "#{RONIN_URI}/ronin.git"
15
+
16
+ group :test do
17
+ gem 'rack', '~> 1.2', :git => 'http://github.com/rack/rack.git'
18
+ gem 'rack-test', '~> 0.6.0'
19
+ end
20
+
21
+ group :development do
22
+ gem 'rake', '~> 0.8.7'
23
+
24
+ gem 'ore-tasks', '~> 0.4'
25
+ gem 'rspec', '~> 2.4'
26
+
27
+ gem 'kramdown', '~> 0.12'
28
+ end
29
+
30
+ #
31
+ # To enable additional DataMapper adapters for development work or for
32
+ # testing purposes, simple set the ADAPTER or ADAPTERS environment
33
+ # variable:
34
+ #
35
+ # export ADAPTER="postgres"
36
+ # bundle install
37
+ #
38
+ # ./bin/ronin --database postgres://ronin@localhost/ronin
39
+ #
40
+ require 'set'
41
+
42
+ DM_ADAPTERS = Set['postgres', 'mysql', 'oracle', 'sqlserver']
43
+
44
+ adapters = (ENV['ADAPTER'] || ENV['ADAPTERS']).to_s
45
+ adapters = Set.new(adapters.to_s.tr(',',' ').split)
46
+
47
+ (DM_ADAPTERS & adapters).each do |adapter|
48
+ gem "dm-#{adapter}-adapter", DM_VERSION #, :git => "#{DM_URI}/dm-#{adapter}-adapter.git"
49
+ end
@@ -1,11 +1,12 @@
1
- = Ronin Web
1
+ # Ronin Web
2
2
 
3
- * http://ronin.rubyforge.org/web/
4
- * http://github.com/postmodern/ronin-web
3
+ * [Source](http://github.com/ronin-ruby/ronin-web)
4
+ * [Issues](http://github.com/ronin-ruby/ronin-web/issues)
5
+ * [Documentation](http://rubydoc.info/github/ronin-ruby/ronin-web/frames)
6
+ * [Mailing List](http://groups.google.com/group/ronin-ruby)
5
7
  * irc.freenode.net #ronin
6
- * Postmodern (postmodern.mod3 at gmail.com)
7
8
 
8
- == DESCRIPTION:
9
+ ## Description
9
10
 
10
11
  Ronin Web is a Ruby library for Ronin that provides support for web
11
12
  scraping and spidering functionality.
@@ -14,56 +15,65 @@ Ronin is a Ruby platform for exploit development and security research.
14
15
  Ronin allows for the rapid development and distribution of code, exploits
15
16
  or payloads over many common Source-Code-Management (SCM) systems.
16
17
 
17
- === Ruby
18
+ ### Ruby
18
19
 
19
20
  Ronin's Ruby environment allows security researchers to leverage Ruby with
20
21
  ease. The Ruby environment contains a multitude of convenience methods
21
22
  for working with data in Ruby, a Ruby Object Database, a customized Ruby
22
23
  Console and an extendable command-line interface.
23
24
 
24
- === Extend
25
+ ### Extend
25
26
 
26
27
  Ronin's more specialized features are provided by additional Ronin
27
28
  libraries, which users can choose to install. These libraries can allow
28
29
  one to write and run Exploits and Payloads, scan for PHP vulnerabilities,
29
30
  perform Google Dorks or run 3rd party scanners.
30
31
 
31
- === Publish
32
+ ### Publish
32
33
 
33
34
  Ronin allows users to publish and share code, exploits, payloads or other
34
35
  data via Overlays. Overlays are directories of code and data that can be
35
36
  hosted on any SVN, Hg, Git or Rsync server. Ronin makes it easy to create,
36
37
  install or update Overlays.
37
38
 
38
- == FEATURES:
39
+ ## Features
39
40
 
40
- * Web access (utilizing Mechanize and Nokogiri).
41
- * Integrates Spidr into Ronin::Web::Spider.
42
- * Provides Ronin::Web::Server, a customizable Sinatra based Web Server that
43
- supports path and host-name routing.
44
- * Provides Ronin::Web::Proxy, a configurable Sinatra based Web Proxy.
41
+ * Web access (utilizing [Mechanize](http://rubydoc.info/gems/mechanize/frames)
42
+ and [Nokogiri](http://rubydoc.info/gems/nokogiri/frames).
43
+ * Integrates [Spidr](http://github.com/postmodern/spidr#readme) into
44
+ {Ronin::Web::Spider}.
45
+ * Provides a collection of useful [Rack](http://rack.rubyforge.org/)
46
+ Middleware:
47
+ * {Ronin::Web::Middleware::Files}
48
+ * {Ronin::Web::Middleware::Directories}
49
+ * {Ronin::Web::Middleware::Proxy}
50
+ * {Ronin::Web::Middleware::Router}
51
+ * Provides {Ronin::Web::Server}, a [Sinatra](http://sinatrarb.com/) based
52
+ Web Server.
53
+ * Provides {Ronin::Web::Proxy}, a [Sinatra](http://sinatrarb.com/) based
54
+ Web Proxy.
45
55
 
46
- == SYNOPSIS:
56
+ ## Synopsis
47
57
 
48
- * Start the Ronin console with Ronin Web preloaded:
58
+ Start the Ronin console with Ronin Web preloaded:
49
59
 
50
60
  $ ronin-web
51
61
 
52
- == EXAMPLES:
62
+ ## Examples
53
63
 
54
- * Get a web-page:
64
+ Get a web-page:
55
65
 
56
66
  Web.get('http://www.rubyinside.com/')
57
67
 
58
- * Get only the body of the web-page:
68
+ Get only the body of the web-page:
59
69
 
60
70
  Web.get_body('http://www.rubyinside.com/')
61
71
 
62
- * Get a WWW::Mechanize agent:
72
+ Get a [Mechanize agent](http://rubydoc.info/gems/mechanize/1.0.0/Mechanize):
63
73
 
64
74
  agent = Web.agent
65
75
 
66
- * Parse HTML:
76
+ Parse HTML:
67
77
 
68
78
  Web.html(open('some_file.html'))
69
79
  # => <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
@@ -73,7 +83,7 @@ install or update Overlays.
73
83
  # </head>
74
84
  # </html>
75
85
 
76
- * Build a HTML document:
86
+ Build a HTML document:
77
87
 
78
88
  doc = Web.build_html do
79
89
  html {
@@ -87,7 +97,7 @@ install or update Overlays.
87
97
  # <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
88
98
  # <html><head><script src="redirect.js" type="text/javascript"></script></head></html>
89
99
 
90
- * Parse XML:
100
+ Parse XML:
91
101
 
92
102
  Web.xml(some_text)
93
103
  # => <?xml version="1.0"?>
@@ -99,7 +109,7 @@ install or update Overlays.
99
109
  # </users>
100
110
 
101
111
 
102
- * Build a XML document:
112
+ Build a XML document:
103
113
 
104
114
  doc = Web.build_xml do
105
115
  playlist {
@@ -123,7 +133,7 @@ install or update Overlays.
123
133
  # </mp3>
124
134
  # </playlist>
125
135
 
126
- * Spider a web site:
136
+ Spider a web site:
127
137
 
128
138
  Web::Spider.host('www.example.com') do |spider|
129
139
  spider.every_url do |url|
@@ -135,7 +145,7 @@ install or update Overlays.
135
145
  end
136
146
  end
137
147
 
138
- * Serve files via a Web Server:
148
+ Serve files via a Web Server:
139
149
 
140
150
  require 'ronin/web/server'
141
151
 
@@ -148,34 +158,40 @@ install or update Overlays.
148
158
  'Test 1 2 1 2'
149
159
  end
150
160
 
151
- == REQUIREMENTS:
161
+ ## Requirements
152
162
 
153
- * {mechanize}[http://mechanize.rubyforge.org/] >= 0.9.3
154
- * {spidr}[http://spidr.rubyforge.org/] >= 0.2.0
155
- * {sinatra}[http://www.sinatrarb.com/] >= 0.9.4
156
- * {ronin}[http://ronin.rubyforge.org/] >= 0.3.0
163
+ * [nokogiri](http://github.com/tenderlove/nokogiri) ~> 1.4
164
+ * [libxml2](http://xmlsoft.org/)
165
+ * [libxslt1](http://xmlsoft.org/XSLT/)
166
+ * [mechanize](http://github.com/tenderlove/mechanize) ~> 1.0
167
+ * [spidr](http://github.com/postmodern/spidr) ~> 0.2
168
+ * [sinatra](http://github.com/sinatra/sinatra) ~> 1.1
169
+ * [data_paths](http://github.com/postmodern/data_paths) ~> 0.3
170
+ * [ronin-support](http://github.com/ronin-ruby/ronin-support) ~> 0.2
171
+ * [ronin](http://github.com/ronin-ruby/ronin) ~> 1.1
157
172
 
158
- == INSTALL:
173
+ ## Install
159
174
 
160
- $ sudo gem install ronin-web
175
+ $ gem install ronin-web
161
176
 
162
- == LICENSE:
177
+ ## License
163
178
 
164
179
  Ronin Web - A Ruby library for Ronin that provides support for web
165
180
  scraping and spidering functionality.
166
181
 
167
- Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
182
+ Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
168
183
 
169
- This program is free software; you can redistribute it and/or modify
184
+ This file is part of Ronin Web.
185
+
186
+ Ronin is free software: you can redistribute it and/or modify
170
187
  it under the terms of the GNU General Public License as published by
171
- the Free Software Foundation; either version 2 of the License, or
188
+ the Free Software Foundation, either version 3 of the License, or
172
189
  (at your option) any later version.
173
190
 
174
- This program is distributed in the hope that it will be useful,
191
+ Ronin is distributed in the hope that it will be useful,
175
192
  but WITHOUT ANY WARRANTY; without even the implied warranty of
176
193
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
177
194
  GNU General Public License for more details.
178
195
 
179
196
  You should have received a copy of the GNU General Public License
180
- along with this program; if not, write to the Free Software
181
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
197
+ along with Ronin. If not, see <http://www.gnu.org/licenses/>.
data/Rakefile CHANGED
@@ -1,29 +1,30 @@
1
- # -*- ruby -*-
2
-
3
1
  require 'rubygems'
4
- require 'hoe'
5
- require 'hoe/signing'
6
- require './tasks/spec.rb'
7
- require './tasks/yard.rb'
8
-
9
- Hoe.spec('ronin-web') do
10
- self.rubyforge_name = 'ronin'
11
- self.developer('Postmodern', 'postmodern.mod3@gmail.com')
12
- self.remote_rdoc_dir = 'docs/ronin-web'
13
- self.extra_deps = [
14
- ['mechanize', '>=0.9.3'],
15
- ['spidr', '>=0.2.0'],
16
- ['sinatra', '>=0.9.4'],
17
- ['ronin', '>=0.3.0']
18
- ]
19
2
 
20
- self.extra_dev_deps = [
21
- ['rspec', '>=1.2.8'],
22
- ['test-unit', '=1.2.3'],
23
- ['rack-test', '>=0.4.1']
24
- ]
3
+ begin
4
+ require 'bundler'
5
+ rescue LoadError => e
6
+ STDERR.puts e.message
7
+ STDERR.puts "Run `gem install bundler` to install Bundler."
8
+ exit e.status_code
9
+ end
25
10
 
26
- self.spec_extras = {:has_rdoc => 'yard'}
11
+ begin
12
+ Bundler.setup(:development)
13
+ rescue Bundler::BundlerError => e
14
+ STDERR.puts e.message
15
+ STDERR.puts "Run `bundle install` to install missing gems"
16
+ exit e.status_code
27
17
  end
28
18
 
29
- # vim: syntax=Ruby
19
+ require 'rake'
20
+
21
+ require 'ore/tasks'
22
+ Ore::Tasks.new
23
+
24
+ require 'rspec/core/rake_task'
25
+ RSpec::Core::RakeTask.new
26
+ task :test => :spec
27
+ task :default => :spec
28
+
29
+ require 'yard'
30
+ YARD::Rake::YardocTask.new
@@ -2,13 +2,26 @@
2
2
 
3
3
  require 'rubygems'
4
4
 
5
- lib_dir = File.expand_path(File.join(File.dirname(__FILE__),'..','lib'))
6
- unless $LOAD_PATH.include?(lib_dir)
7
- $LOAD_PATH << lib_dir
5
+ root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
6
+ if File.directory?(File.join(root_dir,'.git'))
7
+ Dir.chdir(root_dir) do |path|
8
+ require 'bundler'
9
+
10
+ begin
11
+ Bundler.setup(:default)
12
+ rescue Bundler::BundlerError => e
13
+ STDERR.puts e.message
14
+ STDERR.puts "Run `bundle install` to install missing gems"
15
+ exit e.status_code
16
+ end
17
+ end
8
18
  end
9
19
 
10
- require 'ronin/ui/command_line/commands/console'
20
+ lib_dir = File.join(root_dir,'lib')
21
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
22
+
11
23
  require 'ronin/ui/console'
24
+ require 'ronin/ui/cli/commands/console'
12
25
 
13
26
  Ronin::UI::Console.auto_load << 'ronin/web'
14
- Ronin::UI::CommandLine::Commands::Console.start
27
+ Ronin::UI::CLI::Commands::Console.start
@@ -0,0 +1,30 @@
1
+ name: ronin-web
2
+ summary:
3
+ A Ruby library for Ronin that provides support for web scraping and
4
+ spidering functionality.
5
+ description:
6
+ Ronin Web is a Ruby library for Ronin that provides support for web
7
+ scraping and spidering functionality.
8
+
9
+ license: GPL-3
10
+ authors: Postmodern
11
+ email: postmodern.mod3@gmail.com
12
+ homepage: http://github.com/ronin-ruby/ronin-web
13
+ has_yard: true
14
+
15
+ dependencies:
16
+ nokogiri: ~> 1.4
17
+ mechanize: ~> 1.0
18
+ spidr: ~> 0.2
19
+ sinatra: ~> 1.2
20
+ # data_paths: ~> 0.3
21
+ data_paths: ~> 0.3.0.rc1
22
+ # Ronin dependencies:
23
+ # ronin-support: ~> 0.2
24
+ ronin-support: ~> 0.2.0.rc1
25
+ # ronin: ~> 1.1
26
+ ronin: ~> 1.1.0.rc1
27
+
28
+ development_dependencies:
29
+ bundler: ~> 1.0.10
30
+ yard: ~> 0.7.0