ramaze 2009.06.12 → 2009.07

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/MANIFEST +10 -0
  2. data/README.md +4 -9
  3. data/Rakefile +30 -21
  4. data/doc/AUTHORS +1 -1
  5. data/doc/CHANGELOG +144 -0
  6. data/doc/meta/announcement.txt +47 -76
  7. data/examples/misc/css.rb +6 -12
  8. data/lib/proto/app.rb +4 -5
  9. data/lib/proto/controller/init.rb +1 -1
  10. data/lib/proto/spec/main.rb +3 -4
  11. data/lib/ramaze.rb +0 -2
  12. data/lib/ramaze/app.rb +4 -3
  13. data/lib/ramaze/cache.rb +1 -0
  14. data/lib/ramaze/cache/lru.rb +42 -0
  15. data/lib/ramaze/contrib/addressable_route.rb +10 -9
  16. data/lib/ramaze/controller.rb +1 -3
  17. data/lib/ramaze/helper/blue_form.rb +214 -0
  18. data/lib/ramaze/helper/cache.rb +44 -9
  19. data/lib/ramaze/helper/formatting.rb +5 -2
  20. data/lib/ramaze/helper/layout.rb +2 -2
  21. data/lib/ramaze/helper/paginate.rb +28 -33
  22. data/lib/ramaze/request.rb +1 -1
  23. data/lib/ramaze/snippets/ramaze/lru_hash.rb +248 -0
  24. data/lib/ramaze/spec/bacon.rb +5 -0
  25. data/lib/ramaze/spec/helper/template_examples.rb +4 -1
  26. data/lib/ramaze/version.rb +1 -1
  27. data/lib/ramaze/view.rb +4 -3
  28. data/lib/ramaze/view/less.rb +12 -0
  29. data/ramaze.gemspec +27 -24
  30. data/spec/contrib/addressable_route.rb +3 -5
  31. data/spec/contrib/rest.rb +1 -1
  32. data/spec/examples/caching.rb +2 -2
  33. data/spec/examples/css.rb +2 -2
  34. data/spec/examples/element.rb +2 -2
  35. data/spec/examples/hello.rb +2 -2
  36. data/spec/examples/helpers/httpdigest.rb +2 -2
  37. data/spec/examples/linking.rb +2 -2
  38. data/spec/examples/simple.rb +2 -2
  39. data/spec/examples/templates/template_erubis.rb +5 -2
  40. data/spec/examples/templates/template_ezamar.rb +5 -2
  41. data/spec/examples/templates/template_haml.rb +5 -2
  42. data/spec/examples/templates/template_liquid.rb +5 -2
  43. data/spec/examples/templates/template_markaby.rb +5 -2
  44. data/spec/examples/templates/template_nagoro.rb +5 -2
  45. data/spec/examples/templates/template_redcloth.rb +5 -2
  46. data/spec/examples/templates/template_remarkably.rb +5 -2
  47. data/spec/examples/templates/template_tenjin.rb +5 -2
  48. data/spec/ramaze/action/render.rb +4 -1
  49. data/spec/ramaze/app.rb +4 -1
  50. data/spec/ramaze/app/location.rb +43 -0
  51. data/spec/ramaze/bin/ramaze.rb +7 -2
  52. data/spec/ramaze/cache/localmemcache.rb +1 -1
  53. data/spec/ramaze/cache/lru.rb +48 -0
  54. data/spec/ramaze/cache/memcache.rb +1 -1
  55. data/spec/ramaze/cache/sequel.rb +1 -1
  56. data/spec/ramaze/controller/actionless_templates.rb +1 -1
  57. data/spec/ramaze/controller/lonely_mapping.rb +3 -1
  58. data/spec/ramaze/controller/mapping.rb +4 -1
  59. data/spec/ramaze/controller/provide_inheritance.rb +4 -1
  60. data/spec/ramaze/controller/resolve.rb +1 -1
  61. data/spec/ramaze/controller/subclass.rb +1 -1
  62. data/spec/ramaze/controller/template_resolving.rb +1 -1
  63. data/spec/ramaze/dispatcher/directory.rb +4 -1
  64. data/spec/ramaze/dispatcher/file.rb +8 -8
  65. data/spec/ramaze/error.rb +1 -1
  66. data/spec/ramaze/files.rb +4 -1
  67. data/spec/ramaze/gestalt.rb +4 -1
  68. data/spec/ramaze/helper/auth.rb +1 -1
  69. data/spec/ramaze/helper/bench.rb +4 -1
  70. data/spec/ramaze/helper/blue_form.rb +433 -0
  71. data/spec/ramaze/helper/cache.rb +2 -2
  72. data/spec/ramaze/helper/flash.rb +1 -1
  73. data/spec/ramaze/helper/form.rb +4 -1
  74. data/spec/ramaze/helper/formatting.rb +4 -1
  75. data/spec/ramaze/helper/gestalt.rb +4 -1
  76. data/spec/ramaze/helper/gravatar.rb +4 -1
  77. data/spec/ramaze/helper/httpdigest.rb +4 -1
  78. data/spec/ramaze/helper/layout.rb +1 -1
  79. data/spec/ramaze/helper/link.rb +1 -1
  80. data/spec/ramaze/helper/localize.rb +4 -1
  81. data/spec/ramaze/helper/maruku.rb +4 -1
  82. data/spec/ramaze/helper/pager.rb +1 -1
  83. data/spec/ramaze/helper/paginate.rb +4 -1
  84. data/spec/ramaze/helper/request_accessor.rb +4 -1
  85. data/spec/ramaze/helper/sequel_form.rb +4 -1
  86. data/spec/ramaze/helper/simple_captcha.rb +1 -1
  87. data/spec/ramaze/helper/stack.rb +1 -1
  88. data/spec/ramaze/helper/user.rb +4 -1
  89. data/spec/ramaze/helper/xhtml.rb +4 -1
  90. data/spec/ramaze/log/informer.rb +1 -1
  91. data/spec/ramaze/log/logging.rb +4 -1
  92. data/spec/ramaze/log/syslog.rb +6 -6
  93. data/spec/ramaze/params.rb +1 -1
  94. data/spec/ramaze/request.rb +4 -1
  95. data/spec/ramaze/session/memcache.rb +1 -1
  96. data/spec/ramaze/struct.rb +4 -1
  97. data/spec/ramaze/view.rb +1 -1
  98. data/spec/ramaze/view/erubis.rb +1 -1
  99. data/spec/ramaze/view/ezamar.rb +1 -1
  100. data/spec/ramaze/view/gestalt.rb +2 -2
  101. data/spec/ramaze/view/haml.rb +1 -1
  102. data/spec/ramaze/view/less.rb +60 -0
  103. data/spec/ramaze/view/less/file.css.less +8 -0
  104. data/spec/ramaze/view/liquid.rb +1 -1
  105. data/spec/ramaze/view/nagoro.rb +1 -1
  106. data/spec/ramaze/view/redcloth.rb +1 -1
  107. data/spec/ramaze/view/remarkably.rb +1 -1
  108. data/spec/ramaze/view/sass.rb +1 -1
  109. data/spec/ramaze/view/tagz.rb +1 -1
  110. data/spec/ramaze/view/tenjin.rb +1 -1
  111. data/spec/snippets/array/put_within.rb +30 -25
  112. data/spec/snippets/binding/locals.rb +4 -1
  113. data/spec/snippets/numeric/filesize_format.rb +4 -1
  114. data/spec/snippets/numeric/time.rb +5 -2
  115. data/spec/snippets/object/__dir__.rb +4 -1
  116. data/spec/snippets/ordered_set.rb +4 -1
  117. data/spec/snippets/ramaze/acquire.rb +4 -1
  118. data/spec/snippets/ramaze/dictionary.rb +4 -1
  119. data/spec/snippets/ramaze/lru_hash.rb +88 -0
  120. data/spec/snippets/ramaze/struct.rb +4 -1
  121. data/spec/snippets/string/camel_case.rb +4 -1
  122. data/spec/snippets/string/color.rb +4 -1
  123. data/spec/snippets/string/snake_case.rb +4 -1
  124. data/spec/snippets/string/unindent.rb +4 -1
  125. data/spec/snippets/thread/into.rb +4 -1
  126. data/tasks/bacon.rake +8 -2
  127. data/tasks/gem_setup.rake +21 -8
  128. data/tasks/setup.rake +8 -2
  129. metadata +29 -9
@@ -1,7 +1,7 @@
1
1
  # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
- require 'spec/helper'
4
+ require File.expand_path('../../../../spec/helper', __FILE__)
5
5
  spec_require 'remarkably'
6
6
 
7
7
  Ramaze::App.options.views = 'remarkably'
@@ -1,7 +1,7 @@
1
1
  # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
- require 'spec/helper'
4
+ require File.expand_path('../../../../spec/helper', __FILE__)
5
5
  spec_require 'haml/util', 'sass/engine'
6
6
 
7
7
  Ramaze::App.options.views = 'sass'
@@ -1,7 +1,7 @@
1
1
  # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
- require 'spec/helper'
4
+ require File.expand_path('../../../../spec/helper', __FILE__)
5
5
  spec_require 'tagz'
6
6
 
7
7
  Ramaze::App.options.views = 'tagz'
@@ -1,7 +1,7 @@
1
1
  # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
- require 'spec/helper'
4
+ require File.expand_path('../../../../spec/helper', __FILE__)
5
5
  spec_require 'tenjin'
6
6
 
7
7
  Ramaze::App.options.views = 'tenjin'
@@ -1,33 +1,38 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
2
3
 
3
- describe 'Array#put_within' do
4
- it 'should put a given object at a well-described position' do
5
- array = [:foo, :bar, :baz]
6
- array.put_within(:foobar, :after => :bar, :before => :baz)
7
- array.should == [:foo, :bar, :foobar, :baz]
8
- end
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
+
6
+ describe 'Array' do
7
+ describe '#put_within' do
8
+ it 'puts a given object at a well-described position' do
9
+ array = [:foo, :bar, :baz]
10
+ array.put_within(:foobar, :after => :bar, :before => :baz)
11
+ array.should == [:foo, :bar, :foobar, :baz]
12
+ end
9
13
 
