webs 0.1.16 → 0.1.17

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.
Files changed (5) hide show
  1. data/Rakefile +1 -1
  2. data/lib/cache/cache.rb +14 -3
  3. data/lib/webs.rb +1 -1
  4. data/webs.gemspec +2 -2
  5. metadata +59 -64
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('webs', '0.1.16') do |p|
6
+ Echoe.new('webs', '0.1.17') do |p|
7
7
  p.description = "Reusable webs stuff."
8
8
  p.url = "https://colczak@github.com/websdev/websgem.git"
9
9
  p.author = "Chuck Olczak"
data/lib/cache/cache.rb CHANGED
@@ -13,8 +13,15 @@ module Webs
13
13
  end
14
14
 
15
15
  def cache_block(key, options=nil, &block)
16
+ Rails.logger.debug "*********** cache_block(#{key}, #{options.inspect if options} )" if debug
16
17
  return if key.nil?
17
- unless data = Webs.cache.read(key)
18
+
19
+ if Webs.cache.respond_to?( 'read' )
20
+ data = Webs.cache.read(key)
21
+ else
22
+ data = Webs.cache[ key ]
23
+ end
24
+ unless data
18
25
  if self.respond_to?('capture')
19
26
  data = capture(&block) # called from view
20
27
  else
@@ -26,7 +33,11 @@ module Webs
26
33
  # should get almost 10:1 compression ratio. This will be key for caching pages & fragments
27
34
  if block_size < 1.megabyte
28
35
  Rails.logger.debug "*********** cache_block[#{block_size}](#{key}, #{data} )" if debug
29
- Webs.cache.write(key, data)
36
+ if Webs.cache.respond_to?( 'write' )
37
+ Webs.cache.write(key, data)
38
+ else
39
+ Webs.cache[ key ] = data
40
+ end
30
41
  else
31
42
  Rails.logger.debug "*********** block not cached since exceeds 3M @ #{block_size} )" if debug
32
43
  end
@@ -35,7 +46,7 @@ module Webs
35
46
  end
36
47
  data
37
48
  rescue Exception => e
38
- Rails.logger.error "------------------------------------------------\nmemcache_error: #{e.message}"
49
+ Rails.logger.error "------------------------------------------------\nmemcache_error: #{e.message}, #{e.backtrace.join("\n")}"
39
50
  data
40
51
  end
41
52
  end
data/lib/webs.rb CHANGED
@@ -7,7 +7,7 @@ require dir + 'helper/params'
7
7
  require dir + 'helper/tags'
8
8
 
9
9
  module Webs
10
- VERSION = '0.1.16'.freeze
10
+ VERSION = '0.1.17'.freeze
11
11
 
12
12
  # def self.load_constants
13
13
  # s = File.read("#{Pathname(__FILE__).dirname.expand_path}/config/webs_constants.yml")
data/webs.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{webs}
5
- s.version = "0.1.16"
5
+ s.version = "0.1.17"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Chuck Olczak"]
9
- s.date = %q{2011-02-09}
9
+ s.date = %q{2011-02-11}
10
10
  s.description = %q{Reusable webs stuff.}
11
11
  s.email = %q{chuck@webs.com}
12
12
  gemfiles = [
metadata CHANGED
@@ -1,21 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
5
4
  prerelease: false
6
5
  segments:
7
- - 0
8
- - 1
9
- - 16
10
- version: 0.1.16
6
+ - 0
7
+ - 1
8
+ - 17
9
+ version: 0.1.17
11
10
  platform: ruby
12
11
  authors:
13
- - Chuck Olczak
12
+ - Chuck Olczak
14
13
  autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-02-09 00:00:00 -05:00
17
+ date: 2011-02-11 00:00:00 -05:00
19
18
  default_executable:
20
19
  dependencies: []
21
20
 
@@ -26,78 +25,74 @@ executables: []
26
25
  extensions: []
27
26
 
28
27
  extra_rdoc_files:
29
- - README.rdoc
30
- - lib/webs.rb
31
- - lib/cache/cache.rb
32
- - lib/config/webs_constants.rb
33
- - lib/config/webs_initializer.rb
34
- - lib/controller/url_for_context_path.rb
35
- - lib/controller/alive_controller.rb
36
- - lib/controller/info_controller.rb
37
- - lib/controller/webs_controller.rb
38
- - lib/helper/application.rb
39
- - lib/helper/params.rb
40
- - lib/helper/tags.rb
41
- - lib/views/layouts/webs_page.html.erb
42
- - lib/views/layouts/webs_utility.html.erb
43
- - lib/test/webs_test_helper.rb
44
- - lib/views/shared/_webs_info.html.erb
28
+ - README.rdoc
29
+ - lib/webs.rb
30
+ - lib/cache/cache.rb
31
+ - lib/config/webs_constants.rb
32
+ - lib/config/webs_initializer.rb
33
+ - lib/controller/url_for_context_path.rb
34
+ - lib/controller/alive_controller.rb
35
+ - lib/controller/info_controller.rb
36
+ - lib/controller/webs_controller.rb
37
+ - lib/helper/application.rb
38
+ - lib/helper/params.rb
39
+ - lib/helper/tags.rb
40
+ - lib/views/layouts/webs_page.html.erb
41
+ - lib/views/layouts/webs_utility.html.erb
42
+ - lib/test/webs_test_helper.rb
43
+ - lib/views/shared/_webs_info.html.erb
45
44
  files:
46
- - README.rdoc
47
- - lib/webs.rb
48
- - lib/cache/cache.rb
49
- - lib/config/webs_constants.rb
50
- - lib/config/webs_initializer.rb
51
- - lib/controller/url_for_context_path.rb
52
- - lib/controller/alive_controller.rb
53
- - lib/controller/info_controller.rb
54
- - lib/controller/webs_controller.rb
55
- - lib/helper/application.rb
56
- - lib/helper/params.rb
57
- - lib/helper/tags.rb
58
- - lib/views/layouts/webs_page.html.erb
59
- - lib/views/layouts/webs_utility.html.erb
60
- - lib/test/webs_test_helper.rb
61
- - lib/views/shared/_webs_info.html.erb
62
- - Rakefile
63
- - webs.gemspec
45
+ - README.rdoc
46
+ - lib/webs.rb
47
+ - lib/cache/cache.rb
48
+ - lib/config/webs_constants.rb
49
+ - lib/config/webs_initializer.rb
50
+ - lib/controller/url_for_context_path.rb
51
+ - lib/controller/alive_controller.rb
52
+ - lib/controller/info_controller.rb
53
+ - lib/controller/webs_controller.rb
54
+ - lib/helper/application.rb
55
+ - lib/helper/params.rb
56
+ - lib/helper/tags.rb
57
+ - lib/views/layouts/webs_page.html.erb
58
+ - lib/views/layouts/webs_utility.html.erb
59
+ - lib/test/webs_test_helper.rb
60
+ - lib/views/shared/_webs_info.html.erb
61
+ - Rakefile
62
+ - webs.gemspec
64
63
  has_rdoc: true
65
64
  homepage: http://github.com/websdotcom/websgem
66
65
  licenses: []
67
66
 
68
67
  post_install_message:
69
68
  rdoc_options:
70
- - --line-numbers
71
- - --inline-source
72
- - --title
73
- - Webs
74
- - --main
75
- - README.rdoc
69
+ - --line-numbers
70
+ - --inline-source
71
+ - --title
72
+ - Webs
73
+ - --main
74
+ - README.rdoc
76
75
  require_paths:
77
- - lib
76
+ - lib
78
77
  required_ruby_version: !ruby/object:Gem::Requirement
79
- none: false
80
78
  requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
87
84
  required_rubygems_version: !ruby/object:Gem::Requirement
88
- none: false
89
85
  requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 11
93
- segments:
94
- - 1
95
- - 2
96
- version: "1.2"
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ segments:
89
+ - 1
90
+ - 2
91
+ version: "1.2"
97
92
  requirements: []
98
93
 
99
94
  rubyforge_project: webs
100
- rubygems_version: 1.3.7
95
+ rubygems_version: 1.3.6
101
96
  signing_key:
102
97
  specification_version: 3
103
98
  summary: Reusable webs stuff.