Sha256: 0e08a23d3384a08605b29f4ef097d61c6aea6f492effcf2223aa8e43e2cc4152

Contents?: true

Size: 622 Bytes

Versions: 6

Compression:

Stored size: 622 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 create_partial
    template "partial.erb", File.join('app/views', 'simple_captcha', "_simple_captcha.erb")
  end

  unless defined?(Mongoid)
    def self.next_migration_number(dirname)
      Time.now.strftime("%Y%m%d%H%M%S")
    end
    def create_migration
      migration_template "migration.rb", File.join('db/migrate', "create_simple_captcha_data.rb")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
glebtv-simple_captcha-0.6.4 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.6.3 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.6.2 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.6.1 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.6.0 lib/generators/simple_captcha_generator.rb
glebtv-simple_captcha-0.5.2 lib/generators/simple_captcha_generator.rb