10
- it 'should raise on uncertainity' do
11
- array = [:foo, :bar, :baz]
12
- lambda{
13
- array.put_within(:foobar, :after => :foo, :before => :baz)
14
- }.should.raise(ArgumentError).
15
- message.should == "Too many elements within constrain"
14
+ it 'raises on uncertainity' do
15
+ array = [:foo, :bar, :baz]
16
+ lambda{
17
+ array.put_within(:foobar, :after => :foo, :before => :baz)
18
+ }.should.raise(ArgumentError).
19
+ message.should == "Too many elements within constrain"
20
+ end
16
21
  end
17
- end
18
22
 
19
- describe 'Array#put_after' do
20
- it 'should put a given object at a well-described position' do
21
- array = [:foo, :bar, :baz]
22
- array.put_after(:bar, :foobar)
23
- array.should == [:foo, :bar, :foobar, :baz]
23
+ describe '#put_after' do
24
+ it 'puts a given object at a well-described position' do
25
+ array = [:foo, :bar, :baz]
26
+ array.put_after(:bar, :foobar)
27
+ array.should == [:foo, :bar, :foobar, :baz]
28
+ end
24
29
  end
25
- end
26
30
 
27
- describe 'Array#put_within' do
28
- it 'should put a given object at a well-described position' do
29
- array = [:foo, :bar, :baz]
30
- array.put_before(:bar, :foobar)
31
- array.should == [:foo, :foobar, :bar, :baz]
31
+ describe '#put_within' do
32
+ it 'puts a given object at a well-described position' do
33
+ array = [:foo, :bar, :baz]
34
+ array.put_before(:bar, :foobar)
35
+ array.should == [:foo, :foobar, :bar, :baz]
36
+ end
32
37
  end
33
38
  end
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe 'locals' do
4
7
  should 'find locals' do
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe "Numeric#filesize_format" do
4
7
  it 'it should convert filesizes to human readable format' do
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe "Numeric time extensions" do
4
7
  it 'should provide times in the past' do
@@ -9,4 +12,4 @@ describe "Numeric time extensions" do
9
12
  it 'should provide times in the future' do
10
13
  2.weeks.from_now.to_i.should == (Time.now + 2*7*24*60*60).to_i
11
14
  end
12
- end
15
+ end
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe '__DIR__' do
4
7
  # this is hardly exhaustive, but better than nothing
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe 'OrderedSet' do
4
7
  os = OrderedSet.new(1,2,3,1)
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
  require 'fileutils'
3
6
 
4
7
 
@@ -1,4 +1,7 @@
1
- require 'spec/helper'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe Ramaze::Dictionary do
4
7
  Dictionary = Ramaze::Dictionary
