{"push_id":1176172159,"size":11,"distinct_size":11,"ref":"refs/heads/master","head":"1ef85eddd6edc7cac11cd94433a0161b72e0a503","before":"02364af843b0de410e5a3b38046330646e372c6b","commits":[{"sha":"35d7e7ecdaf7231ef3ce682431390c33f8a989cd","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"General code, tests and doc improvements","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/35d7e7ecdaf7231ef3ce682431390c33f8a989cd"},{"sha":"44b365686dac2386a36abb61b16d299ab2b8ac9b","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Execute the file command always in the same way\n\nPreviously we were branching the way we execute the file command,\ndepending on whether the IO was a file or not. However, this leads to\ninconsistent behaviour; the MIME type could be determined differently on\nthe original file and on an UploadedFile with restore_cached_data. We\ndon't want that, we want that the file command always returns the same\nresult, regardless of type of the given IO (that's why we have this\nabstraction in the first place).","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/44b365686dac2386a36abb61b16d299ab2b8ac9b"},{"sha":"14800d6eb9b6adf7ddde984f1c62dbfafb4a54e3","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Increase magic header and make it configurable\n\nI blindly copy-pasted the length of 1KB from CarrierWave, but I never\nreally tried to find out how much does the file command or\nruby-filemagic gem actually need to determine MIME type of every file.\n\nSo I ran the following in the command line:\n\n  file = File.open(\"/path/to/file\")\n  system \"file --mime-type -\", in: file\n  file.pos #=> 262144\n\nFor every file, the file command seemed to always read the first 256KB\nof the file. This leads us to the conclusion that this is the correct\nnumber of bytes we should always read (or at least it's a more correct\nnumber).\n\nIn case this number is not high enough or is too high, we've made this\nnumber configurable.","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/14800d6eb9b6adf7ddde984f1c62dbfafb4a54e3"},{"sha":"759a9b5981b0d2c752250347ae533f71042ee75e","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Switch to Down.open and deprecate Storage#stream\n\nUsing `Down.open` is now the preferred way to implement #open for remote\nstorages, and all storages have been updated with `Down.open`. The\nprevious common way to implement #open was by delegating to #download,\nwhich immediately downloads the whole file. However, in\nrestore_cached_data plugin we don't want/need to download the whole\nfile, because metadata like MIME type is usually located already in the\nbeginning of the file. `Down.open` provides an IO interface around\nstreaming the file, downloading only how much it is asked to.\n\nThis deprecates #stream, as Down::ChunkedIO, returned by `Down.open`,\nhas #each_chunk which provides the same behaviour.","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/759a9b5981b0d2c752250347ae533f71042ee75e"},{"sha":"046966348aa4ad1d68f8ca1e52403e46c53f0dba","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Give tips about upload in \"Creating a New Storage\"","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/046966348aa4ad1d68f8ca1e52403e46c53f0dba"},{"sha":"eb09d5e3cae901b8c2da4cb1b1fd849ea789d0a6","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Pass UploadedFile when reextracting metadata\n\nWe had to recently change the result of Storage#open, which means that\nthe argument to #extract_metadata also changed. However, we want the\nargument to always be the same regardless of the storage, so that users\nknow they have to extract metadata using the IO interface, instead of\nusing file methods.\n\nThe side effect of this is that now #original_filename is preserved,\nwhere before it could be lost. For #size we need to use the opened size\nover the one from metadata.\n\nAnother advantage is that the user can choose to reuse any custom\nmetadata instead of reextracting it (e.g. if it would mean downloading\nthe whole file).","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/eb09d5e3cae901b8c2da4cb1b1fd849ea789d0a6"},{"sha":"621b39befda039c67f0ca031169c470137a44160","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Ensure restore_cached_data keeps custom metadata\n\nSometimes in direct uploads we might want to save additional metadata\nthat we got from the service. So we just test that restore_cached_data\ndoesn't override such metadata.","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/621b39befda039c67f0ca031169c470137a44160"},{"sha":"ff59eadd2ebe79137c634471cf3a8284ae1637f6","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Don't require :names anymore in versions plugin\n\nInitially the versions plugin didn't have the :names option, but then I\nadded it because I figured that without it an attacker can DoS the app\nby changing the hidden field to have a lot of versions with made-up\nnames.\n\nHowever, I think it's a much better solution to forbid generating\nversions in the cache phase and assigning them. This way we don't have\nany problem. I think shouldn't be limiting, because processing on\ncaching in general can leave a security leak if not careful, and also\nwith presigned uploads you cannot even generate versions, which is what\neveryone should be doing anyway.\n\nThis makes it much nicer to manage versions, because the user doesn't\nhave to update the :names list every time they add or remove a version.","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/ff59eadd2ebe79137c634471cf3a8284ae1637f6"},{"sha":"df45335efddf3f25a75bffce7a4332130edb097d","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Check cached file outside of #assign_cached\n\nIf the check is inside, both restore_cached_data and versions plugin\nneed to also check if the file is cached, which creates redundancy. So\nwe put it outside, and we also immediately transform the argument to an\nUploadedFile.","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/df45335efddf3f25a75bffce7a4332130edb097d"},{"sha":"a93a504d02ef128795aadf942f890101fc5fe69e","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Add a \"Quick start\" section\n\nIt's very useful for newcomers who at the moment aren't interested in\nthe \"why\" and \"how\", just \"what\" they need to do to set up Shrine.","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/a93a504d02ef128795aadf942f890101fc5fe69e"},{"sha":"1ef85eddd6edc7cac11cd94433a0161b72e0a503","author":{"name":"Janko Marohnić","email":"abca1832175625e175a699db65e26683ea626451@gmail.com"},"message":"Separate plugins and storages on the website","distinct":true,"url":"https://api.github.com/repos/janko-m/shrine/commits/1ef85eddd6edc7cac11cd94433a0161b72e0a503"}]}
{"actor":{"display_login":"janko-m"}}