Sha256: 75c57ed52e125a471ef8d4a1ee6c695774e925464d23b2a5c534a91dfd6414ea

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

p 1
class ScaffoldActiveSambaLdapGenerator < Rails::Generator::Base
  def manifest
    record do |m|
      m.template("ldap.yml", File.join("config", "ldap.yml"))

      %w(user computer group unix_id_pool idmap ou dc).each do |component|
        m.template("#{component}.rb",
                   File.join("app", "models", "#{component}.rb"))
      end

      component = "samba"
      controller_class_name = "#{component.camelize}Controller"
      options = {:assigns => {:controller_class_name => controller_class_name}}

      m.template("#{component}_controller.rb",
                 File.join("app", "controllers", "#{component}_controller.rb"))
      m.template("#{component}_helper.rb",
                 File.join("app", "helpers", "#{component}_helper.rb"))
      m.directory(File.join("app", "views", component))
      %w(index populate purge).each do |action|
        m.template("#{component}_#{action}.html.erb",
                   File.join("app", "views", component, "#{action}.html.erb"),
                   options)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activesambaldap-0.0.8 rails_generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb