<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Cassette.BundleProcessing;
using Cassette.Configuration;
using Cassette.Manifests;
using Cassette.Utilities;

namespace Cassette
{
    [System.Diagnostics.DebuggerDisplay("{Path}")]
    public abstract class Bundle : IDisposable
    {
        readonly string path;
        readonly List<IAsset> assets = new List<IAsset>();
        readonly HashSet<string> references = new HashSet<string>();
        readonly HtmlAttributeDictionary htmlAttributes = new HtmlAttributeDictionary();

        protected Bundle(string applicationRelativePath)
        {
            if (applicationRelativePath == null) throw new ArgumentNullException("applicationRelativePath");
            path = PathUtilities.AppRelative(applicationRelativePath);
        }

        protected Bundle()
        {
            // Protected constructor to allow InlineScriptBundle to be created without a path.
        }

        /// <summary>
        /// The application relative path of the bundle.
        /// </summary>
        public string Path
        {
            get { return path; }
        }

        /// <summary>
        /// The value sent in the HTTP Content-Type header.
        /// </summary>
        public string ContentType { get; set; }

        /// <summary>
        /// Defines where to render this bundle in an HTML page.
        /// </summary>
        public string PageLocation { get; set; }

        /// <summary>
        /// Attributes to include with the rendered element.
        /// </summary>
        public HtmlAttributeDictionary HtmlAttributes
        {
            get { return htmlAttributes; }
        }

        /// <summary>
        /// The assets contained in the bundle.
        /// </summary>
        public IList<IAsset> Assets
        {
            get { return assets; }
        }

        /// <summary>
        /// Gets the hash of the combined assets.
        /// </summary>
        public byte[] Hash { get; internal set; }

        internal virtual string Url
        {
            get
            {
                var pathWithoutPrefix = path.TrimStart('~', '/');
                return UrlBundleTypeArgument + "/" + pathWithoutPrefix + "_" + Hash.ToHexString();
            }
        }

        protected abstract string UrlBundleTypeArgument { get; }

        internal IEnumerable<string> References
        {
            get { return references; }
        }

        internal bool IsSorted { get; set; }

        /// <summary>
        /// Opens a readable stream of the contained assets content.<commit_msg>Member doesn't need to be virtual<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Cassette.BundleProcessing;
using Cassette.Configuration;
using Cassette.Manifests;
using Cassette.Utilities;

namespace Cassette
{
    [System.Diagnostics.DebuggerDisplay("{Path}")]
    public abstract class Bundle : IDisposable
    {
        readonly string path;
        readonly List<IAsset> assets = new List<IAsset>();
        readonly HashSet<string> references = new HashSet<string>();
        readonly HtmlAttributeDictionary htmlAttributes = new HtmlAttributeDictionary();

        protected Bundle(string applicationRelativePath)
        {
            if (applicationRelativePath == null) throw new ArgumentNullException("applicationRelativePath");
            path = PathUtilities.AppRelative(applicationRelativePath);
        }

        protected Bundle()
        {
            // Protected constructor to allow InlineScriptBundle to be created without a path.
        }

        /// <summary>
        /// The application relative path of the bundle.
        /// </summary>
        public string Path
        {
            get { return path; }
        }

        /// <summary>
        /// The value sent in the HTTP Content-Type header.
        /// </summary>
        public string ContentType { get; set; }

        /// <summary>
        /// Defines where to render this bundle in an HTML page.
        /// </summary>
        public string PageLocation { get; set; }

        /// <summary>
        /// Attributes to include with the rendered element.
        /// </summary>
        public HtmlAttributeDictionary HtmlAttributes
        {
            get { return htmlAttributes; }
        }

        /// <summary>
        /// The assets contained in the bundle.
        /// </summary>
        public IList<IAsset> Assets
        {
            get { return assets; }
        }

        /// <summary>
        /// Gets the hash of the combined assets.
        /// </summary>
        public byte[] Hash { get; internal set; }

        internal string Url
        {
            get
            {
                var pathWithoutPrefix = path.TrimStart('~', '/');
                return UrlBundleTypeArgument + "/" + pathWithoutPrefix + "_" + Hash.ToHexString();
            }
        }

        protected abstract string UrlBundleTypeArgument { get; }

        internal IEnumerable<string> References
        {
            get { return references; }
        }

        internal bool IsSorted { get; set; }

        /// <summary>
        /// Opens a readable stream of the contained assets content.
{'fraction_non_alphanumeric': 0.09616843702579667, 'fraction_numerical': 0.0, 'mean_word_length': 1.8122666666666667, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7450002', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1250, 'n_words': 393}