Sha256: 95257dcf12dbb2a26720f263dec9c4943292afa6fc8e3c39275470fcdb0b4656

Contents?: true

Size: 1.18 KB

Versions: 14

Compression:

Stored size: 1.18 KB

Contents

module Rails3::Assist::Artifact
  module Directory
    module Methods
      DIR = Rails3::Assist::Directory
      APP_DIR = Rails3::Assist::Directory::App
      
      # :controller, :mailer, :helper, :view, :model, :permit
      #
      # controller_dir, mailer_dir ...
      Rails3::Assist::Artifact.app_artifacts.each do |name|
        class_eval %{
          def #{name}_dir options={}
            File.join(APP_DIR.app_dir(options), '#{name.to_s.pluralize}')
          end
        } 
      end    
        
      # initializer_dir, locale_dir
      # stylesheet_dir, javascript_dir    
      {:config => Rails3::Assist.specials(:config), :public => Rails3::Assist.specials(:public)}.each_pair do |container, names|
        names.each do |name|
          class_eval %{      
            def #{name}_dir options={}
              Rails3::Assist::Directory.#{container}_dir_for :#{name.to_s.pluralize}, options
            end  
          }
        end
      end
      
      def migration_dir options={}
        File.join(DIR.db_dir(options), 'migrations')
      end
      
      def observer_dir options={}
        model_dir options
      end
    end

    extend Methods
    include Methods
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rails3_assist-0.3.7 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.6 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.5 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.4 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.3 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.2 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.1 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.3.0 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.2.13 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.2.12 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.2.11 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.2.10 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.2.9 lib/rails3_assist/artifact/directory.rb
rails3_assist-0.2.8 lib/rails3_assist/artifact/directory.rb