firudo 1.1.2 → 1.1.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 +7 -7
- data/.rvmrc +1 -0
- data/Rakefile +50 -0
- data/firudo.gemspec +3 -1
- data/lib/firudo/version.rb +1 -1
- data/rdoc/Firudo.html +112 -0
- data/rdoc/README_md.html +121 -0
- data/rdoc/Sinatra.html +98 -0
- data/rdoc/Sinatra/Firudo.html +285 -0
- data/rdoc/created.rid +4 -0
- data/rdoc/fonts.css +167 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +96 -0
- data/rdoc/js/darkfish.js +140 -0
- data/rdoc/js/jquery.js +4 -0
- data/rdoc/js/navigation.js +142 -0
- data/rdoc/js/search.js +109 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/searcher.js +228 -0
- data/rdoc/rdoc.css +580 -0
- data/rdoc/table_of_contents.html +86 -0
- data/spec/fixtures/log/test.log +1 -0
- data/spec/sinatra/firudo_spec.rb +45 -0
- data/spec/sinatra/test_app.rb +21 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +24 -0
- metadata +144 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2eb7ed889cb475a67e477b0752796f9288e27362
|
4
|
+
data.tar.gz: a24955763fe96aed2fb02010782de6874e900d48
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ace969c058408b8edb0324f78111bade62e892d75ed4f6b0526e33c0dfd2077598b0539c3be1b34b5546b159120c798effb4a48bc00d9259c848ec1e291d46f4
|
7
|
+
data.tar.gz: 81a2312974996bf9c5cf3e0928d002a06768f19e083fe1dac68d13eb73c85644aeb552c9c5f3d86dc64e928f6ce847796321b3cc8835ba2293fe6e3e0ca8a449
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use ruby-2.1.3@firudo
|
data/Rakefile
CHANGED
@@ -1,2 +1,52 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
2
4
|
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = "firudo"
|
9
|
+
gem.summary = %Q{Provides writing logs into files and filtering secure data for Sinatra based applications.}
|
10
|
+
gem.description = %Q{A Sinatra extension that makes logging and filtering secure data easy.}
|
11
|
+
gem.email = "otan256@gmail.com"
|
12
|
+
gem.homepage = "https://github.com/ostaptan/firudo"
|
13
|
+
gem.authors = ["ostaptan"]
|
14
|
+
gem.add_dependency( "sinatra", "~> 1.4.0")
|
15
|
+
gem.add_development_dependency( "rspec", "~> 3.0.0")
|
16
|
+
gem.add_development_dependency( "sinatra-tests", ">= 0.1.6")
|
17
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
+
end
|
19
|
+
Jeweler::GemcutterTasks.new
|
20
|
+
rescue LoadError
|
21
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
|
+
end
|
23
|
+
|
24
|
+
task :spec => :check_dependencies
|
25
|
+
|
26
|
+
task :default => :spec
|
27
|
+
|
28
|
+
require 'rdoc/task'
|
29
|
+
Rake::RDocTask.new do |rdoc|
|
30
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
31
|
+
|
32
|
+
rdoc.rdoc_dir = 'rdoc'
|
33
|
+
rdoc.title = "firudo #{version}"
|
34
|
+
rdoc.rdoc_files.include('README*')
|
35
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
36
|
+
end
|
37
|
+
|
38
|
+
namespace :docs do
|
39
|
+
|
40
|
+
desc 'Remove rdoc products'
|
41
|
+
task :remove => [:clobber_rdoc]
|
42
|
+
|
43
|
+
desc 'Force a rebuild of the RDOC files'
|
44
|
+
task :rebuild => [:rerdoc]
|
45
|
+
|
46
|
+
desc 'Build docs, and open in browser for viewing (specify BROWSER)'
|
47
|
+
task :open => [:docs] do
|
48
|
+
browser = ENV["BROWSER"] || "safari"
|
49
|
+
sh "open -a #{browser} doc/index.html"
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
data/firudo.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'firudo/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "firudo"
|
8
8
|
spec.version = Firudo::VERSION
|
9
|
-
spec.authors = ["
|
9
|
+
spec.authors = ["ostaptan"]
|
10
10
|
spec.email = ["otan256@gmail.com"]
|
11
11
|
spec.summary = %q{Provides writing logs into files and filtering secure data for Sinatra based applications.}
|
12
12
|
spec.homepage = "https://github.com/ostaptan/firudo"
|
@@ -20,5 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_dependency "sinatra", "~> 1.4.0"
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.1.0"
|
23
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rack-test"
|
24
26
|
end
|
data/lib/firudo/version.rb
CHANGED
data/rdoc/Firudo.html
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Firudo - firudo </title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
</div>
|
65
|
+
</nav>
|
66
|
+
|
67
|
+
<main role="main" aria-labelledby="module-Firudo">
|
68
|
+
<h1 id="module-Firudo" class="module">
|
69
|
+
module Firudo
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<section class="description">
|
73
|
+
|
74
|
+
</section>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<section class="constants-list">
|
86
|
+
<header>
|
87
|
+
<h3>Constants</h3>
|
88
|
+
</header>
|
89
|
+
<dl>
|
90
|
+
|
91
|
+
<dt id="VERSION">VERSION
|
92
|
+
|
93
|
+
<dd>
|
94
|
+
|
95
|
+
|
96
|
+
</dl>
|
97
|
+
</section>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
</section>
|
104
|
+
</main>
|
105
|
+
|
106
|
+
|
107
|
+
<footer id="validator-badges" role="contentinfo">
|
108
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
109
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
110
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
111
|
+
</footer>
|
112
|
+
|
data/rdoc/README_md.html
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>README - firudo </title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
<div class="nav-section">
|
58
|
+
<h3>Table of Contents</h3>
|
59
|
+
|
60
|
+
<ul class="link-list" role="directory">
|
61
|
+
<li><a href="#label-Firudo">Firudo</a>
|
62
|
+
<li><a href="#label-Installation">Installation</a>
|
63
|
+
<li><a href="#label-Usage">Usage</a>
|
64
|
+
</ul>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
<div id="project-metadata">
|
69
|
+
<div id="fileindex-section" class="nav-section">
|
70
|
+
<h3>Pages</h3>
|
71
|
+
|
72
|
+
<ul class="link-list">
|
73
|
+
|
74
|
+
<li><a href="./README_md.html">README</a>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
</div>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
<main role="main" aria-label="Page README.md">
|
83
|
+
|
84
|
+
<h1 id="label-Firudo"><a href="Firudo.html">Firudo</a><span><a href="#label-Firudo">¶</a> <a href="#documentation">↑</a></span></h1>
|
85
|
+
|
86
|
+
<p><a href="http://badge.fury.io/rb/firudo"><img
|
87
|
+
src="https://badge.fury.io/rb/firudo.svg"></a></p>
|
88
|
+
|
89
|
+
<p>Provides simple logging into log files (/log/development.log ||
|
90
|
+
/log/production.log) and filtering security parameters from logs for <a
|
91
|
+
href="Sinatra.html">Sinatra</a> based applications.</p>
|
92
|
+
|
93
|
+
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#documentation">↑</a></span></h2>
|
94
|
+
|
95
|
+
<p>Add this line to your application's Gemfile:</p>
|
96
|
+
|
97
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">'firudo'</span>
|
98
|
+
</pre>
|
99
|
+
|
100
|
+
<p>And then execute:</p>
|
101
|
+
|
102
|
+
<pre>$ bundle</pre>
|
103
|
+
|
104
|
+
<p>Or install it yourself as:</p>
|
105
|
+
|
106
|
+
<pre>$ gem install firudo</pre>
|
107
|
+
|
108
|
+
<h2 id="label-Usage">Usage<span><a href="#label-Usage">¶</a> <a href="#documentation">↑</a></span></h2>
|
109
|
+
|
110
|
+
<pre>register Sinatra::Firudo
|
111
|
+
Sinatra::Firudo.filter_attributes :password, :token, :password_confirmation, ...</pre>
|
112
|
+
</main>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<footer id="validator-badges" role="contentinfo">
|
117
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
118
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
119
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
120
|
+
</footer>
|
121
|
+
|
data/rdoc/Sinatra.html
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Sinatra - firudo </title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
</div>
|
65
|
+
</nav>
|
66
|
+
|
67
|
+
<main role="main" aria-labelledby="module-Sinatra">
|
68
|
+
<h1 id="module-Sinatra" class="module">
|
69
|
+
module Sinatra
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<section class="description">
|
73
|
+
|
74
|
+
</section>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
</section>
|
90
|
+
</main>
|
91
|
+
|
92
|
+
|
93
|
+
<footer id="validator-badges" role="contentinfo">
|
94
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
95
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
96
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
97
|
+
</footer>
|
98
|
+
|
@@ -0,0 +1,285 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Sinatra::Firudo - firudo </title>
|
8
|
+
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="nav-section">
|
65
|
+
<h3>Methods</h3>
|
66
|
+
|
67
|
+
<ul class="link-list" role="directory">
|
68
|
+
|
69
|
+
<li ><a href="#method-c-filter_attributes">::filter_attributes</a>
|
70
|
+
|
71
|
+
<li ><a href="#method-c-logger">::logger</a>
|
72
|
+
|
73
|
+
<li ><a href="#method-c-registered">::registered</a>
|
74
|
+
|
75
|
+
<li ><a href="#method-i-write">#write</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-labelledby="module-Sinatra::Firudo">
|
84
|
+
<h1 id="module-Sinatra::Firudo" class="module">
|
85
|
+
module Sinatra::Firudo
|
86
|
+
</h1>
|
87
|
+
|
88
|
+
<section class="description">
|
89
|
+
|
90
|
+
</section>
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
106
|
+
<header>
|
107
|
+
<h3>Public Class Methods</h3>
|
108
|
+
</header>
|
109
|
+
|
110
|
+
|
111
|
+
<div id="method-c-filter_attributes" class="method-detail ">
|
112
|
+
|
113
|
+
<div class="method-heading">
|
114
|
+
<span class="method-name">filter_attributes</span><span
|
115
|
+
class="method-args">(*names)</span>
|
116
|
+
|
117
|
+
<span class="method-click-advice">click to toggle source</span>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
<div class="method-description">
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<div class="method-source-code" id="filter_attributes-source">
|
130
|
+
<pre><span class="ruby-comment"># File lib/firudo.rb, line 19</span>
|
131
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">filter_attributes</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">names</span>)
|
132
|
+
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@params_to_filter</span>, <span class="ruby-identifier">names</span>)
|
133
|
+
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-keyword">do</span>
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">msg</span>)
|
135
|
+
<span class="ruby-identifier">params</span> = <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'&'</span>)
|
136
|
+
<span class="ruby-ivar">@params_to_filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
|
137
|
+
<span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span> <span class="ruby-identifier">el</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-node">/#{Regexp.quote(attr)}=([\w]+)\b/</span>, <span class="ruby-node">"#{attr}=******** "</span> }
|
138
|
+
<span class="ruby-keyword">end</span>
|
139
|
+
<span class="ruby-identifier">msg</span> = <span class="ruby-identifier">params</span> <span class="ruby-operator">*</span> <span class="ruby-string">'&'</span>
|
140
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value">:<<</span>, <span class="ruby-identifier">msg</span>)
|
141
|
+
<span class="ruby-keyword">end</span>
|
142
|
+
<span class="ruby-keyword">end</span>
|
143
|
+
|
144
|
+
<span class="ruby-ivar">@klass</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span>
|
145
|
+
<span class="ruby-ivar">@klass</span>.<span class="ruby-identifier">use</span> <span class="ruby-operator">::</span><span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">CommonLogger</span>, <span class="ruby-ivar">@logger</span>
|
146
|
+
<span class="ruby-keyword">end</span>
|
147
|
+
<span class="ruby-keyword">end</span></pre>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
<div id="method-c-logger" class="method-detail ">
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<span class="method-name">logger</span><span
|
162
|
+
class="method-args">()</span>
|
163
|
+
|
164
|
+
<span class="method-click-advice">click to toggle source</span>
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
<div class="method-description">
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<div class="method-source-code" id="logger-source">
|
177
|
+
<pre><span class="ruby-comment"># File lib/firudo.rb, line 15</span>
|
178
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>
|
179
|
+
<span class="ruby-ivar">@logger</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@klass</span>.<span class="ruby-identifier">access_log</span>)
|
180
|
+
<span class="ruby-keyword">end</span></pre>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
<div id="method-c-registered" class="method-detail ">
|
192
|
+
|
193
|
+
<div class="method-heading">
|
194
|
+
<span class="method-name">registered</span><span
|
195
|
+
class="method-args">(klass)</span>
|
196
|
+
|
197
|
+
<span class="method-click-advice">click to toggle source</span>
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
<div class="method-description">
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method-source-code" id="registered-source">
|
210
|
+
<pre><span class="ruby-comment"># File lib/firudo.rb, line 7</span>
|
211
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">registered</span>(<span class="ruby-identifier">klass</span>)
|
212
|
+
<span class="ruby-ivar">@firudo_loaded_in</span> <span class="ruby-operator">||=</span> {}
|
213
|
+
<span class="ruby-ivar">@klass</span> = <span class="ruby-identifier">klass</span>
|
214
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@firudo_loaded_in</span>[<span class="ruby-identifier">klass</span>]
|
215
|
+
|
216
|
+
<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">set</span> <span class="ruby-value">:access_log</span>, <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">root</span>, <span class="ruby-string">'log'</span>, <span class="ruby-node">"#{ENV['RACK_ENV']}.log"</span>) }
|
217
|
+
<span class="ruby-keyword">end</span></pre>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</div>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
</section>
|
229
|
+
|
230
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
231
|
+
<header>
|
232
|
+
<h3>Public Instance Methods</h3>
|
233
|
+
</header>
|
234
|
+
|
235
|
+
|
236
|
+
<div id="method-i-write" class="method-detail ">
|
237
|
+
|
238
|
+
<div class="method-heading">
|
239
|
+
<span class="method-name">write</span><span
|
240
|
+
class="method-args">(msg)</span>
|
241
|
+
|
242
|
+
<span class="method-click-advice">click to toggle source</span>
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
<div class="method-description">
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
<div class="method-source-code" id="write-source">
|
255
|
+
<pre><span class="ruby-comment"># File lib/firudo.rb, line 22</span>
|
256
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">msg</span>)
|
257
|
+
<span class="ruby-identifier">params</span> = <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'&'</span>)
|
258
|
+
<span class="ruby-ivar">@params_to_filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
|
259
|
+
<span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span> <span class="ruby-identifier">el</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-node">/#{Regexp.quote(attr)}=([\w]+)\b/</span>, <span class="ruby-node">"#{attr}=******** "</span> }
|
260
|
+
<span class="ruby-keyword">end</span>
|
261
|
+
<span class="ruby-identifier">msg</span> = <span class="ruby-identifier">params</span> <span class="ruby-operator">*</span> <span class="ruby-string">'&'</span>
|
262
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value">:<<</span>, <span class="ruby-identifier">msg</span>)
|
263
|
+
<span class="ruby-keyword">end</span></pre>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
</div>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
</section>
|
275
|
+
|
276
|
+
</section>
|
277
|
+
</main>
|
278
|
+
|
279
|
+
|
280
|
+
<footer id="validator-badges" role="contentinfo">
|
281
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
282
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
283
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
284
|
+
</footer>
|
285
|
+
|