Miniparser 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Miniparser.gemspec +1 -1
- data/README.md +6 -6
- data/lib/Miniparser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64601f715d801941ee6a6113ead9476c654aa41f5fbae3e4336138f32318e8f8
|
4
|
+
data.tar.gz: 19e0dd41f8c72315d72c9a06950f2072107f6766a6bc9211e86833cb7a9fd7a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd1689c26d1d5802bf77b560c08d304c678373d23c51f7f3e9b9327596986fa2f7e462e5268d71f6fd7963c7fe7bd6b534894dfcaa27d8e8eef7617e37ef4b64
|
7
|
+
data.tar.gz: a760d475dbf256874c15a009bc61934a5550a583314d9d374af77b70db42f2caa3378a6112dc95e5bf5000b59ddb10b3d3a7d2562b8d197376660e24fb7a6c54
|
data/Miniparser.gemspec
CHANGED
@@ -5,7 +5,7 @@ require_relative 'lib/Miniparser/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'Miniparser'
|
7
7
|
spec.version = Miniparser::VERSION
|
8
|
-
spec.authors = ['
|
8
|
+
spec.authors = ['PixelRidge Softworks']
|
9
9
|
spec.email = ['ceo@pixelatedstudios.net']
|
10
10
|
|
11
11
|
spec.summary = 'A Gem for Validating and Minifying HTML, CSS, and JS smartly'
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# Miniparser
|
2
2
|
|
3
|
-
|
3
|
+
Miniparser is a Ruby gem that takes code as input (HTML, JavaScript, or CSS), determines the code language, validates it, and then minifies it. It returns whether the code is valid or not, and if valid, provides the minified code.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem '
|
10
|
+
gem 'Miniparser'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -19,7 +19,7 @@ $ bundle install
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
21
|
```bash
|
22
|
-
$ gem install
|
22
|
+
$ gem install Miniparser
|
23
23
|
```
|
24
24
|
|
25
25
|
## Usage
|
@@ -31,7 +31,7 @@ Miniparse provides two main methods to process either a file or a string contain
|
|
31
31
|
You can process a file by calling the `type_file` method and passing the file path as an argument:
|
32
32
|
|
33
33
|
```ruby
|
34
|
-
result =
|
34
|
+
result = Miniparser::Processor.type_file('path/to/yourfile.html')
|
35
35
|
```
|
36
36
|
|
37
37
|
### Processing a String
|
@@ -39,7 +39,7 @@ result = Miniparse::Processor.type_file('path/to/yourfile.html')
|
|
39
39
|
You can process a string containing code by calling the `type_string` method:
|
40
40
|
|
41
41
|
```ruby
|
42
|
-
result =
|
42
|
+
result = Miniparser::Processor.type_string('<html><head></head><body></body></html>')
|
43
43
|
```
|
44
44
|
|
45
45
|
Both methods return a hash containing the validation status, any errors, and the minified code if the input was valid:
|
data/lib/Miniparser/version.rb
CHANGED
metadata
CHANGED