routes_revealer 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2191c1a0bd57656be39424408b0d510ac8bec0e
4
- data.tar.gz: fc4f00fd944e892b730ab056fef1dec1a080353c
3
+ metadata.gz: 3389bdc2a73c9e2472dc5a389dc77271f53969e4
4
+ data.tar.gz: 331e4a902420d3c8cf2b0de41f69fedfb5d0eb02
5
5
  SHA512:
6
- metadata.gz: 6a73ba748c1a21808c58d0b8d69607e3096f90649dba2b9b432a381ad3ced6cbde5ff78bd615bb7243d36fc98f46a0951fe2aa8adfb903d7c3974f61a74ebfe8
7
- data.tar.gz: d03cebee1bff064d301a266221dfdef8386e559e30a927d3d7f9561f33c0376a115522e35d33eb34be33b6bb42fab4cd01ba7b077555427eb79c5878db64ca01
6
+ metadata.gz: e7acf7e8016ac0a7663d21ed87dd2ab08ff4eaa291642181aea6065b18aa9c122b4675f3b5fe767d6ef6a1100b4b5d9541e28709c67439c92af26b2387c0bca0
7
+ data.tar.gz: b51e2acd1cc0e9ed5b2e30a7f051feb7f1ea47793f039335006d0ebbc30a6d4ca3a508bc5a6a0bfb6a36e47a5fc7ffdd26b97cdb79203642c38d25c1fa18e257
@@ -0,0 +1,10 @@
1
+ module ActionController
2
+ class Base
3
+ after_filter :add_app_name_headers
4
+
5
+ def add_app_name_headers
6
+ app_name = Rails.application.class.parent_name
7
+ response.headers['ApplicationName'] = app_name
8
+ end
9
+ end
10
+ end
@@ -1,4 +1,5 @@
1
1
  require "routes_revealer/engine"
2
+ require 'rails/response_injections'
2
3
 
3
4
  module RoutesRevealer
4
5
  end
@@ -1,3 +1,3 @@
1
1
  module RoutesRevealer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ module ActionController
4
+ describe Base do
5
+ let(:controller) { described_class.new }
6
+ let(:mock_response) { double('response', headers: {}) }
7
+
8
+ describe '#add_app_name_headers' do
9
+ before do
10
+ allow_any_instance_of(ActionController::Base).
11
+ to receive(:response).
12
+ and_return(mock_response)
13
+ end
14
+
15
+ it do
16
+ controller.add_app_name_headers
17
+ expect(mock_response.headers['ApplicationName']).to eq 'Dummy'
18
+ end
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: routes_revealer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Consumer Development
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -105,10 +105,12 @@ files:
105
105
  - app/controllers/routes_revealer/routes_controller.rb
106
106
  - config/routes.rb
107
107
  - lib/routes_revealer.rb
108
+ - lib/rails/response_injections.rb
108
109
  - lib/routes_revealer/engine.rb
109
110
  - lib/routes_revealer/version.rb
110
111
  - Rakefile
111
112
  - spec/spec_helper.rb
113
+ - spec/config/initializers/response_injections_spec.rb
112
114
  - spec/controllers/routes_controller_spec.rb
113
115
  - spec/support/helpers/controller_helpers.rb
114
116
  homepage: ''
@@ -137,5 +139,6 @@ specification_version: 4
137
139
  summary: Provides the route /routes which will list the applications routes
138
140
  test_files:
139
141
  - spec/spec_helper.rb
142
+ - spec/config/initializers/response_injections_spec.rb
140
143
  - spec/controllers/routes_controller_spec.rb
141
144
  - spec/support/helpers/controller_helpers.rb