diff --git a/Gemfile b/Gemfile index 5e3e2c7..9de7973 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,5 @@ source "http://rubygems.org" # Specify your gem's dependencies in traptcha.gemspec gemspec + +gem "rails", "~> 3.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index 651ccfc..fed244a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,10 +17,15 @@ GEM rspec-expectations (2.5.0) diff-lcs (~> 1.1.2) rspec-mocks (2.5.0) + thor (0.14.6) + treetop (1.4.9) + polyglot (>= 0.3.1) + tzinfo (0.3.24) PLATFORMS ruby DEPENDENCIES + rails (~> 3.0.0) rspec (~> 2.5.0) traptcha! diff --git a/lib/traptcha.rb b/lib/traptcha.rb index 7664525..2b72144 100644 --- a/lib/traptcha.rb +++ b/lib/traptcha.rb @@ -20,6 +20,11 @@ def default_wave_amplitude=(amplitude) @@default_wave_amplitude = amplitude end end + mattr_accessor :default_wave_variation + @@default_wave_variation = (20..90) + + mattr_accessor :default_wave_amplitude + @@default_wave_amplitude = 5 def self.setup yield self diff --git a/lib/traptcha/image.rb b/lib/traptcha/image.rb index 3c6fe52..39cf103 100644 --- a/lib/traptcha/image.rb +++ b/lib/traptcha/image.rb @@ -1,5 +1,7 @@ module Traptcha class Image + delegate :to_png, :to => :output + def initialize(text, options = {}) @text = text @canvas = Magick::Image.new(150, 100)