spider_monkey 0.0.9 → 0.0.10

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: fd32802210106d9c28c4f0eb079adfe1e236c94c
4
- data.tar.gz: 018aedf3c3a34db53a88167f517d1a5052cad057
3
+ metadata.gz: c3f0d702fe34a0355afdf858ddbea9baa354c33f
4
+ data.tar.gz: c4a6fe3a87db344b2a259360e5cc94a79480decb
5
5
  SHA512:
6
- metadata.gz: 02238a6fc9e400341c952253ae7ae0163db81e63755ff5ef1373a13586a680c83d7d0630bab14b596e4fb1196322ecb05831497bf1145fa03ded3153a7358f6c
7
- data.tar.gz: 53ce4fadf8c96b6afc93705f7b550167a73ae89ce4b7769e7dab8e1f583219c083d63a6ee11afccd7406a1be11ff63c8749653dc3f6aea1e7a7082e31e5aab3c
6
+ metadata.gz: 66cd06f2c149eb8e7d61a22c34888b5b084edd7d72c0d834b41b4347aa9181c4893035484b731c2fdf028f3b09fb11f927463cbab336aa75deaf896ce12f79dc
7
+ data.tar.gz: 0ebc3fa6f4181bbdef4ccb337a60cf5ee1300af5d8b49157a6a8926de3c506d484e778286825bf53e3e743b6b72d9c9c521191eb8ef80bcab2692f94613a9e39
@@ -51,6 +51,9 @@ module SpiderMonkey
51
51
  validate_option(:colorspace, :colorspace)
52
52
  validate_option(:color, :background_color)
53
53
  validate_option(:string, :template)
54
+ validate_option(:alpha, :alpha)
55
+ validate_option(:integer_like, :frame)
56
+
54
57
 
55
58
  # Merge Variables
56
59
  @valid_options[:template_merge_variables] = @options[:template_merge_variables] if @options[:template_merge_variables]
@@ -214,6 +217,23 @@ module SpiderMonkey
214
217
  ).include?(input.to_s)
215
218
  end
216
219
 
220
+ def is_alpha?(input)
221
+ %w(
222
+ Activate
223
+ Associate
224
+ Deactivate
225
+ Disassociate
226
+ Set
227
+ Opaque
228
+ Transparent
229
+ Extract
230
+ Copy
231
+ Shape
232
+ Remove
233
+ Background
234
+ ).include?(input.to_s)
235
+ end
236
+
217
237
  def is_percent?(input)
218
238
  # String, with a percent sign, and an integer
219
239
  input.kind_of?(String) && input.include?('%') && is_integer_like?(input.gsub('%', ''))
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "spider_monkey"
3
- s.version = "0.0.9"
3
+ s.version = "0.0.10"
4
4
  s.platform = Gem::Platform::RUBY
5
5
 
6
6
  s.authors = ["Ben McFadden"]
7
- s.date = "2015-11-19"
7
+ s.date = "2016-02-18"
8
8
  s.description = "A gem to simplify generating image URLs for usespidermonkey.com"
9
9
  s.email = "ben@forgeapps.com"
10
10
  s.files = `git ls-files`.split("\n")
@@ -116,6 +116,18 @@ class SpiderMonkeyValidatorTest < Minitest::Test
116
116
  refute validator.is_color?("rgb(blue)")
117
117
  end
118
118
 
119
+ def test_is_alpha?
120
+ validator = SpiderMonkey::Validator.new
121
+
122
+ assert validator.is_alpha?("Background")
123
+ assert validator.is_alpha?("Remove")
124
+
125
+ refute validator.is_alpha?("#asdf")
126
+ refute validator.is_alpha?("asdf")
127
+ refute validator.is_alpha?(nil)
128
+ refute validator.is_alpha?("")
129
+ end
130
+
119
131
  def test_is_gravity?
120
132
  validator = SpiderMonkey::Validator.new
121
133
  gravities = %w(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spider_monkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McFadden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport