• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dkubb / memoizable
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: upgrade/dependencies
DEFAULT BRANCH: master
Repo Added 19 Nov 2013 08:48AM UTC
Files 5
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH no-block-allowed
branch: no-block-allowed
CHANGE BRANCH
x
Reset
  • no-block-allowed
  • devtools
  • double-checked-locking
  • master
  • memory_hash
  • upgrade/dependencies
  • v0.3.0
  • v0.3.1
  • v0.4.0
  • v0.4.1
  • v0.4.2

pending completion
91

push

travis-ci

dkubb
Change memoized method to not accept a block

* This is done because it is not possible to memoize a method that
  accepts a block.

  A method with a block could only be memoized if it were possible
  to know if the block provided was the same as an earlier block.
  However, each time a method executes the block has a new
  object_id. Also and it ranges from difficult to unsupported or
  impossible (depending on the ruby implementation) to get the
  block source.

  Not only would the source be necessary, but the runtime state of
  the block AST would be needed to compare against earlier seen
  blocks because it can reference anything within the current
  binding scope.

  Even heroic attempts like that in https://github.com/ngty/sourcify
  have a long list of caveats that make it inappropriate to use in
  a gem that is expected to always return the correct cached value.

  For these reasons and others it is currently impossible to memoize
  a method that accepts a block.

[Fix #6]

107 of 107 relevant lines covered (100.0%)

126.08 hits per line

Relevant lines Covered
Build:
Build:
107 RELEVANT LINES 107 COVERED LINES
126.08 HITS PER LINE
Source Files on no-block-allowed
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
91 no-block-allowed Change memoized method to not accept a block * This is done because it is not possible to memoize a method that accepts a block. A method with a block could only be memoized if it were possible to know if the block provided was the same as... push 13 Dec 2013 07:10AM UTC dkubb travis-ci pending completion  
See All Builds (116)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc