imageboss-rb 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -3
- data/lib/imageboss/path.rb +2 -2
- data/lib/imageboss/version.rb +1 -1
- data/spec/imageboss/client_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae6b675cc6f4deb733513dd5cfcb04c30c90a392
|
4
|
+
data.tar.gz: 0a132f8c1e3448f154a7cd0734f15f86c766c25b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 937824c0290c007135b89bed99fc16c32ed7bf1930b48ba17830bbbdf446cffa04ddffac2101e6626a0823899f267c8aac26d5fc537f557af6c44159e26d310a
|
7
|
+
data.tar.gz: 67feaf74d29b56b27bc01bfe1cf85172706101f43bb0f6bfebfb16ccd6b4e812da19c643424baa35855873467fb4b2eb1e47307b77a8a0af8ef752af89ec4a49
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,22 @@
|
|
1
|
+
[](https://imageboss.me)
|
2
|
+
|
1
3
|
# ImageBoss Helper for Ruby
|
2
4
|
[](https://travis-ci.org/imageboss/imageboss-rb) [](https://badge.fury.io/rb/imageboss-rb)
|
3
5
|
|
4
6
|
Official Gem for generating ImageBoss URLs.
|
5
7
|
[https://imageboss.me/](https://imageboss.me/)
|
6
8
|
|
9
|
+
**Table of Contents**
|
10
|
+
- [ImageBoss Helper for Ruby](#imageboss-helper-for-ruby)
|
11
|
+
- [Installation](#installation)
|
12
|
+
- [Usage](#usage)
|
13
|
+
- [Example `Image Resizing With Cover Operation`](#example-image-resizing-with-cover-operation)
|
14
|
+
- [Example `Image Resizing With Height Operation`](#example-image-resizing-with-height-operation)
|
15
|
+
- [Example `Image Resizing With Extra Options`](#example-image-resizing-with-extra-options)
|
16
|
+
- [All operations and options for Image Resizing](#all-operations-and-options-for-image-resizing)
|
17
|
+
- [Disabling URL generation](#disabling-url-generation)
|
18
|
+
- [Tested on](#tested-on)
|
19
|
+
|
7
20
|
## Installation
|
8
21
|
Add this line to your application's Gemfile:
|
9
22
|
```
|
@@ -24,7 +37,7 @@ client = ImageBoss::Client.new(domain: 'https://mywebsite.com')
|
|
24
37
|
image_url = client.path('/images/img01.jpg')
|
25
38
|
.operation(:cover, width: 100, height: 100)
|
26
39
|
|
27
|
-
#=> https://
|
40
|
+
#=> https://img.imageboss.me/cover/100x100/https://mywebsite.com/images/img01.jpg
|
28
41
|
```
|
29
42
|
|
30
43
|
### Example `Image Resizing With Height Operation`
|
@@ -34,7 +47,7 @@ client = ImageBoss::Client.new(domain: 'https://mywebsite.com')
|
|
34
47
|
image_url = client.path('/images/img01.jpg')
|
35
48
|
.operation(:height, height: 100)
|
36
49
|
|
37
|
-
#=> https://
|
50
|
+
#=> https://img.imageboss.me/height/100/https://mywebsite.com/images/img01.jpg
|
38
51
|
```
|
39
52
|
|
40
53
|
### Example `Image Resizing With Extra Options`
|
@@ -44,7 +57,7 @@ client = ImageBoss::Client.new(domain: 'https://mywebsite.com')
|
|
44
57
|
image_url = client.path('/images/img01.jpg')
|
45
58
|
.operation(:width, width: 100, options: { grayscale: true })
|
46
59
|
|
47
|
-
#=> https://
|
60
|
+
#=> https://img.imageboss.me/width/100/grayscale:true/https://mywebsite.com/images/img01.jpg
|
48
61
|
```
|
49
62
|
### All operations and options for Image Resizing
|
50
63
|
It's all available on our [Official Docs](https://imageboss.me/docs).
|
data/lib/imageboss/path.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module ImageBoss
|
2
2
|
class Path
|
3
|
-
SERVICE_URL = 'https://
|
3
|
+
SERVICE_URL = 'https://img.imageboss.me'.freeze
|
4
4
|
OPERATIONS = {
|
5
5
|
cover: {
|
6
6
|
recipe: '/:operation::mode/:widthx:height/:options/', required: [:width, :height]
|
@@ -46,7 +46,7 @@ module ImageBoss
|
|
46
46
|
.sub(':operation', @operation_name.to_s)
|
47
47
|
.sub(':width', @options[:width].to_s)
|
48
48
|
.sub(':height', @options[:height].to_s)
|
49
|
-
.sub(':options', @extra_options.empty? ?
|
49
|
+
.sub(':options', @extra_options.empty? ? '' : "#{@extra_options}/")
|
50
50
|
.sub('::mode', @options[:mode] ? ":#{@options[:mode]}" : '').to_s
|
51
51
|
end
|
52
52
|
|
data/lib/imageboss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imageboss-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Escobar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|