knjrbfw 0.0.108 → 0.0.109

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +44 -40
  3. data/VERSION +1 -1
  4. data/knjrbfw.gemspec +2 -2
  5. data/lib/knj/image.rb +10 -20
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b19b926826add664c845b960ce172198b502d8b
4
- data.tar.gz: 06d3ab0641bbefa2a0dedb56587497f11a511686
3
+ metadata.gz: d06f3b8fb5858475c706b0e96d0ea84aaaee46b3
4
+ data.tar.gz: cb0362507a02efffa70730b48f54d22359a1b08b
5
5
  SHA512:
6
- metadata.gz: afeff1d41ed9a026ef1d5419a37ba0e3acd2c20d52fc894805925ebdedc0c99b8aa6c06a670288a456eab7f3068b01eb8470cfec4352b6602b2a246b00ddd1c8
7
- data.tar.gz: f2e7ae49da2500a796be52c9a552dde8997a3da7242a163feb4f192e02898e3fbfa3a3b2fc244eae52122e6a65099436abed90d93c8eda4d557e862d6ac9e572
6
+ metadata.gz: 917af3f60ef434040379f871279a53914242397bb03b124d185e4638a6f96cbe01e9fb9031d8ca00947d95c4d0067f9d55022bcf51cfff36f5fd2589b7bdcf7a
7
+ data.tar.gz: 971453c478c195c3d79876293050aed6c1883d26b12b0061a74650e60c760e61e6d5b17cf4897f947d4ec44dab0172a6867115713caebbec81faa4b30dde9697
@@ -1,46 +1,49 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.3.5)
4
+ addressable (2.3.6)
5
5
  array_enumerator (0.0.3)
6
6
  builder (3.2.2)
7
7
  datet (0.0.25)
8
- diff-lcs (1.2.4)
9
- faraday (0.8.7)
10
- multipart-post (~> 1.1)
11
- git (1.2.5)
12
- github_api (0.10.1)
13
- addressable
14
- faraday (~> 0.8.1)
8
+ descendants_tracker (0.0.4)
9
+ thread_safe (~> 0.3, >= 0.3.1)
10
+ diff-lcs (1.2.5)
11
+ faraday (0.9.0)
12
+ multipart-post (>= 1.2, < 3)
13
+ git (1.2.6)
14
+ github_api (0.11.3)
15
+ addressable (~> 2.3)
16
+ descendants_tracker (~> 0.0.1)
17
+ faraday (~> 0.8, < 0.10)
15
18
  hashie (>= 1.2)
16
- multi_json (~> 1.4)
17
- nokogiri (~> 1.5.2)
19
+ multi_json (>= 1.7.5, < 2.0)
20
+ nokogiri (~> 1.6.0)
18
21
  oauth2
19
- hashie (2.0.5)
20
- highline (1.6.19)
21
- http2 (0.0.22)
22
- httpauth (0.2.0)
23
- jeweler (1.8.5)
22
+ hashie (2.1.1)
23
+ highline (1.6.21)
24
+ http2 (0.0.23)
25
+ jeweler (2.0.1)
24
26
  builder
25
- bundler (~> 1.0)
27
+ bundler (>= 1.0)
26
28
  git (>= 1.2.5)
27
- github_api (>= 0.8.1)
29
+ github_api
28
30
  highline (>= 1.6.15)
29
- nokogiri (= 1.5.10)
31
+ nokogiri (>= 1.5.10)
30
32
  rake
31
33
  rdoc
32
- json (1.8.0)
33
- jwt (0.1.8)
34
+ json (1.8.1)
35
+ jwt (0.1.11)
34
36
  multi_json (>= 1.5)
35
- multi_json (1.7.7)
36
- multi_xml (0.5.4)
37
- multipart-post (1.2.0)
38
- nokogiri (1.5.10)
39
- oauth2 (0.9.2)
40
- faraday (~> 0.8)
41
- httpauth (~> 0.2)
42
- jwt (~> 0.1.4)
43
- multi_json (~> 1.0)
37
+ mini_portile (0.5.3)
38
+ multi_json (1.9.2)
39
+ multi_xml (0.5.5)
40
+ multipart-post (2.0.0)
41
+ nokogiri (1.6.1)
42
+ mini_portile (~> 0.5.0)
43
+ oauth2 (0.9.3)
44
+ faraday (>= 0.8, < 0.10)
45
+ jwt (~> 0.1.8)
46
+ multi_json (~> 1.3)
44
47
  multi_xml (~> 0.5)
45
48
  rack (~> 1.2)
46
49
  php4r (0.0.4)
@@ -48,23 +51,24 @@ GEM
48
51
  http2
49
52
  string-strtr
50
53
  rack (1.5.2)
51
- rake (10.1.0)
52
- rdoc (4.0.1)
54
+ rake (10.2.2)
55
+ rdoc (4.1.1)
53
56
  json (~> 1.4)
54
57
  rmagick (2.13.2)
55
- rspec (2.13.0)
56
- rspec-core (~> 2.13.0)
57
- rspec-expectations (~> 2.13.0)
58
- rspec-mocks (~> 2.13.0)
59
- rspec-core (2.13.1)
60
- rspec-expectations (2.13.0)
58
+ rspec (2.14.1)
59
+ rspec-core (~> 2.14.0)
60
+ rspec-expectations (~> 2.14.0)
61
+ rspec-mocks (~> 2.14.0)
62
+ rspec-core (2.14.8)
63
+ rspec-expectations (2.14.5)
61
64
  diff-lcs (>= 1.1.3, < 2.0)
62
- rspec-mocks (2.13.1)
63
- ruby_process (0.0.8)
65
+ rspec-mocks (2.14.6)
66
+ ruby_process (0.0.9)
64
67
  tsafe
65
68
  wref
66
- sqlite3 (1.3.7)
69
+ sqlite3 (1.3.9)
67
70
  string-strtr (0.0.3)
71
+ thread_safe (0.3.3)
68
72
  tsafe (0.0.11)
69
73
  wref (0.0.6)
70
74
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.108
1
+ 0.0.109
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "knjrbfw"
8
- s.version = "0.0.108"
8
+ s.version = "0.0.109"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = "2014-04-06"
12
+ s.date = "2014-04-13"
13
13
  s.description = "Including stuff for HTTP, SSH and much more."
14
14
  s.email = "k@spernj.org"
15
15
  s.extra_rdoc_files = [
@@ -11,9 +11,10 @@ class Knj::Image
11
11
  # )
12
12
  def self.rounded_corners(args)
13
13
  raise "No or invalid ':img' given: '#{args}'." if !args[:img]
14
- raise "No or invalid ':radius' given: '#{args}'." if !args[:radius].respond_to?("to_i") or args[:radius].to_i <= 0
14
+ raise "No or invalid ':radius' given: '#{args}'." if !args[:radius].respond_to?(:to_i) || args[:radius].to_i <= 0
15
15
 
16
16
  pic = args[:img]
17
+ raise "Format '#{pic.format}' does not support transparency." if pic.format == "JPEG"
17
18
 
18
19
  r = args[:radius].to_i
19
20
  r_half = r / 2
@@ -25,12 +26,12 @@ class Knj::Image
25
26
 
26
27
  coords = {}
27
28
  0.upto(r) do |x|
28
- y = center_y + Math.sqrt(r2 - ((x - center_x) * (x - center_x)))
29
+ y = center_y + ::Math.sqrt(r2 - ((x - center_x) * (x - center_x)))
29
30
  coords[x] = y.to_i
30
31
  end
31
32
 
32
33
  if args[:border]
33
- draw = Magick::Draw.new
34
+ draw = ::Magick::Draw.new
34
35
  draw.stroke(args[:border_color])
35
36
  draw.stroke_width(1)
36
37
 
@@ -100,22 +101,11 @@ class Knj::Image
100
101
 
101
102
  next if y_to <= 0
102
103
 
103
- #Make corners transparent.
104
- if false or RUBY_ENGINE == "jruby"
105
- #Make up for the fact that "get_pixels" has not been implemented in "rmagick4j"...
106
- pixels = []
107
- 0.upto(y_to) do |count|
108
- pixels << Magick::Pixel.new(0, 0, 0, 255)
109
- end
110
-
111
- pic.store_pixels(x_from, y_from, 1, y_to, pixels)
112
- else
113
- pixels = pic.get_pixels(x_from, y_from, 1, y_to)
114
- pixels.each do |pixel|
115
- pixel.opacity = Magick::TransparentOpacity
116
- end
117
- pic.store_pixels(x_from, y_from, 1, y_to, pixels)
104
+ pixels = pic.get_pixels(x_from, y_from, 1, y_to)
105
+ pixels.each do |pixel|
106
+ pixel.opacity = ::Magick::TransparentOpacity
118
107
  end
108
+ pic.store_pixels(x_from, y_from, 1, y_to, pixels)
119
109
  end
120
110
  end
121
111
 
@@ -137,9 +127,9 @@ class Knj::Image
137
127
  b = color[3, 2].hex
138
128
  g = color[5, 2].hex
139
129
 
140
- pixel = Magick::Pixel.new(r, b, g)
130
+ pixel = ::Magick::Pixel.new(r, b, g)
141
131
  else
142
- pixel = Magick::Pixel.from_color(color)
132
+ pixel = ::Magick::Pixel.from_color(color)
143
133
  end
144
134
 
145
135
  if border.key?(:x)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knjrbfw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.108
4
+ version: 0.0.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2014-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wref