README.md in carrierwave-cloudflare-0.3.2 vs README.md in carrierwave-cloudflare-0.4.0

- old
+ new

@@ -1,11 +1,11 @@ -# Carrierwave::Cloudflare +# CarrierWave::Cloudflare [![Tests](https://github.com/resume-io/carrierwave-cloudflare/actions/workflows/run-specs.yml/badge.svg?branch=master)](https://github.com/resume-io/carrierwave-cloudflare/actions/workflows/run-specs.yml) [![Gem Version](https://badge.fury.io/rb/carrierwave-cloudflare.svg)](https://badge.fury.io/rb/carrierwave-cloudflare) -This gem integrates CarrierWave with [Cloudflare Image Resizing](https://developers.cloudflare.com/images/) +This gem integrates CarrierWave with [Cloudflare Image Resizing](https://developers.cloudflare.com/images/image-resizing) ## Installation Add this line to your application's Gemfile: @@ -16,11 +16,11 @@ And then execute: $ bundle install -Or install it yourself as: +Or install it yourself with: $ gem install carrierwave-cloudflare ## Usage @@ -30,11 +30,11 @@ class BaseUploader < CarrierWave::Uploader::Base include CarrierWave::Cloudflare end ``` -Use `cdn_transform` for define Cloudflare's version (this means that now the file will not be stored on the, but will be transformed on the cloudflare side) +Use `cdn_transform` to define Cloudflare's version (this means that now the file will not be stored on a server, but will be transformed on the Cloudflare side) ```ruby class AvatarUploader < BaseUploader version(:medium) do cdn_transform width: 100, height: 100, dpr: 2 @@ -54,34 +54,31 @@ Supported options: `width`, `height`, `dpr`, `fit`, `gravity`, `quality`, `format`, `onerror`, `metadata` -See details in Cloudflare [documentation](https://developers.cloudflare.com/images/url-format) +See details in Cloudflare's [documentation](https://developers.cloudflare.com/images/url-format) -Also, you can define default options (supports all options described above) +You can also define default options (supports all options described above) ```ruby class BaseUploader < CarrierWave::Uploader::Base default_cdn_options format: :auto end ``` ### In development env -In development, you don't need to generate URLs for Cloudflare, because they will not work and therefore you need to disable the Cloudflare transform +In development you don't need to generate URLs for Cloudflare, because they will not work and therefore you need to disable the Cloudflare transform ``` ruby CarrierWave::Cloudflare.configure do |config| config.cloudflare_transform(false) end ``` -`cloudflare_transform: false` disables links generation and put all Cloudflare's arguments into query string (for easy debugging) - -e.g: - +`cloudflare_transform: false` disables links generation and puts all Cloudflare's arguments into query string (for easy debugging) ``` /1.jpg?cdn-cgi=width-11.height-300.fit-pad ``` ## Rails views helpers @@ -98,11 +95,11 @@ ``` ### hidpi_image_tag(url, dprs: nil, **options) -Returns an image tag with with scaled variations (via `srcset`) attribute for devices with different DPR values. +Returns an image tag with scaled variations (via `srcset`) attribute for devices with different DPR values. The transformation of the original image should be specified via options. ```ruby @@ -129,8 +126,12 @@ ``` ## 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. +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](https://rubygems.org). + +## License + +This project is licensed and distributed under the terms of the [MIT license](https://github.com/resume-io/carrierwave-cloudflare/blob/master/LICENSE.txt).