teaas 0.1.0 → 0.2.1
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/CHANGELOG.md +7 -0
- data/README.md +31 -2
- data/lib/teaas.rb +1 -0
- data/lib/teaas/marquee.rb +36 -0
- data/teaas.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3098f05416cee548414bbf1641777a458c11972f
|
4
|
+
data.tar.gz: c147b163841ff68b6801aff1050abf8806d8caea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e7e7e26b71e1edd77ad559dd8a842cabfd2cd71dc905fb1d309046269237919b330494db4f0a86745508e66eaf986c90069c00a42e8dab1566a4c4c41590db1
|
7
|
+
data.tar.gz: 44a3083502b2310474dbc3b5ca0d5f8256b0c2b1bb9fa8c619dc7437affdbd09d7c43509bebab7e570e9644bfb140726861514ab71565d4bc42332cd8b3d6ffd
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# teaas
|
2
|
-
](https://travis-ci.org/wjr1985/teaas) [](https://badge.fury.io/rb/teaas)
|
3
3
|
## Total Emojis as a Service
|
4
4
|
|
5
|
-
Total Emojis as a Service (Teaas / TEAAS) is a lightweight library that wraps around [RMagick](https://github.com/rmagick/rmagick) and allows easy manipulation of emojis or emoji-like GIFs. Right now, it supports "Turbo"ing the emoji, or making
|
5
|
+
Total Emojis as a Service (Teaas / TEAAS) is a lightweight library that wraps around [RMagick](https://github.com/rmagick/rmagick) and allows easy manipulation of emojis or emoji-like GIFs. Right now, it supports "Turbo"ing the emoji, making it spin, or making a marquee. This is a very early version, with more features and bug fixes to come in the future.
|
6
6
|
|
7
7
|
## Requirements
|
8
8
|
|
@@ -21,6 +21,14 @@ Spinning an image just takes the image that is input and makes it spin clockwise
|
|
21
21
|
|
22
22
|
**NOTE**: Spinning removes any transparency from the image.
|
23
23
|
|
24
|
+
### Marquee (new!)
|
25
|
+
|
26
|
+
Making an image a marquee involves taking a static image, and making intermediate images so that when the emojis are next to each other, they look like they're flowing together (like a marquee). It's best to try it out and see the results.
|
27
|
+
|
28
|
+
**NOTE**: Marquee removes any transparency from the image.
|
29
|
+
|
30
|
+
**NOTE**: Marquee does not work on all images right now. This initial version works best on small images that make sense to be converted into a marquee. Larger images might not work as expected.
|
31
|
+
|
24
32
|
## Documentation
|
25
33
|
Docs are in [YARD](http://yardoc.org/) format. To build the HTML docs, just `gem install yard` then run `yard`. If you'd rather not use YARD, you can just read the documentation for the methods in the source files.
|
26
34
|
|
@@ -70,6 +78,27 @@ final_result = Teaas::Turbo.turbo(spin_result, false)
|
|
70
78
|
// final_result contains an array of image blobs
|
71
79
|
```
|
72
80
|
|
81
|
+
## Marquee
|
82
|
+
### From a file
|
83
|
+
```ruby
|
84
|
+
image_path = "image.gif"
|
85
|
+
|
86
|
+
marquee_result = Teaas::Marquee.marquee_from_file(image_path)
|
87
|
+
final_result = Teaas::Turbo.turbo(marquee_result, false)
|
88
|
+
// final_result contains an array of image blobs
|
89
|
+
```
|
90
|
+
|
91
|
+
### From a `Magick::ImageList`
|
92
|
+
```ruby
|
93
|
+
image = Magick::ImageList.new
|
94
|
+
|
95
|
+
//populate image here
|
96
|
+
|
97
|
+
marquee_result = Teaas::Marquee.marquee(image)
|
98
|
+
final_result = Teaas::Turbo.turbo(marquee_result, false)
|
99
|
+
// final_result contains an array of image blobs
|
100
|
+
```
|
101
|
+
|
73
102
|
# Questions / PRs, etc.
|
74
103
|
Feel free to open a GitHub issue or file a pull request if you have a question or would like something added.
|
75
104
|
|
data/lib/teaas.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Teaas
|
2
|
+
class Marquee
|
3
|
+
|
4
|
+
# Takes in an image, rolls it 25%, 50%, 75%, and 100%, then returns an animated marquee image. Best when used with {Teaas::Turboize.turbo} to generate multiple marquee speeds.
|
5
|
+
#
|
6
|
+
# @param original_img [Magick::ImageList] The image to be created into a marquee
|
7
|
+
# @return [Magick::ImageList] The marquee image
|
8
|
+
def self.marquee(original_img)
|
9
|
+
marquee_image = Magick::ImageList.new
|
10
|
+
img = original_img.flatten_images
|
11
|
+
img.format = "gif"
|
12
|
+
|
13
|
+
marquee_image << img
|
14
|
+
marquee_image << img.roll(25, 0)
|
15
|
+
marquee_image << img.roll(50, 0)
|
16
|
+
marquee_image << img.roll(75, 0)
|
17
|
+
marquee_image << img.roll(100, 0)
|
18
|
+
|
19
|
+
marquee_image
|
20
|
+
end
|
21
|
+
|
22
|
+
# Takes in an image, rolls it 25%, 50%, 75%, and 100%, then returns an animated marquee image. Best when used with {Teaas::Turboize.turbo} to generate multiple marquee speeds. This is a wrapper around {Teaas::Marquee.marquee}
|
23
|
+
#
|
24
|
+
# @param path [String] Path to the image to be created to a marquee image
|
25
|
+
# @return [Magick::ImageList] The marquee image
|
26
|
+
def self.marquee_from_file(path)
|
27
|
+
img = Magick::ImageList.new
|
28
|
+
|
29
|
+
# Grab the first element in array to prevent strange things when an
|
30
|
+
# animated image is submitted
|
31
|
+
img.read(path)[0]
|
32
|
+
|
33
|
+
marquee(img)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/teaas.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teaas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Rastello
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|
@@ -46,10 +46,12 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- ".gitignore"
|
48
48
|
- ".travis.yml"
|
49
|
+
- CHANGELOG.md
|
49
50
|
- Gemfile
|
50
51
|
- LICENSE
|
51
52
|
- README.md
|
52
53
|
- lib/teaas.rb
|
54
|
+
- lib/teaas/marquee.rb
|
53
55
|
- lib/teaas/spin.rb
|
54
56
|
- lib/teaas/turboize.rb
|
55
57
|
- teaas.gemspec
|