@@ -0,0 +1,88 @@
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
+
6
+ describe LRU = Ramaze::LRUHash do
7
+ describe 'without restrictions' do
8
+ it 'fetches via #fetch' do
9
+ lru = LRU.new
10
+
11
+ lambda{ lru.fetch(:a) }.should.raise(LRU::KeyError).message == "key not found: :a"
12
+ lru.fetch(:a, :b).should == :b
13
+ lru.fetch(:a).should == :b
14
+ lru.fetch(:c){|key| key.to_s }.should == 'c'
15
+ lru.fetch(:c).should == 'c'
16
+ end
17
+
18
+ it 'stores and retrieves values via #[]= and #[]' do
19
+ lru = LRU.new
20
+
21
+ lru[:a].should == nil
22
+ lru[:a] = :b
23
+ lru[:a].should == :b
24
+ end
25
+ end
26
+
27
+ describe 'with max_count restriction' do
28
+ it 'stores and retrieves values via #[]= and #[]' do
29
+ lru = LRU.new(:max_count => 2)
30
+
31
+ # store the allowed two
32
+ lru[:a] = :b
33
+ lru[:c] = :d
34
+
35
+ # overflow by one
36
+ lru[:e] = :f
37
+
38
+ # first content must be gone
39
+ lru.key?(:a).should == false
40
+
41
+ # access :c to keep it around
42
+ lru[:c]
43
+ lru[:g] = :h
44
+
45
+ lru.key?(:c).should == true
46
+ lru.key?(:e).should == false
47
+ end
48
+
49
+ it 'should keep some statistics' do
50
+ lru = LRU.new(:max_count => 2)
51
+ lru.statistics.should == {:size => 0, :count => 0, :hits => 0, :misses => 0}
52
+
53
+ lru[:a] = :b
54
+ lru.statistics.should == {:size => 5, :count => 1, :hits => 0, :misses => 0}
55
+
56
+ lru[:a] = :b
57
+ lru.statistics.should == {:size => 5, :count => 1, :hits => 0, :misses => 0}
58
+
59
+ lru[:c] = :d
60
+ lru.statistics.should == {:size => 10, :count => 2, :hits => 0, :misses => 0}
61
+
62
+ lru[:c]
63
+ lru.statistics.should == {:size => 10, :count => 2, :hits => 1, :misses => 0}
64
+
65
+ lru[:d]
66
+ lru.statistics.should == {:size => 10, :count => 2, :hits => 1, :misses => 1}
67
+
68
+ lru[:e] = :f
69
+ lru.statistics.should == {:size => 10, :count => 2, :hits => 1, :misses => 1}
70
+
71
+ lru[:a]
72
+ lru.statistics.should == {:size => 10, :count => 2, :hits => 1, :misses => 2}
73
+
74
+ lru.delete :e
75
+ lru.statistics.should == {:size => 5, :count => 1, :hits => 1, :misses => 2}
76
+
77
+ lru[:a] = 'foobar'
78
+ s = lru.statistics
79
+ s.delete(:size) # Differs on 1.8/1.9
80
+ s.should == {:count => 2, :hits => 1, :misses => 2}
81
+ end
82
+ end
83
+
84
+ # TODO: Still missing
85
+ # :[], :[]=, :clear, :delete, :each_key, :each_pair, :each_value, :empty?,
86
+ # :expire, :fetch, :index, :key?, :keys, :length, :size, :statistics, :store,
87
+ # :to_hash, :value?, :values
88
+ end
@@ -1,4 +1,7 @@
1
- require 'spec/helper'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe Ramaze::Struct do
4
7
  should 'provide #values_at' do
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe "String#camel_case" do
4
7
 
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe 'String#color' do
4
7
  it 'should define methods to return ANSI strings' do
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe "String#snake_case" do
4
7
 
@@ -1,4 +1,7 @@
1
- require 'lib/ramaze/spec/helper/snippets'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe "String#unindent" do
4
7
  it "should remove indentation" do
@@ -1,4 +1,7 @@
1
- require 'spec/helper'
1
+ # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
2
5
 
3
6
  describe 'Thread.into' do
4
7
  it 'should provide access to thread vars' do
@@ -16,16 +16,22 @@ task :bacon => :setup do
16
16
  left_format = "%4d/%d: %-#{len + 11}s"
17
17
  spec_format = "%d specifications (%d requirements), %d failures, %d errors"
18
18
 
19
+ load_path = File.expand_path('../../lib', __FILE__)
20
+
19
21
  specs.each_with_index do |spec, idx|
20
22
  print(left_format % [idx + 1, specs_size, spec])
21
23
 
22
- Open3.popen3(RUBY, spec) do |sin, sout, serr|
24
+ Open3.popen3(RUBY, '-I', load_path, spec) do |sin, sout, serr|
23
25
  out = sout.read.strip
24
26
  err = serr.read.strip
25
27
 
26
- # this is conventional, see spec/innate/state/fiber.rb for usage
28
+ # this is conventional
27
29
  if out =~ /^Bacon::Error: (needed .*)/
28
30
  puts(yellow % ("%6s %s" % ['', $1]))
31
+ elsif out =~ /^Spec (precondition: "[^"]*" failed)/
32
+ puts(yellow % ("%6s %s" % ['', $1]))
33
+ elsif out =~ /^Spec require: "require" failed: "(no such file to load -- [^"]*)"/
34
+ puts(yellow % ("%6s %s" % ['', $1]))
29
35
  else
30
36
  total = nil
31
37
 
@@ -44,8 +44,10 @@ task :gem_setup do
44
44
  setup
45
45
  end
46
46
 
47
- # first try to activate, install and try to activate again if activation
48
- # fails the first time
47
+ # First try to activate.
48
+ # If activation fails, try to install and activate again.
49
+ # If the second activation also fails, try to require as it may just as
50
+ # well be in $LOAD_PATH.
49
51
  def setup_gem(name, options)
50
52
  version = [options[:version]].compact
51
53
  lib_name = options[:lib] || name
@@ -53,19 +55,30 @@ task :gem_setup do
53
55
  log "activating #{name}"
54
56
 
55
57
  Gem.activate(name, *version)
56
- rescue LoadError
57
- install_gem(name, options)
58
- Gem.activate(name, *version)
58
+ rescue Gem::LoadError
59
+ log "activating #{name} failed, try to install"
60
+
61
+ install_gem(name, version, options)
59
62
  end
60
63
 
61
64
  # tell rubygems to install a gem
62
- def install_gem(name, options)
65
+ def install_gem(name, version, options)
63
66
  installer = Gem::DependencyInstaller.new(options)
64
67
 
65
68
  temp_argv(options[:extconf]) do
66
- log "Installing #{name}"
67
- installer.install(name, options[:version])
69
+ log "installing #{name}"
70
+ installer.install(name, *version)
68
71
  end
72
+
73
+ Gem.activate(name, *version)
74
+
75
+ log "install and final activation successful"
76
+ rescue Gem::GemNotFoundException => ex
77
+ log "installation failed: #{ex}, use normal require"
78
+
79
+ require(options[:lib] || name)
80
+
81
+ log "require successful, cannot verify version though"
69
82
  end
70
83
 
71
84
  # prepare ARGV for rubygems installer
@@ -1,6 +1,12 @@
1
1
  desc 'install all possible dependencies'
2
2
  task :setup => [:gem_setup] do
3
- GemSetup.new :verbose => true do
4
- setup_gemspec GEMSPEC
3
+ GemSetup.new :verbose => false do
4
+ DEPENDENCIES.each do |name, options|
5
+ gem(name, options)
6
+ end
7
+
8
+ DEVELOPMENT_DEPENDENCIES.each do |name, options|
9
+ gem(name, options)
10
+ end
5
11
  end
6
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramaze
3
3
  version: !ruby/object:Gem::Version
4
- version: 2009.06.12
4
+ version: "2009.07"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael 'manveru' Fellinger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-13 00:00:00 +09:00
12
+ date: 2009-07-25 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2009.06.12
23
+ version: "2009.07"
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: Remarkably
@@ -70,7 +70,7 @@ dependencies:
70
70
  requirements:
71
71
  - - ~>
72
72
  - !ruby/object:Gem::Version
73
- version: 2.0.9
73
+ version: 2.2.1
74
74
  version:
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: hpricot
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- version: 1.1.6
93
+ version: 1.1.7
94
94
  version:
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: liquid
@@ -110,7 +110,7 @@ dependencies:
110
110
  requirements:
111
111
  - - ~>
112
112
  - !ruby/object:Gem::Version
113
- version: 0.4.0
113
+ version: 0.4.1
114
114
  version:
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: memcache-client
@@ -120,7 +120,7 @@ dependencies:
120
120
  requirements:
121
121
  - - ~>
122
122
  - !ruby/object:Gem::Version
123
- version: 1.7.2
123
+ version: 1.7.4
124
124
  version:
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: nagoro
@@ -140,7 +140,17 @@ dependencies:
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- version: 0.3.0
143
+ version: 0.4.0
144
+ version:
145
+ - !ruby/object:Gem::Dependency
146
+ name: rack-contrib
147
+ type: :development
148
+ version_requirement:
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: 0.9.2
144
154
  version:
145
155
  - !ruby/object:Gem::Dependency
146
156
  name: sequel
@@ -150,7 +160,7 @@ dependencies:
150
160
  requirements:
151
161
  - - "="
152
162
  - !ruby/object:Gem::Version
153
- version: 3.1.0
163
+ version: 3.2.0
154
164
  version:
155
165
  - !ruby/object:Gem::Dependency
156
166
  name: tagz
@@ -392,6 +402,7 @@ files:
392
402
  - lib/ramaze/app.rb
393
403
  - lib/ramaze/cache.rb
394
404
  - lib/ramaze/cache/localmemcache.rb
405
+ - lib/ramaze/cache/lru.rb
395
406
  - lib/ramaze/cache/memcache.rb
396
407
  - lib/ramaze/cache/sequel.rb
397
408
  - lib/ramaze/contrib/addressable_route.rb
@@ -419,6 +430,7 @@ files:
419
430
  - lib/ramaze/helper.rb
420
431
  - lib/ramaze/helper/auth.rb
421
432
  - lib/ramaze/helper/bench.rb
433
+ - lib/ramaze/helper/blue_form.rb
422
434
  - lib/ramaze/helper/cache.rb
423
435
  - lib/ramaze/helper/disqus.rb
424
436
  - lib/ramaze/helper/flash.rb
@@ -486,6 +498,7 @@ files:
486
498
  - lib/ramaze/snippets/ramaze/deprecated.rb
487
499
  - lib/ramaze/snippets/ramaze/dictionary.rb
488
500
  - lib/ramaze/snippets/ramaze/fiber.rb
501
+ - lib/ramaze/snippets/ramaze/lru_hash.rb
489
502
  - lib/ramaze/snippets/ramaze/struct.rb
490
503
  - lib/ramaze/snippets/string/camel_case.rb
491
504
  - lib/ramaze/snippets/string/color.rb
@@ -511,6 +524,7 @@ files:
511
524
  - lib/ramaze/view/ezamar.rb
512
525
  - lib/ramaze/view/gestalt.rb
513
526
  - lib/ramaze/view/haml.rb
527
+ - lib/ramaze/view/less.rb
514
528
  - lib/ramaze/view/liquid.rb
515
529
  - lib/ramaze/view/maruku.rb
516
530
  - lib/ramaze/view/nagoro.rb
@@ -551,8 +565,10 @@ files:
551
565
  - spec/ramaze/action/view/sub/sub_wrapper.erb
552
566
  - spec/ramaze/action/view/sub/sub_wrapper.xhtml
553
567
  - spec/ramaze/app.rb
568
+ - spec/ramaze/app/location.rb
554
569
  - spec/ramaze/bin/ramaze.rb
555
570
  - spec/ramaze/cache/localmemcache.rb
571
+ - spec/ramaze/cache/lru.rb
556
572
  - spec/ramaze/cache/memcache.rb
557
573
  - spec/ramaze/cache/sequel.rb
558
574
  - spec/ramaze/controller/actionless_templates.rb
@@ -580,6 +596,7 @@ files:
580
596
  - spec/ramaze/gestalt.rb
581
597
  - spec/ramaze/helper/auth.rb
582
598
  - spec/ramaze/helper/bench.rb
599
+ - spec/ramaze/helper/blue_form.rb
583
600
  - spec/ramaze/helper/cache.rb
584
601
  - spec/ramaze/helper/flash.rb
585
602
  - spec/ramaze/helper/form.rb
@@ -632,6 +649,8 @@ files:
632
649
  - spec/ramaze/view/haml.rb
633
650
  - spec/ramaze/view/haml/external.haml
634
651
  - spec/ramaze/view/haml/sum.haml
652
+ - spec/ramaze/view/less.rb
653
+ - spec/ramaze/view/less/file.css.less
635
654
  - spec/ramaze/view/liquid.rb
636
655
  - spec/ramaze/view/liquid/external.liquid
637
656
  - spec/ramaze/view/liquid/sum.liquid
@@ -659,6 +678,7 @@ files:
659
678
  - spec/snippets/ordered_set.rb
660
679
  - spec/snippets/ramaze/acquire.rb
661
680
  - spec/snippets/ramaze/dictionary.rb
681
+ - spec/snippets/ramaze/lru_hash.rb
662
682
  - spec/snippets/ramaze/struct.rb
663
683
  - spec/snippets/string/camel_case.rb
664
684
  - spec/snippets/string/color.rb