项目作者: space-pirates-llc

项目描述 :
URL builder for ImageFlux
高级语言: Ruby
项目地址: git://github.com/space-pirates-llc/image_flux.git
创建时间: 2017-11-30T07:23:42Z
项目社区:https://github.com/space-pirates-llc/image_flux

开源协议:MIT License

下载


ImageFlux

Gem
CircleCI
Coverage Status

URL builder for ImageFlux®.

WIP: Provide API client

Installation

Add this line to your application’s Gemfile:

  1. gem 'image_flux'

And then execute:

  1. $ bundle

Or install it yourself as:

  1. $ gem install image_flux

Usage

Generate resize url for a path

  1. require 'image_flux'
  2. origin = ImageFlux::Origin.new(domain: 'example.imageflux.jp')
  3. origin.image_url('/original.jpg', width: 100)
  4. # => https://example.imageflux.jp/c/w=100/original.jpg

Generate option with class

  1. option = ImageFlux::Option.new()
  2. option.width = 100
  3. option.overlay = [
  4. { w: 100, path: '/hello-world.png' },
  5. ]
  6. origin.image_url('/original.jpg', option)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/space-pirates-llc/image_flux.

License

The gem is available as open source under the terms of the MIT License.

Notation

  • ImageFlux is a registered trademark of SAKURA Internet Inc..
  • Regarding the use of this gem, pixiv Inc. and SAKURA Internet Inc. makes no responsibility.