deflectable 0.1.0 → 0.2.4
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 +4 -4
- data/lib/deflectable/version.rb +5 -1
- data/lib/deflectable/watcher.rb +61 -64
- data/test/dummy/config/deflect.yml +3 -3
- data/test/dummy/config/routes.rb +2 -2
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +16 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +250 -44
- data/test/dummy/log/test.log +16 -35
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- metadata +51 -9
- data/test/acceptable_test.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bd528df2e6f5e896503ba33641cae09e9b68c02
|
4
|
+
data.tar.gz: 924d024b46dc02b5fede00e21ecb929d55c4a1bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ea528553e799a83b4e6f0c302c198b068cab1c3c9e3703d76a93657713dca34ed6b842ee3c984e07d4f56c9d7e8045a708b74ad59cf754ef4d6b1a766a714d
|
7
|
+
data.tar.gz: 717c2eff3fee2382ed0353c7bcdee223dbced0595a5e0d8ca926e0c2fd92653d3d61e7d10e428739832042d58dea5d91291c5a29b227c153b76cc04144771170
|
data/lib/deflectable/version.rb
CHANGED
data/lib/deflectable/watcher.rb
CHANGED
@@ -1,101 +1,98 @@
|
|
1
|
-
require '
|
2
|
-
|
1
|
+
require 'logger'
|
3
2
|
module Deflectable
|
4
3
|
class Watcher
|
5
4
|
attr_accessor :options
|
6
5
|
|
7
|
-
def initialize(app,
|
8
|
-
@mutex = Mutex.new
|
6
|
+
def initialize(app, build_options = {})
|
9
7
|
@app = app
|
10
|
-
|
8
|
+
@filtering = nil
|
11
9
|
@options = {
|
12
|
-
:log =>
|
10
|
+
:log => false,
|
11
|
+
:logger => nil,
|
13
12
|
:log_format => 'deflect(%s): %s',
|
14
13
|
:log_date_format => '%m/%d/%Y',
|
15
|
-
:request_threshold => 100,
|
16
|
-
:interval => 5,
|
17
|
-
:block_duration => 900,
|
18
14
|
:whitelist => [],
|
19
15
|
:blacklist => [],
|
20
|
-
}.merge(
|
16
|
+
}.merge(build_options)
|
17
|
+
configure_check!
|
21
18
|
end
|
22
19
|
|
23
20
|
def call(env)
|
24
|
-
return reject! if detect?(env)
|
21
|
+
return reject!(env) if detect?(env)
|
25
22
|
status, headers, body = @app.call(env)
|
26
23
|
[status, headers, body]
|
27
24
|
end
|
28
25
|
|
29
|
-
def reject!
|
30
|
-
res = Rack::Response.new do |r|
|
31
|
-
r.status = 403
|
32
|
-
r['Content-Type'] = 'text/html;charset=utf-8'
|
33
|
-
r.write File.read(Rails.root.join('public/403.html'))
|
34
|
-
end
|
35
|
-
res.finish
|
36
|
-
end
|
37
26
|
|
38
|
-
|
39
|
-
@remote_addr = env['REMOTE_ADDR']
|
40
|
-
return false if options[:whitelist].include? @remote_addr
|
41
|
-
return true if options[:blacklist].include? @remote_addr
|
42
|
-
@mutex.synchronize { watch }
|
43
|
-
end
|
44
|
-
|
45
|
-
def watch
|
46
|
-
increment_requests
|
47
|
-
clear! if watch_expired? and not blocked?
|
48
|
-
clear! if blocked? and block_expired?
|
49
|
-
block! if watching? and exceeded_request_threshold?
|
50
|
-
blocked?
|
51
|
-
end
|
52
|
-
|
53
|
-
def map
|
54
|
-
@remote_addr_map[@remote_addr] ||= {
|
55
|
-
:expires => Time.now + options[:interval],
|
56
|
-
:requests => 0
|
57
|
-
}
|
58
|
-
end
|
27
|
+
private
|
59
28
|
|
60
|
-
def
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
29
|
+
def configure_check!
|
30
|
+
set_rails_configure!
|
31
|
+
if (not options[:whitelist].empty?) and (not options[:blacklist].empty?)
|
32
|
+
raise <<-EOS
|
33
|
+
There was both a :blanklist and :whitelist.
|
34
|
+
`Please select the :blacklist or :whitelist.'
|
35
|
+
EOS
|
36
|
+
end
|
37
|
+
@filtering = :whitelist unless options[:whitelist].empty?
|
38
|
+
@filtering = :blacklist unless options[:blacklist].empty?
|
39
|
+
unless options[:logger]
|
40
|
+
self.options[:logger] = Logger.new('deflecter.log')
|
41
|
+
end
|
68
42
|
end
|
69
43
|
|
70
|
-
def
|
71
|
-
|
44
|
+
def set_rails_configure!
|
45
|
+
return unless defined?(Rails)
|
46
|
+
conf = YAML.load_file(Rails.root.join('config/deflect.yml'))
|
47
|
+
self.options = options.merge(conf).merge(:logger => Rails.logger)
|
48
|
+
rescue => e
|
49
|
+
log e.message
|
72
50
|
end
|
73
51
|
|
74
|
-
def
|
75
|
-
|
52
|
+
def reject!(env)
|
53
|
+
res = Rack::Response.new do |r|
|
54
|
+
r.status = 403
|
55
|
+
r['Content-Type'] = 'text/html;charset=utf-8'
|
56
|
+
r.write error_content
|
57
|
+
end
|
58
|
+
log "Rejected(#{@filtering}): #{env['REMOTE_ADDR']}"
|
59
|
+
res.finish
|
76
60
|
end
|
77
61
|
|
78
|
-
def
|
79
|
-
|
80
|
-
|
81
|
-
|
62
|
+
def error_content
|
63
|
+
File.read(Rails.root.join('public/403.html'))
|
64
|
+
rescue
|
65
|
+
'<p>failed</p>'
|
82
66
|
end
|
83
67
|
|
84
|
-
def
|
85
|
-
|
68
|
+
def detect?(env)
|
69
|
+
case @filtering
|
70
|
+
when :whitelist
|
71
|
+
allowed?(env) ? false : true
|
72
|
+
when :blacklist
|
73
|
+
denied?(env)
|
74
|
+
else
|
75
|
+
false
|
76
|
+
end
|
86
77
|
end
|
87
78
|
|
88
|
-
def
|
89
|
-
|
79
|
+
def allowed?(env)
|
80
|
+
return true if options[:whitelist].empty?
|
81
|
+
options[:whitelist].include?(env['REMOTE_ADDR']) ? true : false
|
90
82
|
end
|
91
83
|
|
92
|
-
def
|
93
|
-
|
84
|
+
def denied?(env)
|
85
|
+
return false if options[:blacklist].empty?
|
86
|
+
options[:blacklist].include?(env['REMOTE_ADDR']) ? true : false
|
94
87
|
end
|
95
88
|
|
96
|
-
def log
|
89
|
+
def log(message, level = :info)
|
97
90
|
return unless options[:log]
|
98
|
-
|
91
|
+
if logger = options[:logger]
|
92
|
+
logger.send(level, message)
|
93
|
+
else
|
94
|
+
STDOUT.puts(options[:log_format] % [Time.now.strftime(options[:log_date_format]), message])
|
95
|
+
end
|
99
96
|
end
|
100
97
|
end
|
101
98
|
end
|
data/test/dummy/config/routes.rb
CHANGED
@@ -3,7 +3,7 @@ Dummy::Application.routes.draw do
|
|
3
3
|
# See how all your routes lay out with "rake routes".
|
4
4
|
|
5
5
|
# You can have the root of your site routed with "root"
|
6
|
-
|
6
|
+
root 'welcome#index'
|
7
7
|
|
8
8
|
# Example of regular route:
|
9
9
|
# get 'products/:id' => 'catalog#view'
|
@@ -39,7 +39,7 @@ Dummy::Application.routes.draw do
|
|
39
39
|
# get 'recent', on: :collection
|
40
40
|
# end
|
41
41
|
# end
|
42
|
-
|
42
|
+
|
43
43
|
# Example resource route with concerns:
|
44
44
|
# concern :toggleable do
|
45
45
|
# post 'toggle'
|
data/test/dummy/config.ru
CHANGED
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 0) do
|
15
|
+
|
16
|
+
end
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -1,108 +1,314 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
3
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 18:30:06 +0900
|
4
|
+
|
5
|
+
SQLite3::CantOpenException (unable to open database file):
|
6
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `initialize'
|
7
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new'
|
8
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection'
|
9
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
|
10
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
|
11
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
|
12
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
|
13
|
+
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
|
14
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
|
15
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
|
16
|
+
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
|
17
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
|
18
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
|
19
|
+
activerecord (4.0.0) lib/active_record/connection_handling.rb:79:in `retrieve_connection'
|
20
|
+
activerecord (4.0.0) lib/active_record/connection_handling.rb:53:in `connection'
|
21
|
+
activerecord (4.0.0) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings'
|
22
|
+
activerecord (4.0.0) lib/active_record/query_cache.rb:43:in `rescue in call'
|
23
|
+
activerecord (4.0.0) lib/active_record/query_cache.rb:32:in `call'
|
24
|
+
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
|
25
|
+
activerecord (4.0.0) lib/active_record/migration.rb:369:in `call'
|
26
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
|
27
|
+
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__1688254131637688522__call__callbacks'
|
28
|
+
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
|
29
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
|
30
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
|
31
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
|
32
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
|
33
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
|
34
|
+
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
|
35
|
+
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
|
36
|
+
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
|
37
|
+
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
|
38
|
+
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
|
39
|
+
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
|
40
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
|
41
|
+
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
|
42
|
+
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
|
43
|
+
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
|
44
|
+
rack (1.5.2) lib/rack/lock.rb:17:in `call'
|
45
|
+
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
|
46
|
+
railties (4.0.0) lib/rails/engine.rb:511:in `call'
|
47
|
+
railties (4.0.0) lib/rails/application.rb:97:in `call'
|
48
|
+
/Users/sakuma/apps/libs/deflectable/lib/deflectable/watcher.rb:25:in `call'
|
49
|
+
rack (1.5.2) lib/rack/lock.rb:17:in `call'
|
50
|
+
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
|
51
|
+
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
|
52
|
+
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
|
53
|
+
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
|
54
|
+
/Users/sakuma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
|
55
|
+
|
56
|
+
|
57
|
+
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.4ms)
|
58
|
+
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms)
|
59
|
+
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.7ms)
|
60
|
+
Rendered /Users/sakuma/.rvm/gems/ruby-2.0.0-p247@deflectable/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (11.6ms)
|
61
|
+
[1m[36m (2.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
62
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
63
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
64
|
+
|
65
|
+
|
66
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:04 +0900
|
4
67
|
Processing by WelcomeController#index as HTML
|
5
68
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
6
|
-
Completed 200 OK in
|
69
|
+
Completed 200 OK in 54ms (Views: 54.0ms | ActiveRecord: 0.0ms)
|
7
70
|
|
8
71
|
|
9
|
-
Started GET "/assets/application.
|
72
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:05 +0900
|
10
73
|
|
11
74
|
|
12
|
-
Started GET "/assets/application.
|
75
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:05 +0900
|
13
76
|
|
14
77
|
|
15
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
78
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
16
79
|
Processing by WelcomeController#index as HTML
|
17
|
-
Rendered welcome/index.html.erb within layouts/application (
|
18
|
-
Completed 200 OK in
|
80
|
+
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
81
|
+
Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)
|
19
82
|
|
20
83
|
|
21
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-
|
84
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
22
85
|
|
23
86
|
|
24
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-
|
87
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
25
88
|
|
26
89
|
|
27
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25
|
90
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
28
91
|
Processing by WelcomeController#index as HTML
|
29
|
-
Rendered welcome/index.html.erb within layouts/application (
|
30
|
-
Completed 200 OK in
|
92
|
+
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
93
|
+
Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
|
94
|
+
|
95
|
+
|
96
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
97
|
+
|
98
|
+
|
99
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:13 +0900
|
31
100
|
|
32
101
|
|
33
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25
|
102
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
34
103
|
Processing by WelcomeController#index as HTML
|
35
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
36
|
-
Completed 200 OK in
|
104
|
+
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
105
|
+
Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
|
106
|
+
|
107
|
+
|
108
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
109
|
+
|
110
|
+
|
111
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
37
112
|
|
38
113
|
|
39
|
-
Started GET "/" for 127.0.0.1 at 2013-09-25
|
114
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
115
|
+
Processing by WelcomeController#index as HTML
|
116
|
+
Rendered welcome/index.html.erb within layouts/application (0.1ms)
|
117
|
+
Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)
|
118
|
+
|
119
|
+
|
120
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
121
|
+
Processing by WelcomeController#index as HTML
|
122
|
+
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
123
|
+
Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
|
124
|
+
|
125
|
+
|
126
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
127
|
+
|
128
|
+
|
129
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-25 22:57:14 +0900
|
130
|
+
|
131
|
+
|
132
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:35:51 +0900
|
40
133
|
Processing by WelcomeController#index as HTML
|
41
134
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
42
|
-
Completed 200 OK in
|
135
|
+
Completed 200 OK in 25ms (Views: 24.6ms | ActiveRecord: 0.0ms)
|
136
|
+
|
137
|
+
|
138
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:35:51 +0900
|
43
139
|
|
44
140
|
|
45
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
141
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:35:51 +0900
|
142
|
+
|
143
|
+
|
144
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:36:39 +0900
|
46
145
|
Processing by WelcomeController#index as HTML
|
47
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
48
|
-
Completed 200 OK in
|
146
|
+
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
147
|
+
Completed 200 OK in 25ms (Views: 24.3ms | ActiveRecord: 0.0ms)
|
148
|
+
|
149
|
+
|
150
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:36:39 +0900
|
151
|
+
|
49
152
|
|
153
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:36:39 +0900
|
50
154
|
|
51
|
-
|
155
|
+
|
156
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:36:43 +0900
|
52
157
|
Processing by WelcomeController#index as HTML
|
53
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
54
|
-
Completed 200 OK in
|
158
|
+
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
159
|
+
Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
|
160
|
+
|
161
|
+
|
162
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:36:44 +0900
|
55
163
|
|
56
164
|
|
57
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
165
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:36:44 +0900
|
166
|
+
|
167
|
+
|
168
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:42:54 +0900
|
58
169
|
Processing by WelcomeController#index as HTML
|
59
170
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
60
|
-
Completed 200 OK in
|
171
|
+
Completed 200 OK in 25ms (Views: 24.2ms | ActiveRecord: 0.0ms)
|
172
|
+
|
173
|
+
|
174
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:42:54 +0900
|
61
175
|
|
62
176
|
|
63
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
177
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:42:54 +0900
|
178
|
+
|
179
|
+
|
180
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:45:45 +0900
|
64
181
|
Processing by WelcomeController#index as HTML
|
65
182
|
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
66
|
-
Completed 200 OK in
|
183
|
+
Completed 200 OK in 25ms (Views: 24.3ms | ActiveRecord: 0.0ms)
|
184
|
+
|
67
185
|
|
186
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:45:45 +0900
|
68
187
|
|
69
|
-
|
188
|
+
|
189
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:45:45 +0900
|
190
|
+
|
191
|
+
|
192
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:47:41 +0900
|
70
193
|
Processing by WelcomeController#index as HTML
|
71
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
72
|
-
Completed 200 OK in
|
194
|
+
Rendered welcome/index.html.erb within layouts/application (0.9ms)
|
195
|
+
Completed 200 OK in 29ms (Views: 28.9ms | ActiveRecord: 0.0ms)
|
196
|
+
|
197
|
+
|
198
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:47:41 +0900
|
73
199
|
|
74
200
|
|
75
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
201
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:47:41 +0900
|
202
|
+
|
203
|
+
|
204
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:48:09 +0900
|
76
205
|
Processing by WelcomeController#index as HTML
|
77
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
78
|
-
Completed 200 OK in 24ms (Views:
|
206
|
+
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
207
|
+
Completed 200 OK in 24ms (Views: 24.0ms | ActiveRecord: 0.0ms)
|
208
|
+
|
209
|
+
|
210
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:48:09 +0900
|
211
|
+
|
79
212
|
|
213
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:48:09 +0900
|
80
214
|
|
81
|
-
|
215
|
+
|
216
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:49:31 +0900
|
217
|
+
Processing by WelcomeController#index as HTML
|
218
|
+
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
219
|
+
Completed 200 OK in 25ms (Views: 24.7ms | ActiveRecord: 0.0ms)
|
220
|
+
|
221
|
+
|
222
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:49:31 +0900
|
223
|
+
|
224
|
+
|
225
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:49:31 +0900
|
226
|
+
|
227
|
+
|
228
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:49:35 +0900
|
82
229
|
Processing by WelcomeController#index as HTML
|
83
230
|
Rendered welcome/index.html.erb within layouts/application (0.0ms)
|
84
|
-
Completed 200 OK in
|
231
|
+
Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)
|
232
|
+
|
233
|
+
|
234
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:49:36 +0900
|
235
|
+
|
236
|
+
|
237
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:49:36 +0900
|
85
238
|
|
86
239
|
|
87
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
240
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:55:23 +0900
|
88
241
|
Processing by WelcomeController#index as HTML
|
89
|
-
Rendered welcome/index.html.erb within layouts/application (
|
90
|
-
Completed 200 OK in
|
242
|
+
Rendered welcome/index.html.erb within layouts/application (1.5ms)
|
243
|
+
Completed 200 OK in 29ms (Views: 28.6ms | ActiveRecord: 0.0ms)
|
91
244
|
|
92
245
|
|
93
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-
|
246
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:55:30 +0900
|
94
247
|
|
95
248
|
|
96
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-
|
249
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:55:33 +0900
|
97
250
|
|
98
251
|
|
99
|
-
Started GET "/" for 127.0.0.1 at 2013-09-
|
252
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:55:52 +0900
|
100
253
|
Processing by WelcomeController#index as HTML
|
101
254
|
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
102
|
-
Completed 200 OK in
|
255
|
+
Completed 200 OK in 25ms (Views: 24.5ms | ActiveRecord: 0.0ms)
|
256
|
+
|
257
|
+
|
258
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:55:53 +0900
|
259
|
+
|
260
|
+
|
261
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:55:53 +0900
|
262
|
+
|
263
|
+
|
264
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 00:56:17 +0900
|
265
|
+
Processing by WelcomeController#index as HTML
|
266
|
+
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
267
|
+
Completed 200 OK in 25ms (Views: 24.4ms | ActiveRecord: 0.0ms)
|
268
|
+
|
269
|
+
|
270
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 00:56:17 +0900
|
271
|
+
|
272
|
+
|
273
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 00:56:17 +0900
|
274
|
+
|
275
|
+
|
276
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 01:03:40 +0900
|
277
|
+
Processing by WelcomeController#index as HTML
|
278
|
+
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
279
|
+
Completed 200 OK in 24ms (Views: 24.0ms | ActiveRecord: 0.0ms)
|
280
|
+
|
281
|
+
|
282
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 01:03:40 +0900
|
283
|
+
|
284
|
+
|
285
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 01:03:40 +0900
|
286
|
+
Rejected(blacklist): 127.0.0.1
|
287
|
+
Rejected(blacklist): 127.0.0.1
|
288
|
+
Rejected(blacklist): 127.0.0.1
|
289
|
+
Rejected(blacklist): 127.0.0.1
|
290
|
+
|
291
|
+
|
292
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 01:17:52 +0900
|
293
|
+
Processing by WelcomeController#index as HTML
|
294
|
+
Rendered welcome/index.html.erb within layouts/application (0.8ms)
|
295
|
+
Completed 200 OK in 25ms (Views: 24.5ms | ActiveRecord: 0.0ms)
|
296
|
+
|
297
|
+
|
298
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 01:17:52 +0900
|
299
|
+
|
300
|
+
|
301
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 01:17:52 +0900
|
302
|
+
Rejected(whitelist): 127.0.0.1
|
303
|
+
|
304
|
+
|
305
|
+
Started GET "/" for 127.0.0.1 at 2013-09-26 01:20:16 +0900
|
306
|
+
Processing by WelcomeController#index as HTML
|
307
|
+
Rendered welcome/index.html.erb within layouts/application (1.0ms)
|
308
|
+
Completed 200 OK in 25ms (Views: 24.5ms | ActiveRecord: 0.0ms)
|
103
309
|
|
104
310
|
|
105
|
-
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-
|
311
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-26 01:20:17 +0900
|
106
312
|
|
107
313
|
|
108
|
-
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-
|
314
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-09-26 01:20:17 +0900
|
data/test/dummy/log/test.log
CHANGED
@@ -1,49 +1,30 @@
|
|
1
|
+
[1m[36m (2.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
4
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
5
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1
6
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2
|
-
|
3
|
-
AcceptableTest:
|
4
|
-
|
5
|
-
|
6
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7
|
-
---------------------------
|
8
|
-
DeflectableTest: test_truth
|
9
|
-
---------------------------
|
10
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
-
--------------------------------------------
|
13
|
-
WelcomeControllerTest: test_should_get_index
|
14
|
-
--------------------------------------------
|
7
|
+
----------------------------------------------------------
|
8
|
+
AcceptableTest: test_should_get_index_when_not_ip_controll
|
9
|
+
----------------------------------------------------------
|
10
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 18:31:54 +0900
|
15
11
|
Processing by WelcomeController#index as HTML
|
16
12
|
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
17
|
-
Completed 200 OK in
|
13
|
+
Completed 200 OK in 14ms (Views: 13.8ms | ActiveRecord: 0.0ms)
|
18
14
|
[1m[35m (0.1ms)[0m rollback transaction
|
19
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
20
|
-
-------------------------------------
|
21
|
-
AcceptableTest: test_should_get_index
|
22
|
-
-------------------------------------
|
23
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
24
15
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
25
16
|
---------------------------
|
26
17
|
DeflectableTest: test_truth
|
27
18
|
---------------------------
|
28
19
|
[1m[35m (0.0ms)[0m rollback transaction
|
29
20
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
30
|
-
|
31
|
-
AcceptableTest:
|
32
|
-
|
33
|
-
|
34
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
35
|
-
---------------------------
|
36
|
-
DeflectableTest: test_truth
|
37
|
-
---------------------------
|
38
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
39
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
40
|
-
-------------------------------------
|
41
|
-
AcceptableTest: test_should_get_index
|
42
|
-
-------------------------------------
|
43
|
-
Started GET "/" for 127.0.0.1 at 2013-09-24 23:17:55 +0900
|
21
|
+
----------------------------------------------------------
|
22
|
+
AcceptableTest: test_should_get_index_when_not_ip_controll
|
23
|
+
----------------------------------------------------------
|
24
|
+
Started GET "/" for 127.0.0.1 at 2013-09-25 19:13:16 +0900
|
44
25
|
Processing by WelcomeController#index as HTML
|
45
|
-
Rendered welcome/index.html.erb within layouts/application (0.
|
46
|
-
Completed 200 OK in
|
26
|
+
Rendered welcome/index.html.erb within layouts/application (0.7ms)
|
27
|
+
Completed 200 OK in 12ms (Views: 12.0ms | ActiveRecord: 0.0ms)
|
47
28
|
[1m[35m (0.1ms)[0m rollback transaction
|
48
29
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
49
30
|
---------------------------
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deflectable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naohiro Sakuma
|
@@ -11,21 +11,21 @@ cert_chain: []
|
|
11
11
|
date: 2013-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.9.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.9.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '>='
|
@@ -38,6 +38,48 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
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: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack-test
|
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'
|
41
83
|
description: Access controll by IP Address.
|
42
84
|
email:
|
43
85
|
- nao.bear@gmail.com
|
@@ -52,7 +94,6 @@ files:
|
|
52
94
|
- MIT-LICENSE
|
53
95
|
- Rakefile
|
54
96
|
- README.md
|
55
|
-
- test/acceptable_test.rb
|
56
97
|
- test/deflectable_test.rb
|
57
98
|
- test/dummy/app/assets/javascripts/application.js
|
58
99
|
- test/dummy/app/assets/stylesheets/application.css
|
@@ -84,6 +125,7 @@ files:
|
|
84
125
|
- test/dummy/config/routes.rb
|
85
126
|
- test/dummy/config.ru
|
86
127
|
- test/dummy/db/development.sqlite3
|
128
|
+
- test/dummy/db/schema.rb
|
87
129
|
- test/dummy/db/test.sqlite3
|
88
130
|
- test/dummy/log/development.log
|
89
131
|
- test/dummy/log/test.log
|
@@ -131,7 +173,6 @@ signing_key:
|
|
131
173
|
specification_version: 4
|
132
174
|
summary: Access controll by IP Address.
|
133
175
|
test_files:
|
134
|
-
- test/acceptable_test.rb
|
135
176
|
- test/deflectable_test.rb
|
136
177
|
- test/dummy/app/assets/javascripts/application.js
|
137
178
|
- test/dummy/app/assets/stylesheets/application.css
|
@@ -163,6 +204,7 @@ test_files:
|
|
163
204
|
- test/dummy/config/routes.rb
|
164
205
|
- test/dummy/config.ru
|
165
206
|
- test/dummy/db/development.sqlite3
|
207
|
+
- test/dummy/db/schema.rb
|
166
208
|
- test/dummy/db/test.sqlite3
|
167
209
|
- test/dummy/log/development.log
|
168
210
|
- test/dummy/log/test.log
|