fifo-cache 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -7,6 +7,6 @@ source "http://rubygems.org"
7
7
  # Add dependencies to develop your gem here.
8
8
  # Include everything needed to run rake, tests, features, etc.
9
9
  group :development do
10
- gem "bundler", "~> 1.0.0"
11
- gem "jeweler", "~> 1.5.2"
10
+ gem "bundler", ">= 1.0.0"
11
+ gem "jeweler", ">= 1.5.2"
12
12
  end
@@ -1,20 +1,58 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- depq (0.4)
5
- git (1.2.5)
6
- hash-utils (0.7.0)
7
- jeweler (1.5.2)
8
- bundler (~> 1.0.0)
4
+ addressable (2.3.5)
5
+ builder (3.2.2)
6
+ depq (0.6)
7
+ faraday (0.8.8)
8
+ multipart-post (~> 1.2.0)
9
+ git (1.2.6)
10
+ github_api (0.10.1)
11
+ addressable
12
+ faraday (~> 0.8.1)
13
+ hashie (>= 1.2)
14
+ multi_json (~> 1.4)
15
+ nokogiri (~> 1.5.2)
16
+ oauth2
17
+ hash-utils (2.1.2)
18
+ ruby-version (>= 0.4.0)
19
+ hashie (2.0.5)
20
+ highline (1.6.19)
21
+ httpauth (0.2.0)
22
+ jeweler (1.8.8)
23
+ builder
24
+ bundler (~> 1.0)
9
25
  git (>= 1.2.5)
26
+ github_api (= 0.10.1)
27
+ highline (>= 1.6.15)
28
+ nokogiri (= 1.5.10)
10
29
  rake
11
- rake (0.8.7)
30
+ rdoc
31
+ json (1.8.0)
32
+ jwt (0.1.8)
33
+ multi_json (>= 1.5)
34
+ multi_json (1.8.2)
35
+ multi_xml (0.5.5)
36
+ multipart-post (1.2.0)
37
+ nokogiri (1.5.10)
38
+ oauth2 (0.9.2)
39
+ faraday (~> 0.8)
40
+ httpauth (~> 0.2)
41
+ jwt (~> 0.1.4)
42
+ multi_json (~> 1.0)
43
+ multi_xml (~> 0.5)
44
+ rack (~> 1.2)
45
+ rack (1.5.2)
46
+ rake (10.1.0)
47
+ rdoc (4.0.1)
48
+ json (~> 1.4)
49
+ ruby-version (0.4.3)
12
50
 
13
51
  PLATFORMS
14
52
  ruby
15
53
 
16
54
  DEPENDENCIES
17
- bundler (~> 1.0.0)
55
+ bundler (>= 1.0.0)
18
56
  depq (>= 0.4)
19
57
  hash-utils (>= 0.7.0)
20
- jeweler (~> 1.5.2)
58
+ jeweler (>= 1.5.2)
@@ -1,4 +1,5 @@
1
- Copyright (c) 2010 - 2011 Martin Kozák (martinkozak@martinkozak.net)
1
+ Copyright (c) 2010 - 2013 Martin Kozák (martinkozak@martinkozak.net)
2
+ (c) 2013 Martin Poljak (martin@poljak.cz)
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -69,9 +69,10 @@ Contributing
69
69
  Copyright
70
70
  ---------
71
71
 
72
- Copyright © 2011 [Martin Kozák][3]. See `LICENSE.txt` for
73
- further details.
72
+ Copyright © 2010-2013 [Martin Kozák][3], © 2013 [Martin Poljak][4].
73
+ See `LICENSE.txt` for further details.
74
74
 
75
75
  [1]: http://www.cs.princeton.edu/courses/archive/spr09/cos423/Lectures/i-heaps.pdf
76
- [2]: http://github.com/martinkozak/qrpc/issues
76
+ [2]: http://github.com/martinkozak/fifo-cache/issues
77
77
  [3]: http://www.martinkozak.net/
78
+ [4]: http://www.martinpoljak.net/
data/Rakefile CHANGED
@@ -25,13 +25,3 @@ Jeweler::Tasks.new do |gem|
25
25
  # gem.add_development_dependency 'rspec', '> 1.2.3'
26
26
  end
27
27
  Jeweler::RubygemsDotOrgTasks.new
28
-
29
- require 'rake/rdoctask'
30
- Rake::RDocTask.new do |rdoc|
31
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
32
-
33
- rdoc.rdoc_dir = 'rdoc'
34
- rdoc.title = "qrpc #{version}"
35
- rdoc.rdoc_files.include('README*')
36
- rdoc.rdoc_files.include('lib/**/*.rb')
37
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -4,13 +4,13 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{qrpc}
8
- s.version = "0.1.0"
7
+ s.name = "fifo-cache"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Martin Kozák"]
12
- s.date = %q{2011-02-10}
13
- s.email = %q{martinkozak@martinkozak.net}
11
+ s.authors = ["Martin Koz\u{e1}k"]
12
+ s.date = "2013-10-15"
13
+ s.email = "martinkozak@martinkozak.net"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
16
16
  "README.md"
@@ -23,14 +23,15 @@ Gem::Specification.new do |s|
23
23
  "README.md",
24
24
  "Rakefile",
25
25
  "VERSION",
26
+ "fifo-cache.gemspec",
26
27
  "lib/fifocache.rb",
27
28
  "test"
28
29
  ]
