washout_builder 1.5.1 → 1.5.3

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: b8b50b25747f6af3feb7d0a12b37a0b6852afff0
4
- data.tar.gz: 1db16f0e175ddfde4b33db6af4632f7296356485
3
+ metadata.gz: 64e288d5c210339145c6ab2ce95ba29b9547fa29
4
+ data.tar.gz: 4e55a2663553896976ccbb0666f1df208b424fc0
5
5
  SHA512:
6
- metadata.gz: fa41d90617873733ec118b9e9e707904127a085ee4295640d1ebc607bb8e18ec8c4f751644f2a5ccaffd2f1e18bfba7c572fac06f667486fd9523af01d2656bb
7
- data.tar.gz: f909f7ee2631bcec25593e46d29aa7a2acf0ff35aa88b868e605bd846d3c9e1d7bd05172e9e3af09711c6fec23af2abcdb654ee082c457c1d98b53882dc94f5f
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.0
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
- if config.respond_to?(:washout_builder) # needed in case the gem is not in the default group
23
- config.washout_builder.mounted_path = "/washout" # the path where the engine should be mounted on
24
- config.washout_builder.whitelisted_envs = "*" # this can either be an array of strings or a string. If you specify "*" ,will mean all environments , otherwise you can specify "development" or ['development', 'staging'] or nil
25
- config.washout_builder.blacklisted_envs = nil # this can either be an array of strings or a string. You can specify for example "production" or ['production', 'test'], or nil
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
@@ -12,7 +12,7 @@ module WashoutBuilder
12
12
  # the minor version of the gem
13
13
  MINOR = 5
14
14
  # the tiny version of the gem
15
- TINY = 1
15
+ TINY = 3
16
16
  # if the version should be a e
17
17
  PRE = nil
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: washout_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada