jitimage 0.1.0 → 0.2.0

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/jitimage.gemspec +2 -2
  3. data/lib/jitimage.rb +5 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jitimage}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Chris Sessions", "Seth Engelhard"]
12
- s.date = %q{2009-10-23}
12
+ s.date = %q{2009-10-26}
13
13
  s.description = %q{Jitimage provides on-demand text header images using the font of your choice. On its first request, Jitimage creates the requested header graphic. Then, and on subsequent requests, it returns an html image tag pointing to the header graphic file.}
14
14
  s.email = %q{contact@flying-saucer.net}
15
15
  s.extra_rdoc_files = [
@@ -13,12 +13,15 @@ module Jitimage
13
13
  hash = MD5.new("#{label}#{options.sort {|a, b| a[0].to_s <=> b[0].to_s}.to_s}")
14
14
  path = "#{RAILS_ROOT}/public/#{options[:img_path]}/#{hash}.#{options[:format]}".gsub('//', '/')
15
15
  unless File.exist?(path)
16
+ caption = options[:width] ? "-size #{options[:width]}x caption:'#{label}'" : "label:'#{label}'"
16
17
  `mkdir -p #{"#{RAILS_ROOT}/public/#{options[:img_path]}".gsub('//', '/')}`
17
18
  `convert -background #{options[:background]} -fill "#{options[:color]}" \
18
19
  -font #{Jitimage::Fonts.find(options[:font_dir], options[:font])} \
19
- -pointsize #{options[:size]} -blur 0x.3 label:'#{label}' #{path}`
20
+ -pointsize #{options[:size]} -blur 0x.3 #{caption} #{path}`
20
21
  end
21
- image_tag "/#{options[:img_path]}/#{hash}.#{options[:format]}".gsub('//', '/')
22
+ image_tag "/#{options[:img_path]}/#{hash}.#{options[:format]}".gsub('//', '/'),
23
+ :class => (['jitimage'] << options[:class]).compact.join(' '),
24
+ :alt => label
22
25
  end
23
26
 
24
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jitimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Sessions
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-10-23 00:00:00 -07:00
13
+ date: 2009-10-26 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16