Skip to content

Commit 3ddee85

Browse files
committed
Version 1.1.0 RC 1
1 parent 3f609fd commit 3ddee85

9 files changed

Lines changed: 68 additions & 24 deletions

File tree

NuGet/DouglasCrockford.JsMin.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>DouglasCrockford.JsMin</id>
5-
<version>1.0.1-rc1</version>
5+
<version>1.1.0-rc1</version>
66
<title>JSMin for .Net</title>
77
<authors>Andrey Taritsyn</authors>
88
<owners>Andrey Taritsyn</owners>

NuGet/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
----------------------------------------------------------------------
4-
README file for JSMin for .Net v1.0.1 RC 1
4+
README file for JSMin for .Net v1.1.0 RC 1
55

66
----------------------------------------------------------------------
77

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,54 @@
11
JSMin for .Net
22
==============
33

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

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

9-
# License
10-
[Douglas Crockford's License](https://github.com/Taritsyn/JSMin.NET/blob/master/LICENSE)
9+
## Usage
10+
Consider a simple example of usage of the JSMin.NET:
11+
12+
```csharp
13+
using System;
14+
15+
using DouglasCrockford.JsMin;
16+
17+
namespace TestJsMinDotNet
18+
{
19+
class Program
20+
{
21+
static void Main(string[] args)
22+
{
23+
const string code = @"function square(num) {
24+
return num * num;
25+
}";
26+
var minifier = new JsMinifier();
27+
28+
try
29+
{
30+
string result = minifier.Minify(code);
31+
32+
Console.WriteLine("Result of JavaScript minification:");
33+
Console.WriteLine();
34+
Console.WriteLine(result);
35+
}
36+
catch (JsMinificationException e)
37+
{
38+
Console.WriteLine("During minification of JavaScript code an error occurred:");
39+
Console.WriteLine();
40+
Console.WriteLine(e.Message);
41+
}
42+
43+
Console.ReadLine();
44+
}
45+
}
46+
}
47+
```
48+
49+
First we create an instance of the <code title="DouglasCrockford.JsMin.JsMinifier">JsMinifier</code> class.
50+
Then we minify a JavaScript code by using of the `Minify` method and output its result to the console.
51+
In addition, we provide handling of the <code title="DouglasCrockford.JsMin.JsMinificationException">JsMinificationException</code> exception.
52+
53+
## License
54+
[Douglas Crockford's License](https://github.com/Taritsyn/JSMin.NET/blob/master/LICENSE)

src/DouglasCrockford.JsMin/JsMinificationException.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
public sealed class JsMinificationException : Exception
99
{
1010
/// <summary>
11-
/// Initializes a new instance of the DouglasCrockford.JsMin.JsMinificationException
12-
/// class with a specified error message
11+
/// Initializes a new instance of the <see cref="JsMinificationException"/> class
12+
/// with a specified error message
1313
/// </summary>
1414
/// <param name="message">The message that describes the error</param>
1515
public JsMinificationException(string message)
1616
: base(message)
1717
{ }
1818

1919
/// <summary>
20-
/// Initializes a new instance of the DouglasCrockford.JsMin.JsMinificationException
21-
/// class with a specified error message and a reference to the inner exception that is the cause of
22-
/// this exception
20+
/// Initializes a new instance of the <see cref="JsMinificationException"/> class
21+
/// with a specified error message and a reference to the inner exception that is
22+
/// the cause of this exception
2323
/// </summary>
2424
/// <param name="message">The error message that explains the reason for the exception</param>
2525
/// <param name="innerException">The exception that is the cause of the current exception</param>

src/DouglasCrockford.JsMin/JsMinifier.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ namespace DouglasCrockford.JsMin
3636
/// <summary>
3737
/// The JavaScript Minifier
3838
/// </summary>
39-
public sealed class JsMinifier
40-
{
41-
const int EOF = -1;
39+
public sealed class JsMinifier
40+
{
41+
const int EOF = -1;
4242

4343
private StringReader _reader;
4444
private StringWriter _writer;
4545

46-
private int _theA;
46+
private int _theA;
4747
private int _theB;
4848
private int _theLookahead = EOF;
4949
private int _theX = EOF;
@@ -413,8 +413,8 @@ private void InnerMinify()
413413
/// </summary>
414414
/// <param name="c">The character</param>
415415
private void Put(int c)
416-
{
417-
_writer.Write((char)c);
416+
{
417+
_writer.Write((char)c);
418418
}
419419

420420
#endregion

src/DouglasCrockford.JsMin/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
[assembly: Guid("0d7b205c-e3d6-4756-9977-29a71052536b")]
1616
#endif
1717

18-
[assembly: AssemblyVersion("1.0.1.0")]
19-
[assembly: AssemblyFileVersion("1.0.1.0")]
18+
[assembly: AssemblyVersion("1.1.0.0")]
19+
[assembly: AssemblyFileVersion("1.1.0.0")]

src/DouglasCrockford.JsMin/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.0.1-rc1",
2+
"version": "1.1.0-rc1",
33
"description": "",
44
"authors": [ "" ],
55
"tags": [ "" ],

test/DouglasCrockford.JsMin.Test/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
[assembly: Guid("72947ee4-f2b3-42e9-a84b-9a4a5254e974")]
1616
#endif
1717

18-
[assembly: AssemblyVersion("1.0.1.0")]
19-
[assembly: AssemblyFileVersion("1.0.1.0")]
18+
[assembly: AssemblyVersion("1.1.0.0")]
19+
[assembly: AssemblyFileVersion("1.1.0.0")]

test/DouglasCrockford.JsMin.Test/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.0.1-rc1",
2+
"version": "1.1.0-rc1",
33
"description": "",
44
"authors": [ "" ],
55
"tags": [ "" ],
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"xunit": "2.1.0",
1515
"xunit.runner.dnx": "2.1.0-rc1-build204",
16-
"DouglasCrockford.JsMin": "1.0.1-rc1"
16+
"DouglasCrockford.JsMin": "1.1.0-rc1"
1717
},
1818

1919
"commands": {

0 commit comments

Comments
 (0)