power_by_autobots 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/power_by_autobots.rb +15 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e462183aaf3fc8c8c34258e48497a3d24acb4495
|
4
|
+
data.tar.gz: 02ffd34611cedc4b99768ec998b6b255dc94e740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d1a365291e0bb9cf49746e1424515e2b63bb6936623e8621941e8740a22f19a24121cf1f35e99d92bf1bb2e236bf971d1b527aa9b4b6f42b9048324d7c98b9
|
7
|
+
data.tar.gz: 1eb998dcd59b89e1d8233162df57e2e5262674fc0bdcbb246318cb1cebadd0b2ac16313a0c04277ed5a544e26dbe21977f7547a543adaa263fd66e062f752c30
|
data/lib/power_by_autobots.rb
CHANGED
@@ -1,12 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Autobots
|
2
|
+
class Railtie < Rails::Railtie
|
3
|
+
initializer "autobots.configure_rails_initialization" do
|
4
|
+
Rails.application.middleware.use Autobots::PowerBy
|
5
|
+
end
|
4
6
|
end
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
class PowerBy
|
9
|
+
def initialize(app)
|
10
|
+
@app = app
|
11
|
+
end
|
9
12
|
|
10
|
-
|
13
|
+
def call(env)
|
14
|
+
status, headers, response = @app.call(env)
|
15
|
+
headers["X-Powered-By"] = "Autobots"
|
16
|
+
|
17
|
+
[status, headers, response]
|
18
|
+
end
|
11
19
|
end
|
12
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: power_by_autobots
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darmody
|
@@ -17,7 +17,7 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/power_by_autobots.rb
|
20
|
-
homepage:
|
20
|
+
homepage: https://github.com/Darmody/power_by_autobots
|
21
21
|
licenses:
|
22
22
|
- MIT
|
23
23
|
metadata: {}
|