king_tokens 1.0.1 → 2.0.0
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.
- data/.gitignore +4 -1
- data/Gemfile +3 -0
- data/Rakefile +3 -18
- data/king_tokens.gemspec +23 -46
- data/lib/king_tokens/token_code.rb +9 -8
- data/lib/king_tokens/tokenizer.rb +11 -17
- data/lib/king_tokens/version.rb +3 -0
- data/test/schema.rb +2 -1
- data/test/test_helper.rb +3 -1
- data/test/tokenizer_test.rb +9 -6
- metadata +102 -22
- data/.document +0 -3
- data/VERSION +0 -1
- data/coverage/index.html +0 -112
- data/coverage/lib-token_code_rb.html +0 -290
- data/coverage/lib-tokenizer_rb.html +0 -344
- data/init.rb +0 -1
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -1,23 +1,8 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'rake'
|
2
|
+
require "bundler/gem_helper"
|
3
3
|
require 'rake/testtask'
|
4
|
-
require '
|
5
|
-
|
6
|
-
begin
|
7
|
-
require 'jeweler'
|
8
|
-
Jeweler::Tasks.new do |gem|
|
9
|
-
gem.name = "king_tokens"
|
10
|
-
gem.summary = %Q{Access tokens for any active record object}
|
11
|
-
gem.description = %Q{Tokens are a usefull way to give users access to an application. This can be for a limited time or just once. Just think of password resets, changing email, protected rss feed urls, timed out private links}
|
12
|
-
gem.email = "gl@salesking.eu"
|
13
|
-
gem.homepage = "http://github.com/schorsch/king_tokens"
|
14
|
-
gem.authors = ["Georg Leciejewski", "Michael Bumann"]
|
15
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
-
end
|
17
|
-
Jeweler::GemcutterTasks.new
|
18
|
-
rescue LoadError
|
19
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
-
end
|
4
|
+
require 'rdoc/task'
|
5
|
+
Bundler::GemHelper.install_tasks
|
21
6
|
|
22
7
|
desc 'Default: run unit tests.'
|
23
8
|
task :default => :test
|
data/king_tokens.gemspec
CHANGED
@@ -1,59 +1,36 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'king_tokens/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
6
|
s.name = %q{king_tokens}
|
8
|
-
s.
|
7
|
+
s.summary = %q{Access tokens for any active record object}
|
8
|
+
s.description = %q{Tokens are a usefull way to give users access to an application. This can be for a limited time or just once. Just think of password resets, changing email, protected rss feed urls, timed out private links}
|
9
|
+
s.version = KingTokens::VERSION
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
12
|
s.authors = ["Georg Leciejewski", "Michael Bumann"]
|
12
13
|
s.date = %q{2010-05-04}
|
13
|
-
s.description = %q{Tokens are a usefull way to give users access to an application. This can be for a limited time or just once. Just think of password resets, changing email, protected rss feed urls, timed out private links}
|
14
14
|
s.email = %q{gl@salesking.eu}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"README.rdoc"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".document",
|
20
|
-
".gitignore",
|
21
|
-
"MIT-LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"coverage/index.html",
|
26
|
-
"coverage/lib-token_code_rb.html",
|
27
|
-
"coverage/lib-tokenizer_rb.html",
|
28
|
-
"init.rb",
|
29
|
-
"king_tokens.gemspec",
|
30
|
-
"lib/king_tokens.rb",
|
31
|
-
"lib/king_tokens/token_code.rb",
|
32
|
-
"lib/king_tokens/tokenizer.rb",
|
33
|
-
"tasks/tokenizer_tasks.rake",
|
34
|
-
"test/schema.rb",
|
35
|
-
"test/test_helper.rb",
|
36
|
-
"test/tokenizer_test.rb"
|
37
|
-
]
|
38
15
|
s.homepage = %q{http://github.com/schorsch/king_tokens}
|
39
|
-
|
16
|
+
|
17
|
+
s.extra_rdoc_files = ["README.rdoc"]
|
40
18
|
s.require_paths = ["lib"]
|
41
|
-
|
42
|
-
s.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
19
|
+
|
20
|
+
s.rubygems_version = %q{1.6.2}
|
21
|
+
|
22
|
+
s.executables = nil
|
23
|
+
s.files = `git ls-files`.split("\n")
|
24
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
+
|
26
|
+
s.require_paths = ["lib"]
|
27
|
+
|
28
|
+
s.add_development_dependency 'test-unit'
|
29
|
+
s.add_development_dependency 'activerecord'
|
30
|
+
s.add_development_dependency 'activesupport'
|
31
|
+
s.add_development_dependency 'rake'
|
32
|
+
s.add_development_dependency 'rdoc'
|
33
|
+
s.add_development_dependency 'sqlite3'
|
34
|
+
|
58
35
|
end
|
59
36
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require "digest/sha1"
|
2
3
|
|
3
4
|
# Class to handle polymorphic tokens
|
@@ -5,11 +6,11 @@ class TokenCode < ActiveRecord::Base
|
|
5
6
|
|
6
7
|
belongs_to :object, :polymorphic => true
|
7
8
|
before_create :set_token
|
8
|
-
|
9
|
+
|
9
10
|
validates_presence_of :name
|
10
11
|
validates_format_of :name, :with => /^[a-zA-Z0-9\_\-]+$/
|
11
12
|
validates_uniqueness_of :name, :scope => [:object_id, :object_type] #second not really needed if uuid
|
12
|
-
|
13
|
+
|
13
14
|
def to_s
|
14
15
|
self.token
|
15
16
|
end
|
@@ -42,17 +43,17 @@ class TokenCode < ActiveRecord::Base
|
|
42
43
|
def valid_for_use?
|
43
44
|
valid? && !used? && !expired?
|
44
45
|
end
|
45
|
-
|
46
|
+
|
46
47
|
# Delete all tokens which have been used
|
47
48
|
def self.delete_used
|
48
49
|
delete_all "used_at IS NOT NULL"
|
49
50
|
end
|
50
|
-
|
51
|
+
|
51
52
|
# Delete all tokens which are expired
|
52
53
|
def self.delete_expired
|
53
|
-
delete_all ["valid_until IS NOT NULL AND valid_until < ? ", Time.now]
|
54
|
+
delete_all ["valid_until IS NOT NULL AND valid_until < ? ", Time.now]
|
54
55
|
end
|
55
|
-
|
56
|
+
|
56
57
|
private
|
57
58
|
|
58
59
|
# Generate a token with a default length of 12.
|
@@ -66,7 +67,7 @@ class TokenCode < ActiveRecord::Base
|
|
66
67
|
end while !validity.call(token) if block_given?
|
67
68
|
token
|
68
69
|
end
|
69
|
-
|
70
|
+
|
70
71
|
def secure_digest(*args)
|
71
72
|
Digest::SHA1.hexdigest(args.flatten.join('--'))
|
72
73
|
end
|
@@ -74,5 +75,5 @@ class TokenCode < ActiveRecord::Base
|
|
74
75
|
def set_token
|
75
76
|
self.token = generate_token { |token| TokenCode.find_by_token(token).nil? }
|
76
77
|
end
|
77
|
-
|
78
|
+
|
78
79
|
end
|
@@ -1,11 +1,12 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module KingTokens
|
2
3
|
# Module which adds the token methods to the including class
|
3
4
|
module Tokenizer
|
4
|
-
|
5
|
+
|
5
6
|
def self.included(base)
|
6
7
|
base.extend(ClassMethods)
|
7
8
|
end
|
8
|
-
|
9
|
+
|
9
10
|
module ClassMethods
|
10
11
|
|
11
12
|
# Define what kind of tokens the class should have
|
@@ -15,11 +16,8 @@ module KingTokens
|
|
15
16
|
options = tokens.extract_options!
|
16
17
|
options[:tokens] = tokens
|
17
18
|
options[:days_valid] ||= 5
|
18
|
-
options[:object_type] =
|
19
|
-
|
20
|
-
class_inheritable_accessor :can_has_tokens_options
|
21
|
-
self.can_has_tokens_options = options
|
22
|
-
|
19
|
+
options[:object_type] = self.base_class.name.to_s
|
20
|
+
|
23
21
|
has_many :token_codes, :as => :object, :dependent => :destroy
|
24
22
|
|
25
23
|
extend KingTokens::Tokenizer::SingletonMethods
|
@@ -42,23 +40,19 @@ module KingTokens
|
|
42
40
|
end
|
43
41
|
end
|
44
42
|
end
|
45
|
-
|
43
|
+
|
46
44
|
end
|
47
|
-
|
45
|
+
|
48
46
|
module SingletonMethods
|
49
47
|
|
50
48
|
# Find a token.
|
51
49
|
#
|
52
50
|
# ==== Parameter
|
53
51
|
# args<Hash{Symbol=>}>:: arguments passed to the conditions of the TokenCode.find method
|
54
|
-
# ==== Options (args)
|
55
|
-
# :object_type<String>:: the name of the object tpye, normally the class name of the related object
|
56
|
-
#
|
57
52
|
#
|
58
53
|
# ==== Returns
|
59
54
|
# Object:: the object to which the token belongs
|
60
55
|
def find_token(args={})
|
61
|
-
args.merge!({:object_type => can_has_tokens_options[:object_type]})
|
62
56
|
TokenCode.find(:first, :conditions => args)
|
63
57
|
end
|
64
58
|
|
@@ -88,7 +82,7 @@ module KingTokens
|
|
88
82
|
return token.object if token && token.valid_for_use?
|
89
83
|
end
|
90
84
|
end
|
91
|
-
|
85
|
+
|
92
86
|
module InstanceMethods
|
93
87
|
# Create a token
|
94
88
|
# ==== Parameter
|
@@ -104,7 +98,7 @@ module KingTokens
|
|
104
98
|
self.token(name).destroy
|
105
99
|
end
|
106
100
|
args[:name] = "#{name}"
|
107
|
-
args[:valid_until] ||= (args.delete(:valid) ||
|
101
|
+
args[:valid_until] ||= ( args.delete(:valid) || 5.days ).from_now
|
108
102
|
self.token_codes.create(args)
|
109
103
|
end
|
110
104
|
|
@@ -114,8 +108,8 @@ module KingTokens
|
|
114
108
|
def token(name)
|
115
109
|
self.token_codes.find_by_name("#{name}")
|
116
110
|
end
|
117
|
-
|
111
|
+
|
118
112
|
end
|
119
|
-
|
113
|
+
|
120
114
|
end #module
|
121
115
|
end # namespace
|
data/test/schema.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
ActiveRecord::Schema.define(:version => 0) do
|
2
3
|
|
3
4
|
create_table :token_codes do |t|
|
@@ -6,7 +7,7 @@ ActiveRecord::Schema.define(:version => 0) do
|
|
6
7
|
t.datetime :used_at, :valid_until
|
7
8
|
t.timestamps
|
8
9
|
end
|
9
|
-
|
10
|
+
|
10
11
|
create_table :users do |t|
|
11
12
|
t.string :name
|
12
13
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'test/unit'
|
2
3
|
require 'rubygems'
|
3
4
|
require 'active_record'
|
@@ -9,7 +10,8 @@ require 'active_support/test_case'
|
|
9
10
|
#require 'active_support/testing/assertions'
|
10
11
|
#require ActiveSupport::TestCase
|
11
12
|
require "#{File.dirname(__FILE__)}/../lib/king_tokens"
|
12
|
-
|
13
|
+
Encoding.default_external = Encoding::UTF_8
|
14
|
+
Encoding.default_internal = Encoding::UTF_8
|
13
15
|
ActiveRecord::Base.establish_connection({
|
14
16
|
'adapter' => 'sqlite3',
|
15
17
|
'database' => ':memory:'
|
data/test/tokenizer_test.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require(File.join(File.dirname(__FILE__), 'test_helper'))
|
3
|
+
require 'logger'
|
2
4
|
|
5
|
+
ActiveRecord::Base.logger = Logger.new(STDERR)
|
3
6
|
# TODO:
|
4
7
|
# - make some nice mock objects!
|
5
8
|
# - Tests still mixed for two classes
|
@@ -16,7 +19,7 @@ class TokenizerTest < Test::Unit::TestCase
|
|
16
19
|
assert_respond_to User.new, m
|
17
20
|
end
|
18
21
|
end
|
19
|
-
|
22
|
+
|
20
23
|
def test_should_set_the_token_automatically
|
21
24
|
user = User.create(:name=>"joe")
|
22
25
|
assert_difference "TokenCode.count" do
|
@@ -30,7 +33,7 @@ class TokenizerTest < Test::Unit::TestCase
|
|
30
33
|
assert_equal false, user.forgot_password_token?
|
31
34
|
user.set_forgot_password_token
|
32
35
|
assert user.forgot_password_token?
|
33
|
-
|
36
|
+
|
34
37
|
end
|
35
38
|
|
36
39
|
def test_unique_name_in_polymorphic_scope
|
@@ -40,7 +43,7 @@ class TokenizerTest < Test::Unit::TestCase
|
|
40
43
|
user.set_forgot_password_token
|
41
44
|
end
|
42
45
|
end
|
43
|
-
|
46
|
+
|
44
47
|
def test_same_token_should_be_deleted
|
45
48
|
user = User.create(:name=>"joe")
|
46
49
|
user.set_forgot_password_token
|
@@ -58,7 +61,7 @@ class TokenizerTest < Test::Unit::TestCase
|
|
58
61
|
user.set_forgot_password_token
|
59
62
|
assert_in_delta user.token(:forgot_password).valid_until.to_i, 5.days.from_now.to_i, 10
|
60
63
|
end
|
61
|
-
|
64
|
+
|
62
65
|
def test_token_to_string
|
63
66
|
user = User.create(:name=>"joe")
|
64
67
|
user.set_forgot_password_token(:valid=>2.days)
|
@@ -70,7 +73,7 @@ class TokenizerTest < Test::Unit::TestCase
|
|
70
73
|
user.set_forgot_password_token(:valid=>2.days)
|
71
74
|
assert_in_delta user.token(:forgot_password).valid_until.to_i, 2.days.from_now.to_i,10
|
72
75
|
end
|
73
|
-
|
76
|
+
|
74
77
|
def test_should_use_and_return_unavailable
|
75
78
|
user = User.create(:name=>"joe")
|
76
79
|
user.set_forgot_password_token
|
@@ -136,6 +139,6 @@ class TokenizerTest < Test::Unit::TestCase
|
|
136
139
|
assert_equal user, User.find_by_valid_token(:forgot_password, token.token)
|
137
140
|
end
|
138
141
|
def test_should_not_leak_token_options
|
139
|
-
|
142
|
+
|
140
143
|
end
|
141
144
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: king_tokens
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
|
-
-
|
7
|
+
- 2
|
8
|
+
- 0
|
7
9
|
- 0
|
8
|
-
|
9
|
-
version: 1.0.1
|
10
|
+
version: 2.0.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Georg Leciejewski
|
@@ -15,10 +16,92 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-05-04 00:00:00
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
date: 2010-05-04 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: test-unit
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: activerecord
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: activesupport
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rake
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
type: :development
|
76
|
+
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: rdoc
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
type: :development
|
90
|
+
version_requirements: *id005
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: sqlite3
|
93
|
+
prerelease: false
|
94
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
103
|
+
type: :development
|
104
|
+
version_requirements: *id006
|
22
105
|
description: Tokens are a usefull way to give users access to an application. This can be for a limited time or just once. Just think of password resets, changing email, protected rss feed urls, timed out private links
|
23
106
|
email: gl@salesking.eu
|
24
107
|
executables: []
|
@@ -28,55 +111,52 @@ extensions: []
|
|
28
111
|
extra_rdoc_files:
|
29
112
|
- README.rdoc
|
30
113
|
files:
|
31
|
-
- .document
|
32
114
|
- .gitignore
|
115
|
+
- Gemfile
|
33
116
|
- MIT-LICENSE
|
34
117
|
- README.rdoc
|
35
118
|
- Rakefile
|
36
|
-
- VERSION
|
37
|
-
- coverage/index.html
|
38
|
-
- coverage/lib-token_code_rb.html
|
39
|
-
- coverage/lib-tokenizer_rb.html
|
40
|
-
- init.rb
|
41
119
|
- king_tokens.gemspec
|
42
120
|
- lib/king_tokens.rb
|
43
121
|
- lib/king_tokens/token_code.rb
|
44
122
|
- lib/king_tokens/tokenizer.rb
|
123
|
+
- lib/king_tokens/version.rb
|
45
124
|
- tasks/tokenizer_tasks.rake
|
46
125
|
- test/schema.rb
|
47
126
|
- test/test_helper.rb
|
48
127
|
- test/tokenizer_test.rb
|
49
|
-
has_rdoc: true
|
50
128
|
homepage: http://github.com/schorsch/king_tokens
|
51
129
|
licenses: []
|
52
130
|
|
53
131
|
post_install_message:
|
54
|
-
rdoc_options:
|
55
|
-
|
132
|
+
rdoc_options: []
|
133
|
+
|
56
134
|
require_paths:
|
57
135
|
- lib
|
58
136
|
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
59
138
|
requirements:
|
60
139
|
- - ">="
|
61
140
|
- !ruby/object:Gem::Version
|
141
|
+
hash: 3
|
62
142
|
segments:
|
63
143
|
- 0
|
64
144
|
version: "0"
|
65
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
66
147
|
requirements:
|
67
148
|
- - ">="
|
68
149
|
- !ruby/object:Gem::Version
|
150
|
+
hash: 3
|
69
151
|
segments:
|
70
152
|
- 0
|
71
153
|
version: "0"
|
72
154
|
requirements: []
|
73
155
|
|
74
156
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.
|
157
|
+
rubygems_version: 1.8.15
|
76
158
|
signing_key:
|
77
159
|
specification_version: 3
|
78
160
|
summary: Access tokens for any active record object
|
79
|
-
test_files:
|
80
|
-
|
81
|
-
- test/test_helper.rb
|
82
|
-
- test/tokenizer_test.rb
|
161
|
+
test_files: []
|
162
|
+
|
data/.document
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.1
|
data/coverage/index.html
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
-
<head>
|
4
|
-
<title>
|
5
|
-
C0 code coverage information
|
6
|
-
</title>
|
7
|
-
<style type='text/css'>
|
8
|
-
body { background-color: rgb(240, 240, 245); }
|
9
|
-
</style>
|
10
|
-
<style type='text/css'>
|
11
|
-
span.cross-ref-title { font-size: 140%; } span.cross-ref a {
|
12
|
-
text-decoration: none; } span.cross-ref { background-color:#f3f7fa;
|
13
|
-
border: 1px dashed #333; margin: 1em; padding: 0.5em; overflow: hidden; }
|
14
|
-
a.crossref-toggle { text-decoration: none; } span.marked0 {
|
15
|
-
background-color: rgb(185, 210, 200); display: block; } span.marked1 {
|
16
|
-
background-color: rgb(190, 215, 205); display: block; } span.inferred0 {
|
17
|
-
background-color: rgb(175, 200, 200); display: block; } span.inferred1 {
|
18
|
-
background-color: rgb(180, 205, 205); display: block; } span.uncovered0 {
|
19
|
-
background-color: rgb(225, 110, 110); display: block; } span.uncovered1 {
|
20
|
-
background-color: rgb(235, 120, 120); display: block; } span.overview {
|
21
|
-
border-bottom: 8px solid black; } div.overview { border-bottom: 8px solid
|
22
|
-
black; } body { font-family: verdana, arial, helvetica; } div.footer {
|
23
|
-
font-size: 68%; margin-top: 1.5em; } h1, h2, h3, h4, h5, h6 {
|
24
|
-
margin-bottom: 0.5em; } h5 { margin-top: 0.5em; } .hidden { display: none;
|
25
|
-
} div.separator { height: 10px; } /* Commented out for better readability,
|
26
|
-
esp. on IE */ /* table tr td, table tr th { font-size: 68%; } td.value
|
27
|
-
table tr td { font-size: 11px; } */ table.percent_graph { height: 12px;
|
28
|
-
border: #808080 1px solid; empty-cells: show; } table.percent_graph
|
29
|
-
td.covered { height: 10px; background: #00f000; } table.percent_graph
|
30
|
-
td.uncovered { height: 10px; background: #e00000; } table.percent_graph
|
31
|
-
td.NA { height: 10px; background: #eaeaea; } table.report {
|
32
|
-
border-collapse: collapse; width: 100%; } table.report td.heading {
|
33
|
-
background: #dcecff; border: #d0d0d0 1px solid; font-weight: bold;
|
34
|
-
text-align: center; } table.report td.heading:hover { background: #c0ffc0;
|
35
|
-
} table.report td.text { border: #d0d0d0 1px solid; } table.report
|
36
|
-
td.value, table.report td.lines_total, table.report td.lines_code {
|
37
|
-
text-align: right; border: #d0d0d0 1px solid; } table.report tr.light {
|
38
|
-
background-color: rgb(240, 240, 245); } table.report tr.dark {
|
39
|
-
background-color: rgb(230, 230, 235); }
|
40
|
-
</style>
|
41
|
-
<script type='text/javascript'>
|
42
|
-
// <![CDATA[ function toggleCode( id ) { if ( document.getElementById )
|
43
|
-
elem = document.getElementById( id ); else if ( document.all ) elem =
|
44
|
-
eval( "document.all." + id ); else return false; elemStyle = elem.style;
|
45
|
-
if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else {
|
46
|
-
elemStyle.display = "none" } return true; } // Make cross-references
|
47
|
-
hidden by default document.writeln( "<style
|
48
|
-
type=\"text/css\">span.cross-ref { display: none }</style>" ) // ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
<body>
|
52
|
-
<h3>
|
53
|
-
C0 code coverage information
|
54
|
-
</h3>
|
55
|
-
<p>
|
56
|
-
Generated on Sun Dec 07 02:06:42 +0100 2008 with
|
57
|
-
<a href='http://eigenclass.org/hiki/rcov'>
|
58
|
-
rcov 0.8.1.2
|
59
|
-
</a>
|
60
|
-
</p>
|
61
|
-
<hr />
|
62
|
-
<table class='report'> <thead> <tr> <td class='heading'> Name </td> <td
|
63
|
-
class='heading'> Total lines </td> <td class='heading'> Lines of code </td>
|
64
|
-
<td class='heading'> Total coverage </td> <td class='heading'> Code coverage
|
65
|
-
</td> </tr> </thead> <tbody> <tr class='light'> <td> TOTAL </td> <td
|
66
|
-
class='lines_total'> <tt> 201 </tt> </td> <td class='lines_code'> <tt> 109
|
67
|
-
</tt> </td> <td> <table cellspacing='0' align='right' cellpadding='0'> <tr>
|
68
|
-
<td> <tt class='coverage_total'> 100.0% </tt> </td> <td> <table
|
69
|
-
class='percent_graph' cellspacing='0' width='100' cellpadding='0'> <tr> <td
|
70
|
-
class='covered' width='100' /> <td class='uncovered' width='0' /> </tr>
|
71
|
-
</table> </td> </tr> </table> </td> <td> <table cellspacing='0'
|
72
|
-
align='right' cellpadding='0'> <tr> <td> <tt class='coverage_code'> 100.0%
|
73
|
-
</tt> </td> <td> <table class='percent_graph' cellspacing='0'
|
74
|
-
width='100' cellpadding='0'> <tr> <td class='covered' width='100' /> <td
|
75
|
-
class='uncovered' width='0' /> </tr> </table> </td> </tr> </table> </td>
|
76
|
-
</tr> <tr class='dark'> <td> <a href='lib-token_code_rb.html'>
|
77
|
-
lib/token_code.rb </a> </td> <td class='lines_total'> <tt> 80 </tt> </td>
|
78
|
-
<td class='lines_code'> <tt> 46 </tt> </td> <td> <table cellspacing='0'
|
79
|
-
align='right' cellpadding='0'> <tr> <td> <tt class='coverage_total'> 100.0%
|
80
|
-
</tt> </td> <td> <table class='percent_graph' cellspacing='0'
|
81
|
-
width='100' cellpadding='0'> <tr> <td class='covered' width='100' /> <td
|
82
|
-
class='uncovered' width='0' /> </tr> </table> </td> </tr> </table> </td>
|
83
|
-
<td> <table cellspacing='0' align='right' cellpadding='0'> <tr> <td> <tt
|
84
|
-
class='coverage_code'> 100.0% </tt> </td> <td> <table
|
85
|
-
class='percent_graph' cellspacing='0' width='100' cellpadding='0'> <tr> <td
|
86
|
-
class='covered' width='100' /> <td class='uncovered' width='0' /> </tr>
|
87
|
-
</table> </td> </tr> </table> </td> </tr> <tr class='light'> <td> <a
|
88
|
-
href='lib-tokenizer_rb.html'> lib/tokenizer.rb </a> </td> <td
|
89
|
-
class='lines_total'> <tt> 121 </tt> </td> <td class='lines_code'> <tt> 63
|
90
|
-
</tt> </td> <td> <table cellspacing='0' align='right' cellpadding='0'> <tr>
|
91
|
-
<td> <tt class='coverage_total'> 100.0% </tt> </td> <td> <table
|
92
|
-
class='percent_graph' cellspacing='0' width='100' cellpadding='0'> <tr> <td
|
93
|
-
class='covered' width='100' /> <td class='uncovered' width='0' /> </tr>
|
94
|
-
</table> </td> </tr> </table> </td> <td> <table cellspacing='0'
|
95
|
-
align='right' cellpadding='0'> <tr> <td> <tt class='coverage_code'> 100.0%
|
96
|
-
</tt> </td> <td> <table class='percent_graph' cellspacing='0'
|
97
|
-
width='100' cellpadding='0'> <tr> <td class='covered' width='100' /> <td
|
98
|
-
class='uncovered' width='0' /> </tr> </table> </td> </tr> </table> </td>
|
99
|
-
</tr> </tbody> </table>
|
100
|
-
<hr />
|
101
|
-
<p> Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'> rcov
|
102
|
-
code coverage analysis tool for Ruby </a> version 0.8.1.2. </p>
|
103
|
-
<p>
|
104
|
-
<a href='http://validator.w3.org/check/referer'>
|
105
|
-
<img src='http://www.w3.org/Icons/valid-xhtml11' height='31' alt='Valid XHTML 1.1!' width='88' />
|
106
|
-
</a>
|
107
|
-
<a href='http://jigsaw.w3.org/css-validator/check/referer'>
|
108
|
-
<img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px' />
|
109
|
-
</a>
|
110
|
-
</p>
|
111
|
-
</body>
|
112
|
-
</html>
|