easter_headers 0.0.1

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzczYTEyYTViNTQyZDljMzU4ZjAzOGI2YmEzOTY3OGI4ZmM1ZWU3YQ==
5
+ data.tar.gz: !binary |-
6
+ ZGYzMmNlOGNlZjJlZWNmYTYwNzc1Y2Y4OTYzNzQ1MTU1YjkyODYwYg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YjVjYmY0ZjZmYjdjYjkyMGUxN2M0ZDc5N2JhZjZiOGI0NWEwNzM3Nzc2ZmRi
10
+ ZTY5YzRiMmIzNzkxNDZhNDM5M2MzZmE1NjZhMjE5MTNmZDRiOWVmN2ViNDcy
11
+ ZTZmMmEyYWZlNjdkMmQyMTMyMGRhNzlmYWUxMTU1MzIyNDgxOTc=
12
+ data.tar.gz: !binary |-
13
+ ZTllNzYzOWQ2M2RkM2RlZmRmYWY0MzkzYjY2ZGEyZmIxOTg2NWQ1MTllNmM2
14
+ OWI1OTQ3YTk2YTg2NDlkM2YwMmQxOGRiZGZhODQ0ZmRjMzM0NjczZDFkNGJk
15
+ ZDUwNmFkNDdlM2Q3NmMyMjUyNjY3MzA5NWIzOWE3ZmQwNGJmZmE=
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 Gilad Goldberg
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ require 'easter_headers/middleware.rb'
2
+
3
+ module EasterHeaders
4
+ def self.init(header, value)
5
+ Rails.application.config.middleware.use EasterHeaders::Middleware, key: header, value: value
6
+ end
7
+ end
@@ -0,0 +1,25 @@
1
+ module EasterHeaders
2
+ class Middleware
3
+
4
+ def initialize(app, options)
5
+ @app = app
6
+ @options = options
7
+ end
8
+
9
+ def key
10
+ @options[:key]
11
+ end
12
+
13
+ def value
14
+ @options[:value]
15
+ end
16
+
17
+ def call(env)
18
+ status, headers, response = @app.call(env)
19
+
20
+ headers[key] = value
21
+
22
+ [status, headers, response]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ module EasterHeaders
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: easter_headers
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gilad Goldberg
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A small gem which adds harmless HTTP response headers to your app as
42
+ easter eggs.
43
+ email:
44
+ - giladgo@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - lib/easter_headers/middleware.rb
50
+ - lib/easter_headers/version.rb
51
+ - lib/easter_headers.rb
52
+ - MIT-LICENSE
53
+ homepage: https://github.com/iic-ninjas/easter-headers
54
+ licenses: []
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.1.10
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Add fun HTTP headers to your rails app
76
+ test_files: []