29
- s.homepage = %q{http://github.com/martinkozak/fifo-cache}
30
+ s.homepage = "http://github.com/martinkozak/fifo-cache"
30
31
  s.licenses = ["MIT"]
31
32
  s.require_paths = ["lib"]
32
- s.rubygems_version = %q{1.5.1}
33
- s.summary = %q{Fast hash-like fixed size cache class with FIFO functionality which removes oldest or less accessed records based on implicit heap.}
33
+ s.rubygems_version = "1.8.25"
34
+ s.summary = "Fast hash-like fixed size cache class with FIFO functionality which removes oldest or less accessed records based on implicit heap."
34
35
 
35
36
  if s.respond_to? :specification_version then
36
37
  s.specification_version = 3
@@ -38,19 +39,19 @@ Gem::Specification.new do |s|
38
39
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
39
40
  s.add_runtime_dependency(%q<depq>, [">= 0.4"])
40
41
  s.add_runtime_dependency(%q<hash-utils>, [">= 0.7.0"])
41
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
42
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
42
+ s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
43
+ s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
43
44
  else
44
45
  s.add_dependency(%q<depq>, [">= 0.4"])
45
46
  s.add_dependency(%q<hash-utils>, [">= 0.7.0"])
46
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
47
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
47
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
48
+ s.add_dependency(%q<jeweler>, [">= 1.5.2"])
48
49
  end
49
50
  else
50
51
  s.add_dependency(%q<depq>, [">= 0.4"])
51
52
  s.add_dependency(%q<hash-utils>, [">= 0.7.0"])
52
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
53
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
53
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
54
+ s.add_dependency(%q<jeweler>, [">= 1.5.2"])
54
55
  end
55
56
  end
56
57
 
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
- # (c) 2010-2011 Martin Kozák (martinkozak@martinkozak.net)
2
+ # (c) 2010-2013 Martin Kozák (martinkozak@martinkozak.net)
3
+ # (c) 2013 Martin Poljak (martin@poljak.cz)
3
4
 
4
5
  require "hash-utils/object"
5
6
  require "depq"
@@ -157,9 +158,12 @@ class Fifocache
157
158
 
158
159
  def touch(key)
159
160
  locator = @counts[key]
160
- priority = locator.priority + 1
161
-
162
- if priority != self.class::INFINITY
161
+
162
+ if locator
163
+ priority = locator.priority + 1
164
+ end
165
+
166
+ if locator and priority != self.class::INFINITY
163
167
  locator.update(key, locator.priority + 1)
164
168
  end
165
169
  end
metadata CHANGED
@@ -1,72 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fifo-cache
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
4
5
  prerelease:
5
- version: 0.1.0
6
6
  platform: ruby
7
- authors:
8
- - "Martin Koz\xC3\xA1k"
7
+ authors:
8
+ - Martin Kozák
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-02-10 00:00:00 +01:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2013-10-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: depq
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0.4"
18
+ requirements:
19
+ - - '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.4'
24
22
  type: :runtime
25
23
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0.4'
30
+ - !ruby/object:Gem::Dependency
28
31
  name: hash-utils
29
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
30
33
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
+ requirements:
35
+ - - '>='
36
+ - !ruby/object:Gem::Version
34
37
  version: 0.7.0
35
38
  type: :runtime
36
39
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.7.0
46
+ - !ruby/object:Gem::Dependency
39
47
  name: bundler
40
- requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
41
49
  none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
45
53
  version: 1.0.0
46
54
  type: :development
47
55
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ - !ruby/object:Gem::Dependency
50
63
  name: jeweler
51
- requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
52
65
  none: false
53
- requirements:
54
- - - ~>
55
- - !ruby/object:Gem::Version
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
56
69
  version: 1.5.2
57
70
  type: :development
58
71
  prerelease: false
59
- version_requirements: *id004
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.5.2
60
78
  description:
61
79
  email: martinkozak@martinkozak.net
62
80
  executables: []
63
-
64
81
  extensions: []
65
-
66
- extra_rdoc_files:
82
+ extra_rdoc_files:
67
83
  - LICENSE.txt
68
84
  - README.md
69
- files:
85
+ files:
70
86
  - .document
71
87
  - Gemfile
72
88
  - Gemfile.lock
@@ -74,39 +90,36 @@ files:
74
90
  - README.md
75
91
  - Rakefile
76
92
  - VERSION
93
+ - fifo-cache.gemspec
77
94
  - lib/fifocache.rb
78
- - qrpc.gemspec
79
95
  - test
80
- has_rdoc: true
81
96
  homepage: http://github.com/martinkozak/fifo-cache
82
- licenses:
97
+ licenses:
83
98
  - MIT
84
99
  post_install_message:
85
100
  rdoc_options: []
86
-
87
- require_paths:
101
+ require_paths:
88
102
  - lib
89
- required_ruby_version: !ruby/object:Gem::Requirement
103
+ required_ruby_version: !ruby/object:Gem::Requirement
90
104
  none: false
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- hash: 2127215493640234633
95
- segments:
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ segments:
96
110
  - 0
97
- version: "0"
98
- required_rubygems_version: !ruby/object:Gem::Requirement
111
+ hash: -2442560149070771212
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
113
  none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: "0"
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
104
118
  requirements: []
105
-
106
119
  rubyforge_project:
107
- rubygems_version: 1.5.1
120
+ rubygems_version: 1.8.25
108
121
  signing_key:
109
122
  specification_version: 3
110
- summary: Fast hash-like fixed size cache class with FIFO functionality which removes oldest or less accessed records based on implicit heap.
123
+ summary: Fast hash-like fixed size cache class with FIFO functionality which removes
124
+ oldest or less accessed records based on implicit heap.
111
125
  test_files: []
112
-