easy_swagger_ui 0.1.0 → 0.1.1

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: 7a95115097dea55839e2874050608eb041a1614d
4
- data.tar.gz: 683b55ee718a44a7e735ac5751bfdd64f79afb1e
3
+ metadata.gz: fb69bf4054ea2258df60e3bad3c85a706a053833
4
+ data.tar.gz: dfe40a699efc3003da6d41be36c9e7f3b1e9acc1
5
5
  SHA512:
6
- metadata.gz: cdb7ba624c0668ab37be9f1d76e819f6199aa95b5c08348a3b6b9f1f9a9aebe5ea771a90aac02cd529e38ff911a0e2647394454a49a3b780f16fc65088c67803
7
- data.tar.gz: 6e520a375288ee74242364d0b6b283e524c2a981b9a9c70217c6223158b570c098a398cbc74182488a607d2f509c8cf76cb71e2822e5f16a16be9458147d4754
6
+ metadata.gz: 235135a74376c13f3f14f97410db0a13fc4dd4aa45ba1d069f46f940cdade3bf7b8242a52b7ed9cf29efbb65ce619bf21186fe27a880d9dc85ca8bce57c8a37b
7
+ data.tar.gz: d675885f1618286fa70c2558c9011972f1f7c21758ac5a15b8a3d977c3ee6df45b3f14deacf91fead54cb37d49f4ce08bf4bd29445faa290a7c36ab01c504877
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.1.1
6
+
7
+ * Fix checking whether an asset exists in production environment
8
+
5
9
  ## 0.1.0
6
10
 
7
11
  The first release
@@ -3,5 +3,13 @@ module EasySwaggerUi
3
3
  def swagger_routes
4
4
  Engine.routes.url_helpers
5
5
  end
6
+
7
+ def asset_available?(path)
8
+ if Rails.configuration.assets.compile
9
+ Rails.application.precompiled_assets.include?(path)
10
+ else
11
+ Rails.application.assets_manifest.assets[path].present?
12
+ end
13
+ end
6
14
  end
7
15
  end
@@ -13,12 +13,11 @@
13
13
  <%= javascript_include_tag "easy_swagger_ui/application" %>
14
14
 
15
15
  <%
16
- asset_name = "easy_swagger_ui/lang/#{I18n.locale.to_s.downcase}.js"
17
- translation = Rails.application.assets.find_asset(asset_name)
16
+ translation_js = "easy_swagger_ui/lang/#{I18n.locale.to_s.downcase}.js"
18
17
  %>
19
- <% if translation %>
18
+ <% if asset_available?(translation_js) %>
20
19
  <%= javascript_include_tag "easy_swagger_ui/lang/translator" %>
21
- <%= javascript_include_tag asset_name %>
20
+ <%= javascript_include_tag translation_js %>
22
21
  <% end %>
23
22
 
24
23
  <script type="text/javascript">
@@ -1,4 +1,4 @@
1
1
  module EasySwaggerUi
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  SWAGGER_UI_VERSION = '2.2.10'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_swagger_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bian Jiaping