tiny_cache 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/MIT-LICENSE +1 -1
  2. data/README.md +32 -0
  3. data/Rakefile +15 -30
  4. data/lib/tiny_cache.rb +14 -1
  5. data/lib/tiny_cache/active_record.rb +18 -0
  6. data/lib/tiny_cache/active_record/base.rb +133 -0
  7. data/lib/tiny_cache/active_record/belongs_to_association.rb +37 -0
  8. data/lib/tiny_cache/active_record/fetch_by_uniq_key.rb +39 -0
  9. data/lib/tiny_cache/active_record/finder_methods.rb +132 -0
  10. data/lib/tiny_cache/active_record/has_many_association.rb +37 -0
  11. data/lib/tiny_cache/active_record/has_one_association.rb +36 -0
  12. data/lib/tiny_cache/active_record/persistence.rb +28 -0
  13. data/lib/tiny_cache/arel/wheres.rb +36 -0
  14. data/lib/tiny_cache/config.rb +23 -0
  15. data/lib/tiny_cache/record_marshal.rb +27 -0
  16. data/lib/tiny_cache/version.rb +2 -1
  17. data/spec/dummy/README.rdoc +28 -0
  18. data/{test → spec}/dummy/Rakefile +0 -1
  19. data/{test → spec}/dummy/app/assets/javascripts/application.js +3 -5
  20. data/{app/assets/stylesheets/tiny_cache → spec/dummy/app/assets/stylesheets}/application.css +0 -0
  21. data/spec/dummy/app/controllers/application_controller.rb +6 -0
  22. data/{test → spec}/dummy/app/helpers/application_helper.rb +1 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy/bin/bundle +3 -0
  25. data/spec/dummy/bin/rails +4 -0
  26. data/spec/dummy/bin/rake +4 -0
  27. data/{test → spec}/dummy/config.ru +1 -1
  28. data/spec/dummy/config/application.rb +24 -0
  29. data/spec/dummy/config/boot.rb +6 -0
  30. data/{test → spec}/dummy/config/database.yml +0 -0
  31. data/spec/dummy/config/environment.rb +6 -0
  32. data/spec/dummy/config/environments/development.rb +30 -0
  33. data/spec/dummy/config/environments/production.rb +81 -0
  34. data/{test → spec}/dummy/config/environments/test.rb +14 -14
  35. data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +1 -0
  36. data/spec/dummy/config/initializers/filter_parameter_logging.rb +5 -0
  37. data/spec/dummy/config/initializers/inflections.rb +17 -0
  38. data/{test → spec}/dummy/config/initializers/mime_types.rb +1 -0
  39. data/spec/dummy/config/initializers/secret_token.rb +13 -0
  40. data/spec/dummy/config/initializers/session_store.rb +4 -0
  41. data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +7 -6
  42. data/spec/dummy/config/locales/en.yml +23 -0
  43. data/spec/dummy/config/routes.rb +57 -0
  44. data/spec/dummy/public/404.html +58 -0
  45. data/spec/dummy/public/422.html +58 -0
  46. data/spec/dummy/public/500.html +57 -0
  47. data/{test → spec}/dummy/public/favicon.ico +0 -0
  48. data/spec/spec_helper.rb +41 -0
  49. metadata +95 -84
  50. data/README.rdoc +0 -3
  51. data/app/assets/javascripts/tiny_cache/application.js +0 -15
  52. data/app/controllers/tiny_cache/application_controller.rb +0 -4
  53. data/app/helpers/tiny_cache/application_helper.rb +0 -4
  54. data/app/views/layouts/tiny_cache/application.html.erb +0 -14
  55. data/config/routes.rb +0 -2
  56. data/lib/tiny_cache/engine.rb +0 -5
  57. data/test/dummy/README.rdoc +0 -261
  58. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  59. data/test/dummy/app/controllers/application_controller.rb +0 -3
  60. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  61. data/test/dummy/config/application.rb +0 -59
  62. data/test/dummy/config/boot.rb +0 -10
  63. data/test/dummy/config/environment.rb +0 -5
  64. data/test/dummy/config/environments/development.rb +0 -37
  65. data/test/dummy/config/environments/production.rb +0 -67
  66. data/test/dummy/config/initializers/inflections.rb +0 -15
  67. data/test/dummy/config/initializers/secret_token.rb +0 -7
  68. data/test/dummy/config/initializers/session_store.rb +0 -8
  69. data/test/dummy/config/locales/en.yml +0 -5
  70. data/test/dummy/config/routes.rb +0 -4
  71. data/test/dummy/public/404.html +0 -26
  72. data/test/dummy/public/422.html +0 -26
  73. data/test/dummy/public/500.html +0 -25
  74. data/test/dummy/script/rails +0 -6
  75. data/test/integration/navigation_test.rb +0 -10
  76. data/test/test_helper.rb +0 -15
  77. data/test/tiny_cache_test.rb +0 -7
@@ -1,67 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Full error reports are disabled and caching is turned on
8
- config.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
-
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
-
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
16
-
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
18
- config.assets.compile = false
19
-
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
22
-
23
- # Defaults to nil and saved in location specified by config.assets.prefix
24
- # config.assets.manifest = YOUR_PATH
25
-
26
- # Specifies the header that your server uses for sending files
27
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
-
30
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
- # config.force_ssl = true
32
-
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
35
-
36
- # Prepend all log lines with the following tags
37
- # config.log_tags = [ :subdomain, :uuid ]
38
-
39
- # Use a different logger for distributed setups
40
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
-
42
- # Use a different cache store in production
43
- # config.cache_store = :mem_cache_store
44
-
45
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
- # config.action_controller.asset_host = "http://assets.example.com"
47
-
48
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
- # config.assets.precompile += %w( search.js )
50
-
51
- # Disable delivery errors, bad email addresses will be ignored
52
- # config.action_mailer.raise_delivery_errors = false
53
-
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
- # the I18n.default_locale when a translation can not be found)
59
- config.i18n.fallbacks = true
60
-
61
- # Send deprecation notices to registered listeners
62
- config.active_support.deprecation = :notify
63
-
64
- # Log the query plan for queries taking more than this (works
65
- # with SQLite, MySQL, and PostgreSQL)
66
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
- end
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = '53964bd336d5fff0815cbdb9c1594aeeaa18863b3578e206b54ec528422f09d50eee65edb1fe1a82556c2208311b0b306d99d374888794552f7399226fd50cd7'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,4 +0,0 @@
1
- Rails.application.routes.draw do
2
-
3
- mount TinyCache::Engine => "/tiny_cache"
4
- end
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
@@ -1,15 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
-
12
- # Load fixtures from the engine
13
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TinyCacheTest < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, TinyCache
6
- end
7
- end