teaas 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e881463c35ff5a40a172a85494f34ed1825f5e7
4
- data.tar.gz: 1640619a6f1fa74fc9065c3575c28bc69cc08c54
3
+ metadata.gz: 3098f05416cee548414bbf1641777a458c11972f
4
+ data.tar.gz: c147b163841ff68b6801aff1050abf8806d8caea
5
5
  SHA512:
6
- metadata.gz: b825bf9b0a945669e93102ee7d9cd365bd558eb2778679a788d405b7da1161d8b373fb018612519abc5f85654f31e8668488a6a7969f68b7cfe048ff4c085793
7
- data.tar.gz: 8a133564f2c2edc087cb982d3f6705bd8e9abe8fb0fddb79edbe63cf5c8bdd0fa4632f5c323bad955644b00f2e814ba91917acdb7211541fcf021770a153eff6
6
+ metadata.gz: 2e7e7e26b71e1edd77ad559dd8a842cabfd2cd71dc905fb1d309046269237919b330494db4f0a86745508e66eaf986c90069c00a42e8dab1566a4c4c41590db1
7
+ data.tar.gz: 44a3083502b2310474dbc3b5ca0d5f8256b0c2b1bb9fa8c619dc7437affdbd09d7c43509bebab7e570e9644bfb140726861514ab71565d4bc42332cd8b3d6ffd
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.2.1
4
+ * Add ability to generate marquee images
5
+
6
+ ## 0.1.0
7
+ * Initial version
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # teaas
2
- ![Build status](https://api.travis-ci.org/wjr1985/teaas.svg?branch=master)
2
+ [![Build Status](https://travis-ci.org/wjr1985/teaas.svg?branch=master)](https://travis-ci.org/wjr1985/teaas) [![Gem Version](https://badge.fury.io/rb/teaas.svg)](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 it spin. This is a very early version, with more features and bug fixes to come in the future.
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
@@ -1,4 +1,5 @@
1
1
  require 'rmagick'
2
2
 
3
+ require 'teaas/marquee.rb'
3
4
  require 'teaas/spin.rb'
4
5
  require 'teaas/turboize.rb'
@@ -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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'teaas'
3
- s.version = '0.1.0'
3
+ s.version = '0.2.1'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "Total Emojis as a Service"
6
6
  s.description = "Gem to manipulate emoji-sized images"
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.0
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: 2015-12-18 00:00:00.000000000 Z
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