uri-hasparser 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of uri-hasparser might be problematic. Click here for more details.

@@ -0,0 +1,37 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .DS_Store
6
+ .ruby-version
7
+ coverage
8
+ coverage.data
9
+ InstalledFiles
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
17
+
18
+ # bundler
19
+ vendor/
20
+
21
+ # YARD artifacts
22
+ .yardoc
23
+ _yardoc
24
+ doc/
25
+
26
+ # tmp-old
27
+ .old
28
+
29
+ # editor
30
+ *~
31
+ .redcar
32
+
33
+ # other
34
+ *.lock
35
+ *.bak
36
+ tool/
37
+ *\#*
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - ruby-head
5
+ - 1.9.3
6
+ - 1.9.2
7
+ - 1.8.7
8
+ - rbx-19mode
9
+ - rbx-18mode
10
+ - jruby-head
11
+ - jruby-18mode
12
+
13
+ before_install:
14
+ - gem install bundler
@@ -0,0 +1 @@
1
+ --readme README.md lib/**/*.rb
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'rake'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rake'
11
+ end
@@ -0,0 +1,22 @@
1
+ (The MIT X11 License)
2
+
3
+ Copyright (c) 2013 Kenichi Kamiya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,56 @@
1
+ uri-hasparser
2
+ ==============
3
+
4
+ Description
5
+ -----------
6
+
7
+ Quick hack to access URI.escape without warnings on ruby 1.8.7 .. 2.0+
8
+
9
+ Features
10
+ --------
11
+
12
+ * URI.parser
13
+ * URI.parser=
14
+
15
+ Usage
16
+ -----
17
+
18
+ ```ruby
19
+ require 'uri'
20
+ require 'uri/hasparser'
21
+
22
+ URI.parser.escape 'http://example.com'
23
+ ```
24
+
25
+ Requirements
26
+ -------------
27
+
28
+ * Ruby - [1.8.7 or later](http://travis-ci.org/#!/kachick/uri-hasparser)
29
+
30
+ Install
31
+ -------
32
+
33
+ ```bash
34
+ $ gem install uri-hasparser
35
+ ```
36
+
37
+ Build Status
38
+ -------------
39
+
40
+ [![Build Status](https://secure.travis-ci.org/kachick/uri-hasparser.png)](http://travis-ci.org/kachick/uri-hasparser)
41
+
42
+ Link
43
+ ----
44
+
45
+ * [code](https://github.com/kachick/uri-hasparser)
46
+ * [API](http://kachick.github.com/uri-hasparser/yard/frames.html)
47
+ * [issues](https://github.com/kachick/uri-hasparser/issues)
48
+ * [CI](http://travis-ci.org/#!/kachick/uri-hasparser)
49
+ * [gem](https://rubygems.org/gems/uri-hasparser)
50
+
51
+ License
52
+ --------
53
+
54
+ The MIT X11 License
55
+ Copyright (c) 2013 Kenichi Kamiya
56
+ See MIT-LICENSE for further details.
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env rake
2
+ require 'bundler/gem_tasks'
3
+
4
+ require 'rake/testtask'
5
+
6
+ task :default => [:test]
7
+
8
+ Rake::TestTask.new do |testtask|
9
+ testtask.verbose = true
10
+ testtask.warning = true
11
+ end
@@ -0,0 +1,20 @@
1
+ # uri-hasparser
2
+ # Quick hack to access URI perser on recently ruby versions (1.8.7 .. 2.n)
3
+ # Copyright (c) 2013 Kenichi Kamiya
4
+
5
+ module URI
6
+
7
+ module HasParser
8
+
9
+ attr_writer :parser
10
+
11
+ # @return [#parse, #escape, #unescape] a URI parsable object
12
+ def parser
13
+ @parser ||= (::URI.const_defined?(:DEFAULT_PARSER) ? ::URI::DEFAULT_PARSER : ::URI)
14
+ end
15
+
16
+ end
17
+
18
+ extend HasParser
19
+
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'test/unit'
2
+
3
+ require 'uri'
4
+ # Don't use #require_relative for 1.8.7 compatibility :<
5
+ require "#{File.dirname(File.dirname(__FILE__))}/lib/uri/hasparser"
6
+
7
+ class Test_URI_HasParser < Test::Unit::TestCase
8
+
9
+ EXAMPLE_VALID_URL = 'http://example.com'.freeze
10
+
11
+ def test_parser_can_escape_uri
12
+ assert_equal EXAMPLE_VALID_URL.dup, URI.parser.escape(EXAMPLE_VALID_URL.dup)
13
+
14
+ if URI.const_defined? :Parser
15
+ URI.parser = URI::Parser.new
16
+ assert_equal EXAMPLE_VALID_URL.dup, URI.parser.escape(EXAMPLE_VALID_URL.dup)
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.name = 'uri-hasparser'
3
+ gem.version = '0.0.1'
4
+ gem.authors = ['Kenichi Kamiya']
5
+ gem.email = ['kachick1+ruby@gmail.com']
6
+ gem.summary = 'Quick hack to access URI.escape without warnings on ruby 1.8.7 .. 2.0+'
7
+ gem.description = gem.summary.dup
8
+ gem.homepage = 'http://github.com/kachick/uri-hasparser'
9
+
10
+ gem.files = `git ls-files`.split($/)
11
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.require_paths = ['lib']
14
+
15
+ gem.required_ruby_version = '>= 1.8.7'
16
+
17
+ gem.add_development_dependency 'yard', '~> 0.8'
18
+ gem.add_development_dependency 'rake', '>= 9'
19
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: uri-hasparser
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Kenichi Kamiya
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: yard
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '0.8'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.8'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '9'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '9'
46
+ description: Quick hack to access URI.escape without warnings on ruby 1.8.7 .. 2.0+
47
+ email:
48
+ - kachick1+ruby@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - .travis.yml
55
+ - .yardopts
56
+ - Gemfile
57
+ - MIT-LICENSE
58
+ - README.md
59
+ - Rakefile
60
+ - lib/uri/hasparser.rb
61
+ - test/test_uri_hasparser.rb
62
+ - uri-hasparser.gemspec
63
+ homepage: http://github.com/kachick/uri-hasparser
64
+ licenses: []
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: 1.8.7
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 1.8.23
84
+ signing_key:
85
+ specification_version: 3
86
+ summary: Quick hack to access URI.escape without warnings on ruby 1.8.7 .. 2.0+
87
+ test_files:
88
+ - test/test_uri_hasparser.rb
89
+ has_rdoc: