uri_parser 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.md +42 -0
- data/lib/uri_parser/version.rb +1 -1
- metadata +7 -5
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 SEOmoz
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# URIParser
|
2
|
+
|
3
|
+
## What?
|
4
|
+
|
5
|
+
This is a very simple native gem to Google's
|
6
|
+
[chromium URL canonicalization library](http://code.google.com/p/google-url/).
|
7
|
+
Google's code is is BSD-licensed.
|
8
|
+
|
9
|
+
This gem requires the ICU library. Under Linux (Ubuntu) the proper
|
10
|
+
version may be installed via apt-get (e.g. `apt-get install libicu40`).
|
11
|
+
Under Mac OSX it may be installed with homebrew (e.g. `brew install icu4c`).
|
12
|
+
|
13
|
+
## Why?
|
14
|
+
|
15
|
+
[Addressable](http://addressable.rubyforge.org/) provides the same
|
16
|
+
functionality (and more!) but is slow. This gem is much faster.
|
17
|
+
|
18
|
+
## Example
|
19
|
+
|
20
|
+
require 'uri_parser'
|
21
|
+
|
22
|
+
noncan = 'http://руцентр.рф/Iñtërnâtiônàlizætiøn!?i18n=true'
|
23
|
+
url = URIParser.new(noncan)
|
24
|
+
puts <<TO_THE_END
|
25
|
+
non-canonicalized: #{noncan}
|
26
|
+
canonicalized: #{url.uri}
|
27
|
+
scheme: #{url.scheme}
|
28
|
+
host: #{url.host}
|
29
|
+
port: #{url.port}
|
30
|
+
path: #{url.path}
|
31
|
+
query: #{url.query}
|
32
|
+
valid: #{url.valid?}
|
33
|
+
TO_THE_END
|
34
|
+
|
35
|
+
__Note__: If a URL is marked as invalid then the state/value of any of its other properties is undefined.
|
36
|
+
|
37
|
+
## Copyright
|
38
|
+
|
39
|
+
Copyright 2011 SEOmoz. See LICENSE for details.
|
40
|
+
|
41
|
+
google-url is copyright Google.
|
42
|
+
|
data/lib/uri_parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uri_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ default_executable:
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
18
|
-
requirement: &
|
18
|
+
requirement: &2168917780 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '2.5'
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *2168917780
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake-compiler
|
29
|
-
requirement: &
|
29
|
+
requirement: &2168917320 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: 0.7.6
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *2168917320
|
38
38
|
description: Parses and normalizes URIs very quickly, using Google's URI canonicalization
|
39
39
|
library
|
40
40
|
email:
|
@@ -47,6 +47,8 @@ files:
|
|
47
47
|
- .gitignore
|
48
48
|
- .rvmrc
|
49
49
|
- Gemfile
|
50
|
+
- LICENSE
|
51
|
+
- README.md
|
50
52
|
- Rakefile
|
51
53
|
- ext/uri_parser/basictypes.h
|
52
54
|
- ext/uri_parser/extconf.h
|