Skip to content

Commit

Permalink
Version 1.1.0 RC 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Taritsyn committed Mar 26, 2016
1 parent 3f609fd commit 3ddee85
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 24 deletions.
2 changes: 1 addition & 1 deletion NuGet/DouglasCrockford.JsMin.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>DouglasCrockford.JsMin</id>
<version>1.0.1-rc1</version>
<version>1.1.0-rc1</version>
<title>JSMin for .Net</title>
<authors>Andrey Taritsyn</authors>
<owners>Andrey Taritsyn</owners>
Expand Down
2 changes: 1 addition & 1 deletion NuGet/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


----------------------------------------------------------------------
README file for JSMin for .Net v1.0.1 RC 1
README file for JSMin for .Net v1.1.0 RC 1

----------------------------------------------------------------------

Expand Down
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,54 @@
JSMin for .Net
==============

A .NET port of the [Douglas Crockford's JSMin](http://github.com/douglascrockford/JSMin).
JSMin.NET is a .NET port of the [Douglas Crockford's JSMin](http://github.com/douglascrockford/JSMin).

#Installation
## Installation
This library can be installed through NuGet - [http://nuget.org/packages/DouglasCrockford.JsMin](http://nuget.org/packages/DouglasCrockford.JsMin).

# License
[Douglas Crockford's License](https://github.com/Taritsyn/JSMin.NET/blob/master/LICENSE)
## Usage
Consider a simple example of usage of the JSMin.NET:

```csharp
using System;

using DouglasCrockford.JsMin;

namespace TestJsMinDotNet
{
class Program
{
static void Main(string[] args)
{
const string code = @"function square(num) {
return num * num;
}";
var minifier = new JsMinifier();

try
{
string result = minifier.Minify(code);

Console.WriteLine("Result of JavaScript minification:");
Console.WriteLine();
Console.WriteLine(result);
}
catch (JsMinificationException e)
{
Console.WriteLine("During minification of JavaScript code an error occurred:");
Console.WriteLine();
Console.WriteLine(e.Message);
}

Console.ReadLine();
}
}
}
```

First we create an instance of the <code title="DouglasCrockford.JsMin.JsMinifier">JsMinifier</code> class.
Then we minify a JavaScript code by using of the `Minify` method and output its result to the console.
In addition, we provide handling of the <code title="DouglasCrockford.JsMin.JsMinificationException">JsMinificationException</code> exception.

## License
[Douglas Crockford's License](https://github.com/Taritsyn/JSMin.NET/blob/master/LICENSE)
10 changes: 5 additions & 5 deletions src/DouglasCrockford.JsMin/JsMinificationException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
public sealed class JsMinificationException : Exception
{
/// <summary>
/// Initializes a new instance of the DouglasCrockford.JsMin.JsMinificationException
/// class with a specified error message
/// Initializes a new instance of the <see cref="JsMinificationException"/> class
/// with a specified error message
/// </summary>
/// <param name="message">The message that describes the error</param>
public JsMinificationException(string message)
: base(message)
{ }

/// <summary>
/// Initializes a new instance of the DouglasCrockford.JsMin.JsMinificationException
/// class with a specified error message and a reference to the inner exception that is the cause of
/// this exception
/// Initializes a new instance of the <see cref="JsMinificationException"/> class
/// with a specified error message and a reference to the inner exception that is
/// the cause of this exception
/// </summary>
/// <param name="message">The error message that explains the reason for the exception</param>
/// <param name="innerException">The exception that is the cause of the current exception</param>
Expand Down
12 changes: 6 additions & 6 deletions src/DouglasCrockford.JsMin/JsMinifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ namespace DouglasCrockford.JsMin
/// <summary>
/// The JavaScript Minifier
/// </summary>
public sealed class JsMinifier
{
const int EOF = -1;
public sealed class JsMinifier
{
const int EOF = -1;

private StringReader _reader;
private StringWriter _writer;

private int _theA;
private int _theA;
private int _theB;
private int _theLookahead = EOF;
private int _theX = EOF;
Expand Down Expand Up @@ -413,8 +413,8 @@ private void InnerMinify()
/// </summary>
/// <param name="c">The character</param>
private void Put(int c)
{
_writer.Write((char)c);
{
_writer.Write((char)c);
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions src/DouglasCrockford.JsMin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: Guid("0d7b205c-e3d6-4756-9977-29a71052536b")]
#endif

[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
2 changes: 1 addition & 1 deletion src/DouglasCrockford.JsMin/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1-rc1",
"version": "1.1.0-rc1",
"description": "",
"authors": [ "" ],
"tags": [ "" ],
Expand Down
4 changes: 2 additions & 2 deletions test/DouglasCrockford.JsMin.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: Guid("72947ee4-f2b3-42e9-a84b-9a4a5254e974")]
#endif

[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
4 changes: 2 additions & 2 deletions test/DouglasCrockford.JsMin.Test/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1-rc1",
"version": "1.1.0-rc1",
"description": "",
"authors": [ "" ],
"tags": [ "" ],
Expand All @@ -13,7 +13,7 @@
"dependencies": {
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-rc1-build204",
"DouglasCrockford.JsMin": "1.0.1-rc1"
"DouglasCrockford.JsMin": "1.1.0-rc1"
},

"commands": {
Expand Down

0 comments on commit 3ddee85

Please sign in to comment.