Sha256: 20d1af3b5ad56db54d843d1ef62a74300036b0502b441ccc13cff83999241adb

Contents?: true

Size: 854 Bytes

Versions: 1

Compression:

Stored size: 854 Bytes

Contents

module Rails::Assist
  module View
    module FileName    
      def view_file_name folder, action=nil, type=nil
        File.join(view_dir, folder.to_s, "#{get_action action}.#{get_type type}")
      end        
    end
  end

  module Migration
    module FileName
      def migration_file_name name, options={}
        number = options[:number]      
        number = next_migration_number(migration_dir) if !number      
        File.join(migration_dir, "#{number}_#{name}.rb")      
      end
    end
  end 
  
  (Rails::Assist.artifacts. - [:migration, :view]).each do |name|
    class_eval %{
      module #{name.to_s.camelize}
        module FileName
        
          def #{name}_file_name name, options=nil
            artifact_path name, :#{name}
          end        
        end
        
        include FileName
      end
    }
  end
end  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails3_assist-0.2.2 lib/rails3_assist/app/file_names.rb