easy_swagger_ui 0.1.2 → 0.1.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: e90ab29f418dd69dc1737be17ff10afa828df33c
4
- data.tar.gz: da13944d26fe609c1e4bafaaa412c6abe7493a72
3
+ metadata.gz: 172af30977a462f13d6458b4e79d82bde68ce24f
4
+ data.tar.gz: d7e89ffe4b43b6a41a2bb417acf387568eea95fb
5
5
  SHA512:
6
- metadata.gz: 15068018a03fc497126d370b6ce6aeadb74e33acebab31f7710d363a5a51e9c46180defe4be260c95a2f24bd58437d89124f13984c1e9c03ca263a5ae65926ef
7
- data.tar.gz: 0a1078ea03dfa01f5d631167371bfe5666d450798c6561c5e219dd6d3a45114b9df736b386b68be9b2ac46a5438973853f93b53c8c07f217f19ee53131806904
6
+ metadata.gz: 951f5a67f4e3d42dbb31e6cf45b426227a58c945826d6309690a7d268bf60d4c41f9e6173cb25e40f1c38bed19555e58e76b464cd2939d4f77596651dd08cff7
7
+ data.tar.gz: eecd54fd3adeeaa25ad054b70753d26feb37fc078ecdd05b31962c5bf1c35242a35501c56a1df490ece8d4bc99cece06fcd84d3f66d61fbda5c3005f299c1476
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.1.3
6
+
7
+ * Explicitly include `ApplicationHelper` in controller to avoid tricky issues that sometimes helper methods are not available in view
8
+
5
9
  ## 0.1.2
6
10
 
7
11
  * Fix routing error when docs are not in sub directories of `EasySwaggerUi.base_path`
@@ -2,5 +2,6 @@ module EasySwaggerUi
2
2
  class ApplicationController < ActionController::Base
3
3
  protect_from_forgery with: :exception
4
4
  layout false
5
+ helper EasySwaggerUi::ApplicationHelper
5
6
  end
6
7
  end
@@ -4,6 +4,12 @@ module EasySwaggerUi
4
4
  Engine.routes.url_helpers
5
5
  end
6
6
 
7
+ def load_translation_if_available
8
+ translation_js = "easy_swagger_ui/lang/#{I18n.locale.to_s.downcase}.js"
9
+ return unless asset_available?(translation_js)
10
+ javascript_include_tag('easy_swagger_ui/lang/translator', translation_js)
11
+ end
12
+
7
13
  def asset_available?(path)
8
14
  if Rails.configuration.assets.compile
9
15
  Rails.application.precompiled_assets.include?(path)
@@ -11,14 +11,7 @@
11
11
  <%= stylesheet_link_tag "easy_swagger_ui/print", media: "print" %>
12
12
 
13
13
  <%= javascript_include_tag "easy_swagger_ui/application" %>
14
-
15
- <%
16
- translation_js = "easy_swagger_ui/lang/#{I18n.locale.to_s.downcase}.js"
17
- %>
18
- <% if asset_available?(translation_js) %>
19
- <%= javascript_include_tag "easy_swagger_ui/lang/translator" %>
20
- <%= javascript_include_tag translation_js %>
21
- <% end %>
14
+ <%= load_translation_if_available %>
22
15
 
23
16
  <script type="text/javascript">
24
17
  $(function () {
@@ -1,4 +1,4 @@
1
1
  module EasySwaggerUi
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  SWAGGER_UI_VERSION = '2.2.10'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_swagger_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bian Jiaping
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails