rails_amp 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f8f5df088e9fdf8500a6cd310d073c33120a228
4
- data.tar.gz: f74d3bb4bf629eb232278451a2beb42ba88b07da
3
+ metadata.gz: b477424405e8a2a63fac02dc549d5e55604b6aa7
4
+ data.tar.gz: 523e1fbb918d94ce89f15cbd7b021af62c761833
5
5
  SHA512:
6
- metadata.gz: 645df9b500c4b328200576b2a704c901fed5f52da790b8e509205a33ba236b0262d3ec60be4b2b3e052a14cd7803030bc5e07dc8c14fe7690bb5e52cb89db186
7
- data.tar.gz: fca1dbd2bbc80ba7a3f1b7ace7c1b694862746ad991b59eb5ede1c754f2bf0c555630b65b1ecce01d13b464663a1e412e1421f8f3ce347642efafbaf00a9027d
6
+ metadata.gz: 84937ec9c06080f49281cba75e5c097eca34726d22e2a5c022efaee3de0598bef247c484dfb6399496c73f7ff19f010b306f78b9f4bcd215d2dcb1e5e76905df
7
+ data.tar.gz: 5d35623d87c559b8f4e4b000f242c9c8a52919105ee47265b5a9c056abb41f28634f421725c7676705c2657c9dfe1a38bd1a72bb6832e2661ae2bb6902901596
@@ -1,3 +1,3 @@
1
1
  module RailsAmp
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
@@ -45,8 +45,9 @@ module RailsAmp
45
45
  source_for_fastimage = source
46
46
  unless source =~ ::ActionView::Helpers::AssetUrlHelper::URI_REGEXP
47
47
  # find_asset is a Sprockets method
48
- source_for_fastimage = Rails.application.assets.find_asset(source).try(:pathname).to_s.presence ||
49
- File.join(Rails.public_path, source)
48
+ asset_env = Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
49
+ source_for_fastimage = asset_env.find_asset(source).try(:pathname).to_s.presence ||
50
+ File.join(Rails.public_path, source)
50
51
  end
51
52
  FastImage.size(source_for_fastimage) || [300, 300]
52
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_amp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takafumi Yamano