url_tokenizer 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 37632682630861695db478cf47ec0aa8b951e5db
4
+ data.tar.gz: 3936b2f6d08570590e90d65b89e4ffec275494fa
5
+ SHA512:
6
+ metadata.gz: 11e3d98329bf193182bd5ae0d6f2b82c4e7dd21b0f25d719afda01d552e3bad01d6f9a36100c58e18838c16adf561940ad1b7576688afa2c4ab2e14d9ba4dbcf
7
+ data.tar.gz: 520db75d448a1edabe65905dc51180df84b97e0e94755d862156e37a9bf5080fcd1245eed697d94cb9e457d99b79fc7499c3fd6c16cfc6c371f938f1ab9b50b1
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ *.gem
12
+ *.rbc
13
+ .config
14
+ InstalledFiles
15
+ /tags
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,18 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.2
5
+ - 2.1
6
+ - 2.0
7
+ - 1.9.3
8
+ - ruby-head
9
+ - rbx-2
10
+ - jruby-19mode
11
+ - jruby-head
12
+
13
+ matrix:
14
+ allow_failures:
15
+ - rvm: ruby-head
16
+ - rvm: rbx-2
17
+ - rvm: jruby-19mode
18
+ - rvm: jruby-head
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in url_tokenizer.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Alexander Paramonov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,94 @@
1
+ UrlTokenizer
2
+ ================================
3
+ [![Build Status](https://travis-ci.org/AlexParamonov/url_tokenizer.png?branch=master)](https://travis-ci.org/AlexParamonov/url_tokenizer)
4
+ [![Gemnasium Build Status](https://gemnasium.com/AlexParamonov/url_tokenizer.png)](http://gemnasium.com/AlexParamonov/url_tokenizer)
5
+ [![Coverage Status](https://coveralls.io/repos/AlexParamonov/url_tokenizer/badge.png?branch=master)](https://coveralls.io/r/AlexParamonov/url_tokenizer?branch=master)
6
+ [![Gem Version](https://badge.fury.io/rb/url_tokenizer.png)](http://badge.fury.io/rb/url_tokenizer)
7
+ [![Code Climate](https://codeclimate.com/github/AlexParamonov/url_tokenizer.png)](https://codeclimate.com/github/AlexParamonov/url_tokenizer)
8
+
9
+ Tokenize url by variety of providers
10
+
11
+ Contents
12
+ ---------
13
+ 1. Installation
14
+ 1. Requirements
15
+ 1. Contacts
16
+ 1. Compatibility
17
+ 1. Contributing
18
+ 1. Copyright
19
+
20
+ Installation
21
+ ------------
22
+
23
+ Add this line to your application's Gemfile:
24
+
25
+ gem 'url_tokenizer'
26
+
27
+ And then execute:
28
+
29
+ $ bundle
30
+
31
+ Or install it yourself as:
32
+
33
+ $ gem install url_tokenizer
34
+
35
+ You'll need UrlTokenizer provider gems as well:
36
+
37
+ $ gem install url_tokenizer-provider-limelight
38
+
39
+ Requirements
40
+ ------------
41
+ 1. Ruby >= 1.9
42
+ 1. UrlTokenizer gem
43
+
44
+ Usage
45
+ ------------
46
+
47
+ Register provider using `UrlTokenizer.register`
48
+
49
+ ``` ruby
50
+ UrlTokenizer.register 'LL' => UrlTokenizer::Provider::Limelight
51
+ ```
52
+
53
+ Obtain provider and tokenize url:
54
+
55
+ ``` ruby
56
+ tokenizer = UrlTokenizer.provider('LL', key: 'super_secret_key')
57
+ tokenizer.call url, expire_in: 1.hour
58
+ ```
59
+
60
+ Contacts
61
+ -------------
62
+ Have questions or recommendations? Contact me via `alexander.n.paramonov@gmail.com`
63
+
64
+ Found a bug or have enhancement request? You are welcome at [Github bugtracker](https://github.com/AlexParamonov/url_tokenizer/issues)
65
+
66
+
67
+ Compatibility
68
+ -------------
69
+ tested with Ruby:
70
+
71
+ * 2.2
72
+ * 2.1
73
+ * 2.0
74
+ * 1.9.3
75
+ * ruby-head
76
+ * rbx-2
77
+ * jruby-19mode
78
+ * jruby-head
79
+
80
+ See [build history](http://travis-ci.org/#!/AlexParamonov/url_tokenizer/builds)
81
+
82
+
83
+ ## Contributing
84
+
85
+ 1. Fork repository ( http://github.com/AlexParamonov/url_tokenizer/fork )
86
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
87
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
88
+ 4. Push to the branch (`git push origin my-new-feature`)
89
+ 5. Create new Pull Request
90
+
91
+ Copyright
92
+ ---------
93
+ Copyright © 2015 Alexander Paramonov.
94
+ Released under the MIT License. See the LICENSE file for further details.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.0
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "url_tokenizer"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,19 @@
1
+ module UrlTokenizer
2
+ Error = Class.new StandardError
3
+ class << self
4
+ def provider(name, key: nil)
5
+ providers.fetch(name) do
6
+ raise Error, "unknown provider '#{ name }'"
7
+ end.new key
8
+ end
9
+
10
+ def register(provider_hash)
11
+ providers.merge! provider_hash
12
+ end
13
+
14
+ private
15
+ def providers
16
+ @providers ||= {}
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "url_tokenizer"
7
+ spec.version = IO.read("VERSION")
8
+ spec.authors = ["Alexander Paramonov"]
9
+ spec.email = ["alexander.n.paramonov@gmail.com"]
10
+ spec.summary = %q{Tokenize url by variety of providers.}
11
+ spec.description = %q{Tokenize url by variety of providers.}
12
+ spec.homepage = "http://github.com/AlexParamonov/url_tokenizer"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.bindir = "exe"
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.8"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "rspec", "~> 3.0"
23
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: url_tokenizer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Paramonov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Tokenize url by variety of providers.
56
+ email:
57
+ - alexander.n.paramonov@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - VERSION
70
+ - bin/console
71
+ - bin/setup
72
+ - lib/url_tokenizer.rb
73
+ - url_tokenizer.gemspec
74
+ homepage: http://github.com/AlexParamonov/url_tokenizer
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.4.6
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Tokenize url by variety of providers.
98
+ test_files: []