Sha256: a0cd5944dece6b8a139ab17733244ebbf1b1da932aad58d9dcd37d8233fe7165

Contents?: true

Size: 606 Bytes

Versions: 25

Compression:

Stored size: 606 Bytes

Contents

require 'rails/generators'

class SimpleCaptchaGenerator < Rails::Generators::Base
  include Rails::Generators::Migration
                          
  def self.source_root
    @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates/'))
  end

  def self.next_migration_number(dirname)
    Time.now.strftime("%Y%m%d%H%M%S")
  end
  
  def create_partial
    template "partial.erb", File.join('app/views', 'simple_captcha', "_simple_captcha.erb")
  end
  
  def create_migration
    migration_template "migration.rb", File.join('db/migrate', "create_simple_captcha_data.rb")
  end
end

Version data entries

25 entries across 25 versions & 12 rubygems

Version Path
soaring_simple_captcha-0.1.6 lib/generators/simple_captcha_generator.rb
simple_captcha2-0.2.2 lib/generators/simple_captcha_generator.rb
simple_captcha2-0.2.1 lib/generators/simple_captcha_generator.rb
simple_captcha2-0.2.0 lib/generators/simple_captcha_generator.rb
wxianfeng_simple_captcha-0.5.0 lib/generators/simple_captcha_generator.rb
pludoni-simple_captcha-0.1.6 lib/generators/simple_captcha_generator.rb
wxianfeng_simple_captcha-0.4.0 lib/generators/simple_captcha_generator.rb
wxianfeng_simple_captcha-0.3.0 lib/generators/simple_captcha_generator.rb
galetahub-simple_captcha-0.1.5 lib/generators/simple_captcha_generator.rb
galetahub-simple_captcha-0.1.4 lib/generators/simple_captcha_generator.rb
loyal_simple_captcha-0.0.1 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.2.1 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.2.0 lib/generators/simple_captcha_generator.rb
foco-simple_captcha-0.1.3 lib/generators/simple_captcha_generator.rb
nahaylo-simple_captcha-0.2.0 lib/generators/simple_captcha_generator.rb
the_captcha-0.1.3 lib/generators/simple_captcha_generator.rb
the_captcha-0.1.1 lib/generators/simple_captcha_generator.rb
the_captcha-0.1.0 lib/generators/simple_captcha_generator.rb
wxianfeng_simple_captcha-0.2.0 lib/generators/simple_captcha_generator.rb
wxianfeng_simple_captcha-0.1.0 lib/generators/simple_captcha_generator.rb