Kouhei Sutou
null+****@clear*****
Wed Dec 13 11:25:19 JST 2017
Kouhei Sutou 2017-12-13 11:25:19 +0900 (Wed, 13 Dec 2017) New Revision: 6944bff68a39640edcfbbd7347f183d3ed328f54 https://github.com/ranguba/chupa-text/commit/6944bff68a39640edcfbbd7347f183d3ed328f54 Message: Merge pull request #4 from okkez/add-mime-text-formatter Add MIME text formatter Patch by okkez. Thanks!!! Modified: (+3 -2) =================================================================== --- 2017-07-12 15:24:12 +0900 (2568d76) +++ 2017-12-13 11:25:19 +0900 (05285bd..478d83f) @@@ -26,28 -26,13 +26,28 @@@ module ChupaTex end end - AVAILABLE_FORMATS = [:json, :text] + AVAILABLE_FORMATS = [:json, :text, :mime] + SIZE = /\A\d+x\d+\z/o + OptionParser.accept(SIZE, SIZE) do |value| + if value + begin + value.split("x").collect {|number| Integer(number)} + rescue ArgumentError + raise OptionParser::InvalidArgument, value + end + end + end + def initialize @input = nil - @configuration = Configuration.default + @configuration = Configuration.load_default @enable_gems = true + @uri = nil + @mime_type = nil @format = :json + @need_screenshot = true + @expected_screenshot_size = [200, 200] end def run(*arguments) diff --cc lib/chupa-text/formatters.rb index 12155bb,12ebe94..dc7e1e6 --- a/lib/chupa-text/formatters.rb +++ b/lib/chupa-text/formatters.rb @@@ -14,6 -14,6 +14,7 @@@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +require "chupa-text/formatters/hash" require "chupa-text/formatters/json" require "chupa-text/formatters/text" + require "chupa-text/formatters/mime" -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171213/77487956/attachment-0001.htm