washout_builder 1.5.1 → 1.5.3
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/README.md +14 -5
- data/app/controllers/washout_builder/washout_builder_controller.rb +12 -0
- data/lib/washout_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64e288d5c210339145c6ab2ce95ba29b9547fa29
|
4
|
+
data.tar.gz: 4e55a2663553896976ccbb0666f1df208b424fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6280cbf7bead23d41b4b53bd81912119af78e7d589f0735345c6241b53d98dbec22663fb7de90ea7750099785ddbf6e04c80dccb0c1eb30f3c8c2dcb72ba511f
|
7
|
+
data.tar.gz: 8783cae3fde3e426e5feb30977180a462ddd3adc0ac837152e1659fd0c9390678b127477b5e2c3d016376ede8bf8cada4f9db56bafe142e15f828b2d6e15982d
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ WashOutBuilder is a Soap Service Documentation generator (extends [WashOut](http
|
|
10
10
|
|
11
11
|
The way [WashOut](https://github.com/inossidabile/wash_out) is used is not modified, it just extends its functionality by generating html documentation to your services that you write
|
12
12
|
|
13
|
-
NEW Improvements in version 1.5.
|
13
|
+
NEW Improvements in version 1.5.1
|
14
14
|
---------------------------------
|
15
15
|
|
16
16
|
- The WashoutBuilder::Engine can now be automatically be mounted in Rails application by using a simple configuration in **config/application.rb** which allows you to whitelist or blacklist the environment where WashoutBuilder::Engine can be mounted .
|
@@ -19,10 +19,19 @@ NEW Improvements in version 1.5.0
|
|
19
19
|
E.g.
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
config.washout_builder.
|
22
|
+
# needed in case the gem is not in the default group
|
23
|
+
if config.respond_to?(:washout_builder)
|
24
|
+
# the path where the engine should be mounted on
|
25
|
+
config.washout_builder.mounted_path = "/washout"
|
26
|
+
# this can either be an array of strings or array of regular expressions or a string.
|
27
|
+
# If you specify "*" ,will mean all environments
|
28
|
+
# otherwise you can specify "development" or ['development', 'staging'] or nil
|
29
|
+
# or you can use regular expressions like /development/ or array of regular expressions
|
30
|
+
config.washout_builder.whitelisted_envs = "*"
|
31
|
+
# this can either be an array of strings or array of regular expressions or a string.
|
32
|
+
# you can specify "production" or ['production', 'test'] or nil
|
33
|
+
# or you can use regular expressions like /production/ or array of regular expressions
|
34
|
+
config.washout_builder.blacklisted_envs = nil
|
26
35
|
end
|
27
36
|
```
|
28
37
|
|
@@ -3,6 +3,8 @@ module WashoutBuilder
|
|
3
3
|
# controller that is used to prit all available services or print the documentation for a specific service
|
4
4
|
class WashoutBuilderController < ActionController::Base
|
5
5
|
protect_from_forgery
|
6
|
+
around_action :check_env_available
|
7
|
+
|
6
8
|
|
7
9
|
# Will show all api services if no name parameter is receiverd
|
8
10
|
# If a name parameter is present will try to use that and find a controller
|
@@ -195,5 +197,15 @@ module WashoutBuilder
|
|
195
197
|
service_namespace(hash, controller_name).gsub('/wsdl', '/soap_doc')
|
196
198
|
#"#{washout_builder.root_path}#{controller_naming(controller_name)}"
|
197
199
|
end
|
200
|
+
|
201
|
+
def check_env_available
|
202
|
+
env_checker = WashoutBuilder::EnvChecker.new(Rails.application)
|
203
|
+
if env_checker.available_for_env?(Rails.env)
|
204
|
+
yield
|
205
|
+
else
|
206
|
+
raise ActionController::RoutingError
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
198
210
|
end
|
199
211
|
end
|