Skip to content

Instantly share code, notes, and snippets.

@tumugin
Created February 15, 2017 21:49
Show Gist options
  • Save tumugin/7d64df33302a640c69bc0aa40fcbbbbd to your computer and use it in GitHub Desktop.
Save tumugin/7d64df33302a640c69bc0aa40fcbbbbd to your computer and use it in GitHub Desktop.
diff --git core/plugin/photo/model/photo.rb core/plugin/photo/model/photo.rb
index b954ead..02c8ba7 100644
--- core/plugin/photo/model/photo.rb
+++ core/plugin/photo/model/photo.rb
@@ -21,7 +21,7 @@ module Plugin::Photo
when String
if uri.start_with?('http')
photos[uri.hash] ||= new(perma_link: uri)
- elsif uri.start_with?('/')
+ elsif uri.start_with?('/') || uri.match(/[A-Z]:\/.*/)
uri = Retriever::URI.new(scheme: 'file', path: uri)
photos[uri.hash] ||= new(perma_link: uri)
end
@tumugin
Copy link
Author

tumugin commented Feb 15, 2017

Windowsでは*nix環境のような/から始まるファイルパスではなく[ドライブレター]:/な形になるのでそれに合うようにコードを変更しました。
最近のmikutterがWindows環境でクラッシュするバグが直るはずです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment