ramaze 2012.04.14 → 2012.12.08b

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 (146) hide show
  1. data/.gems +28 -35
  2. data/.gitignore +4 -0
  3. data/.travis.yml +3 -3
  4. data/Gemfile +3 -0
  5. data/README.md +1 -5
  6. data/Rakefile +9 -20
  7. data/examples/app/blog/app.rb +5 -14
  8. data/examples/app/todolist/start.rb +1 -5
  9. data/guide/AUTHORS +8 -3
  10. data/guide/CHANGELOG +587 -0
  11. data/guide/general/cache.md +1 -0
  12. data/guide/general/configuration.md +2 -1
  13. data/guide/general/contributing.md +1 -0
  14. data/guide/general/controllers.md +105 -10
  15. data/guide/general/helpers.md +6 -7
  16. data/guide/general/installation.md +2 -1
  17. data/guide/general/logging.md +1 -4
  18. data/guide/general/middlewares.md +15 -23
  19. data/guide/general/models.md +1 -0
  20. data/guide/general/principles.md +1 -0
  21. data/guide/general/ramaze_command.md +9 -54
  22. data/guide/general/routes.md +1 -0
  23. data/guide/general/sessions.md +3 -2
  24. data/guide/general/special_thanks.md +1 -0
  25. data/guide/general/testing.md +1 -0
  26. data/guide/general/views.md +35 -22
  27. data/lib/proto/Gemfile +4 -0
  28. data/lib/proto/README.md +35 -0
  29. data/lib/proto/Rakefile +1 -0
  30. data/lib/proto/app.rb +2 -6
  31. data/lib/proto/spec/helper.rb +39 -0
  32. data/lib/proto/task/ramaze.rake +57 -0
  33. data/lib/ramaze.rb +12 -39
  34. data/lib/ramaze/bin/create.rb +1 -3
  35. data/lib/ramaze/bin/runner.rb +0 -14
  36. data/lib/ramaze/cache.rb +21 -0
  37. data/lib/ramaze/cache/memcache.rb +1 -3
  38. data/lib/ramaze/cache/redis.rb +2 -4
  39. data/lib/ramaze/cache/sequel.rb +4 -5
  40. data/lib/ramaze/controller.rb +10 -3
  41. data/lib/ramaze/default_middleware.rb +24 -0
  42. data/lib/ramaze/files.rb +5 -5
  43. data/lib/ramaze/gestalt.rb +10 -10
  44. data/lib/ramaze/helper/blue_form.rb +33 -6
  45. data/lib/ramaze/helper/csrf.rb +22 -30
  46. data/lib/ramaze/helper/flash.rb +1 -1
  47. data/lib/ramaze/helper/upload.rb +5 -3
  48. data/lib/ramaze/helper/user.rb +1 -0
  49. data/lib/ramaze/log.rb +0 -5
  50. data/lib/ramaze/log/informer.rb +3 -3
  51. data/lib/ramaze/log/logging.rb +4 -4
  52. data/lib/ramaze/log/syslog.rb +2 -2
  53. data/lib/ramaze/response.rb +1 -1
  54. data/lib/ramaze/snippets.rb +0 -20
  55. data/lib/ramaze/spec/bacon.rb +5 -13
  56. data/lib/ramaze/version.rb +1 -1
  57. data/lib/ramaze/view/erector.rb +1 -3
  58. data/lib/ramaze/view/erubis.rb +1 -3
  59. data/lib/ramaze/view/ezamar.rb +1 -3
  60. data/lib/ramaze/view/haml.rb +1 -4
  61. data/lib/ramaze/view/liquid.rb +1 -3
  62. data/lib/ramaze/view/lokar.rb +1 -3
  63. data/lib/ramaze/view/mustache.rb +1 -3
  64. data/lib/ramaze/view/nagoro.rb +1 -4
  65. data/lib/ramaze/view/remarkably.rb +1 -4
  66. data/lib/ramaze/view/sass.rb +2 -5
  67. data/lib/ramaze/view/slim.rb +1 -3
  68. data/lib/ramaze/view/slippers.rb +1 -3
  69. data/lib/ramaze/view/tagz.rb +1 -3
  70. data/lib/ramaze/view/tenjin.rb +1 -3
  71. data/ramaze.gemspec +45 -16
  72. data/spec/helper.rb +0 -1
  73. data/spec/ramaze/cache/localmemcache.rb +0 -4
  74. data/spec/ramaze/controller/mapping.rb +17 -0
  75. data/spec/ramaze/dispatcher/directory.rb +6 -5
  76. data/spec/ramaze/dispatcher/file.rb +7 -4
  77. data/spec/ramaze/files.rb +0 -2
  78. data/spec/ramaze/helper/csrf.rb +0 -26
  79. data/spec/ramaze/helper/upload.rb +1 -0
  80. data/spec/ramaze/helper/user.rb +12 -0
  81. data/spec/ramaze/log/syslog.rb +5 -1
  82. data/spec/ramaze/view/lokar.rb +1 -1
  83. data/spec/ramaze/view/nagoro.rb +1 -1
  84. data/tasks/bacon.rake +1 -1
  85. data/tasks/gems.rake +15 -0
  86. data/tasks/release.rake +37 -8
  87. metadata +106 -139
  88. data/guide/_static/ramaze_console.png +0 -0
  89. data/guide/tutorials/introduction.md +0 -263
  90. data/lib/proto/model/init.rb +0 -6
  91. data/lib/proto/public/.htaccess +0 -24
  92. data/lib/proto/public/dispatch.fcgi +0 -11
  93. data/lib/proto/spec/main.rb +0 -20
  94. data/lib/proto/start.rb +0 -20
  95. data/lib/ramaze/app_graph.rb +0 -105
  96. data/lib/ramaze/bin/console.rb +0 -87
  97. data/lib/ramaze/bin/helper.rb +0 -107
  98. data/lib/ramaze/bin/restart.rb +0 -95
  99. data/lib/ramaze/bin/start.rb +0 -221
  100. data/lib/ramaze/bin/status.rb +0 -152
  101. data/lib/ramaze/bin/stop.rb +0 -112
  102. data/lib/ramaze/dependencies.rb +0 -84
  103. data/lib/ramaze/helper/disqus.rb +0 -27
  104. data/lib/ramaze/helper/ultraviolet.rb +0 -49
  105. data/lib/ramaze/log/analogger.rb +0 -50
  106. data/lib/ramaze/log/growl.rb +0 -55
  107. data/lib/ramaze/log/knotify.rb +0 -31
  108. data/lib/ramaze/log/xosd.rb +0 -94
  109. data/lib/ramaze/middleware_compiler.rb +0 -36
  110. data/lib/ramaze/plugin.rb +0 -69
  111. data/lib/ramaze/setup.rb +0 -210
  112. data/lib/ramaze/snippets/array/put_within.rb +0 -38
  113. data/lib/ramaze/snippets/binding/locals.rb +0 -20
  114. data/lib/ramaze/snippets/fiber.rb +0 -41
  115. data/lib/ramaze/snippets/kernel/pretty_inspect.rb +0 -18
  116. data/lib/ramaze/snippets/metaid.rb +0 -17
  117. data/lib/ramaze/snippets/numeric/filesize_format.rb +0 -30
  118. data/lib/ramaze/snippets/numeric/time.rb +0 -59
  119. data/lib/ramaze/snippets/object/instance_variable_defined.rb +0 -16
  120. data/lib/ramaze/snippets/object/pretty.rb +0 -12
  121. data/lib/ramaze/snippets/object/scope.rb +0 -16
  122. data/lib/ramaze/snippets/ordered_set.rb +0 -51
  123. data/lib/ramaze/snippets/proc/locals.rb +0 -19
  124. data/lib/ramaze/snippets/ramaze/acquire.rb +0 -32
  125. data/lib/ramaze/snippets/ramaze/dictionary.rb +0 -400
  126. data/lib/ramaze/snippets/ramaze/fiber.rb +0 -24
  127. data/lib/ramaze/snippets/ramaze/struct.rb +0 -43
  128. data/lib/ramaze/snippets/string/end_with.rb +0 -17
  129. data/lib/ramaze/snippets/string/ord.rb +0 -16
  130. data/lib/ramaze/snippets/string/start_with.rb +0 -14
  131. data/lib/ramaze/snippets/thread/into.rb +0 -16
  132. data/lib/ramaze/spec.rb +0 -4
  133. data/spec/ramaze/bin/start.rb +0 -34
  134. data/spec/ramaze/log/growl.rb +0 -45
  135. data/spec/ramaze/struct.rb +0 -50
  136. data/spec/snippets/array/put_within.rb +0 -38
  137. data/spec/snippets/binding/locals.rb +0 -12
  138. data/spec/snippets/numeric/filesize_format.rb +0 -15
  139. data/spec/snippets/numeric/time.rb +0 -15
  140. data/spec/snippets/ordered_set.rb +0 -66
  141. data/spec/snippets/ramaze/acquire.rb +0 -80
  142. data/spec/snippets/ramaze/dictionary.rb +0 -113
  143. data/spec/snippets/ramaze/struct.rb +0 -15
  144. data/spec/snippets/thread/into.rb +0 -12
  145. data/tasks/gem.rake +0 -21
  146. data/tasks/setup.rake +0 -14
@@ -1,24 +0,0 @@
1
- module Ramaze
2
- class Fiber < ::Fiber
3
- # initialize isn't being called, so we have to hook into ::new
4
- def self.new(*args)
5
- instance = super
6
- instance.state = {}
7
- instance
8
- end
9
-
10
- attr_accessor :state
11
-
12
- def [](key)
13
- @state[key]
14
- end
15
-
16
- def []=(key, value)
17
- @state[key] = value
18
- end
19
-
20
- def key?(key)
21
- @state.key?(key)
22
- end
23
- end if defined?(::Fiber)
24
- end # Ramaze
@@ -1,43 +0,0 @@
1
-
2
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
3
- # All files in this distribution are subject to the terms of the MIT license.
4
-
5
- module Ramaze
6
- class Struct < ::Struct
7
- # Makes it possible to access the keys directly by their name, not only
8
- # their index. The original Struct#values_at tries to call #to_int on the
9
- # arguments.
10
- # in Ruby < 1.9 this would lead to a quite unintuitive IndexError, while
11
- # in 1.9 it will say outright that it cannot convert Symbol into Integer.
12
- # I think this is neither useful nor expected, so we extend
13
- # Struct#values_at to recognize valid members of the Struct passed into
14
- # the method and return their values in the same order, just like
15
- # Hash#values_at.
16
- #
17
- # Example:
18
- # Point = Struct.new(:x, :y)
19
- # point = Point.new(15, 10)
20
- #
21
- # # Old behaviour:
22
- # point.values_at(0, 1)
23
- # # => [15, 10]
24
- # point.values_at(0..1)
25
- # # => [15, 10]
26
- # point.values_at(:y, :x)
27
- # # => IndexError: offset 20697 too large for struct(size:2)
28
- #
29
- # # Added new behaviour:
30
- # point.values_at(:y, :x)
31
- # # => [10, 15]
32
- def values_at(*keys)
33
- keys.map do |key|
34
- case key
35
- when String, Symbol
36
- self[key]
37
- else
38
- return super
39
- end
40
- end
41
- end
42
- end # Struct
43
- end # Ramaze
@@ -1,17 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- module Ramaze
5
- module CoreExtensions
6
- # Extensions for String
7
- module String
8
- unless ''.respond_to?(:end_with?)
9
- # Compatibility with 1.9
10
- def end_with?(other)
11
- other = other.to_s
12
- self[-other.size, other.size] == other
13
- end
14
- end
15
- end # String
16
- end # CoreExtensions
17
- end # Ramaze
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- module Ramaze
5
- module CoreExtensions
6
- # Extensions for String
7
- module String
8
- unless ''.respond_to?(:ord)
9
- # compatibility with Ruby 1.9
10
- def ord
11
- self[0]
12
- end
13
- end
14
- end # String
15
- end # CoreExtensions
16
- end # Ramaze
@@ -1,14 +0,0 @@
1
- module Ramaze
2
- module CoreExtensions
3
- # Extensions for String
4
- module String
5
- unless ''.respond_to?(:start_with?)
6
- # Compatibility with 1.9
7
- def start_with?(other)
8
- other = other.to_s
9
- self[0, other.size] == other
10
- end
11
- end
12
- end # String
13
- end # CoreExtensions
14
- end # Ramaze
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- # Extensions for Thread
5
- class Thread
6
- # Copy all thread variables into the new thread
7
- def self.into(*args)
8
- Thread.new(Thread.current, *args) do |thread, *thread_args|
9
- thread.keys.each do |k|
10
- Thread.current[k] = thread[k] unless k.to_s =~ /^__/
11
- end
12
-
13
- yield(*thread_args)
14
- end
15
- end
16
- end # Thread
@@ -1,4 +0,0 @@
1
- require File.expand_path('../', __FILE__) unless defined?(Ramaze)
2
-
3
- Ramaze.deprecated "require('ramaze/spec')", "require('ramaze/spec/bacon')"
4
- require File.expand_path('../spec/bacon', __FILE__)
@@ -1,34 +0,0 @@
1
- require File.expand_path('../../../../spec/helper', __FILE__)
2
- require __DIR__('../../../lib/ramaze/bin/runner')
3
-
4
- module Ramaze
5
- module Bin
6
- class Start
7
- # Stub the method so that WEBrick doesn't have to be booted up.
8
- def start_server(rackup_path, rackup_config, *params)
9
- return true
10
- end
11
- end
12
- end
13
- end
14
-
15
- describe('Ramaze::Bin::Start') do
16
- it('Should show a help message') do
17
- help = `#{Ramaze::BINPATH} start -h`.strip
18
-
19
- help.include?(Ramaze::Bin::Start::Banner).should === true
20
- end
21
-
22
- it('Start using a directory') do
23
- cmd = Ramaze::Bin::Start.new
24
-
25
- cmd.run([Ramaze::BIN_APP]).should == true
26
- end
27
-
28
- it('Start using a file') do
29
- path = File.join(Ramaze::BIN_APP, 'config.ru')
30
- cmd = Ramaze::Bin::Start.new
31
-
32
- cmd.run([path]).should == true
33
- end
34
- end
@@ -1,45 +0,0 @@
1
- require File.expand_path('../../../../spec/helper', __FILE__)
2
-
3
- spec_precondition 'ruby-growl should be supported' do
4
- should.flunk if Ramaze::UNSUPPORTED_GEMS.include?('ruby-growl')
5
- end
6
-
7
- spec_require 'ruby-growl'
8
-
9
- spec_precondition 'Growl should be running' do
10
- begin
11
- growl = Ramaze::Logger::Growl.new
12
- growl.log(:info, 'Ramaze connection test')
13
- rescue
14
- should.flunk 'Growl is not running'
15
- end
16
- end
17
-
18
- require 'ramaze/log/growl'
19
-
20
- # Configure Growl, make sure your growl server matches
21
- # these settings.
22
- Ramaze::Logger::Growl.trait[:defaults][:name] = 'ramaze'
23
- Ramaze::Logger::Growl.trait[:defaults][:password] = 'ramaze'
24
-
25
- describe Ramaze::Logger::Growl do
26
- it 'Create a new instance of the Growl logger' do
27
- growl = Ramaze::Logger::Growl.new
28
-
29
- growl.should.respond_to? :log
30
- end
31
-
32
- it 'Send a growl notification' do
33
- growl = Ramaze::Logger::Growl.new
34
- growl.log(:info, 'Hello, Ramaze!')
35
-
36
- # The Growl library doesn't seem to return anything,
37
- # let's ask the user if the notification was sent
38
- print "Did you see the the notification? (y/n) "
39
- response = gets.strip
40
-
41
- response.should.satisfy do |object|
42
- object === 'y' or object === 'yes'
43
- end
44
- end
45
- end
@@ -1,50 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- require File.expand_path('../../../spec/helper', __FILE__)
5
-
6
- Point = Ramaze::Struct.new(:x,:y)
7
-
8
- describe "Ramaze::Struct" do
9
- describe '#values_at' do
10
- @point = Point.new(1,2)
11
-
12
- it "should access a single value" do
13
- @point.values_at(:x).should == [1]
14
- end
15
-
16
- it "should access multiple values" do
17
- @point.values_at(:x,:y).should == [1,2]
18
- end
19
-
20
- it "should access values regardless of order" do
21
- @point.values_at(:y,:x).should == [2,1]
22
- end
23
-
24
- it "should get same value twice" do
25
- @point.values_at(:x,:x).should == [1,1]
26
- end
27
-
28
- it "should raise on wrong value" do
29
- should.raise(NameError){
30
- @point.values_at(:k)
31
- }
32
- end
33
-
34
- it "should work with strings" do
35
- @point.values_at('x').should == [1]
36
- end
37
-
38
- it "should work with numbers (ruby compat)" do
39
- @point.values_at(0).should == [1]
40
- end
41
-
42
- should 'work with ranges' do
43
- @point.values_at(0..1).should == [1,2]
44
- end
45
-
46
- should 'work with multiple ranges' do
47
- @point.values_at(0..1, 0..1).should == [1,2,1,2]
48
- end
49
- end
50
- end
@@ -1,38 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
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
13
-
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
21
- end
22
-
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
29
- end
30
-
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
37
- end
38
- end
@@ -1,12 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
-
6
- describe 'locals' do
7
- should 'find locals' do
8
- a = 1
9
- b = 2
10
- binding.locals.should == {'a' => 1, 'b' => 2}
11
- end
12
- end
@@ -1,15 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
-
6
- describe "Numeric#filesize_format" do
7
- it 'it should convert filesizes to human readable format' do
8
- 1.filesize_format.should == '1'
9
- 1024.filesize_format.should == '1.0K'
10
- (1 << 20).filesize_format.should == '1.0M'
11
- (1 << 20).filesize_format.should == '1.0M'
12
- (1 << 30).filesize_format.should == '1.0G'
13
- (1 << 40).filesize_format.should == '1.0T'
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
-
6
- describe "Numeric time extensions" do
7
- it 'should provide times in the past' do
8
- 3.days.ago.to_i.should == (Time.now - 3*24*60*60).to_i
9
- 2.months.ago.to_i.should == (Time.now - 2*30*24*60*60).to_i
10
- end
11
-
12
- it 'should provide times in the future' do
13
- 2.weeks.from_now.to_i.should == (Time.now + 2*7*24*60*60).to_i
14
- end
15
- end
@@ -1,66 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- require File.expand_path('../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
-
6
- describe 'OrderedSet' do
7
- os = OrderedSet.new(1,2,3,1)
8
-
9
- it 'should create sets' do
10
- OrderedSet.new.should == []
11
- OrderedSet.new(1).should == [1]
12
- OrderedSet.new(1,2).should == [1,2]
13
- OrderedSet.new([1,2,3]).should == [1,2,3]
14
- end
15
-
16
- it 'should compare sets' do
17
- os.should == OrderedSet.new(1,2,3,1)
18
- os.should == OrderedSet.new([1,2,3,1])
19
- end
20
-
21
- it 'should not contain duplicates' do
22
- os.should == [1,2,3]
23
- end
24
-
25
- it 'should not duplicate entries' do
26
- os << 4
27
- os.should == [1,2,3,4]
28
-
29
- os << 4
30
- os.should == [1,2,3,4]
31
- end
32
-
33
- it 'should append with push and prepend with unshift' do
34
- os.push 1
35
- os.should == [2,3,4,1]
36
-
37
- os.unshift 1
38
- os.should == [1,2,3,4]
39
-
40
- os.push [1,2]
41
- os.should == [1,2,3,4,[1,2]]
42
-
43
- os.unshift [1,2]
44
- os.should == [[1,2],1,2,3,4]
45
- end
46
-
47
- it 'should support Array#[]=' do
48
- os = OrderedSet.new(1)
49
- os.should == [1]
50
-
51
- os[0] = 1
52
- os.should == [1]
53
-
54
- os[1,0] = [3,4,5,1]
55
- os.should == [3,4,5,1]
56
-
57
- os[0,0] = [1,2]
58
- os.should == [1,2,3,4,5]
59
-
60
- os[5..5] = [7,8,1,2]
61
- os.should == [3,4,5,7,8,1,2]
62
-
63
- os[1..2] = 3
64
- os.should == [3,7,8,1,2]
65
- end
66
- end
@@ -1,80 +0,0 @@
1
- # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the MIT license.
3
-
4
- require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
5
- require 'fileutils'
6
-
7
-
8
- # Mock require to only record attempts
9
- $required = []
10
-
11
- module Ramaze
12
- def self.require(name)
13
- $required << name
14
- end
15
- end
16
-
17
- describe 'Ramaze::acquire' do
18
- before do
19
- dir = 'tmp_dir_for_acquire'
20
- FileUtils.mkdir_p(dir + '/sub')
21
-
22
- %w[ foo.rb bar.rb baz.so baz.yml sub/baz.rb ].
23
- each do |path|
24
- FileUtils.touch("#{dir}/#{path}")
25
- end
26
-
27
- $required = []
28
- end
29
-
30
- it 'should not load a single file' do
31
- Ramaze::acquire 'tmp_dir_for_acquire/foo'
32
- $required.should == []
33
- end
34
-
35
- it 'should load dir' do
36
- Ramaze::acquire 'tmp_dir_for_acquire/sub/*'
37
- $required.should == %w[
38
- tmp_dir_for_acquire/sub/baz.rb]
39
- end
40
-
41
- it 'should be aliased to acquire' do
42
- Ramaze::acquire 'tmp_dir_for_acquire/sub/*'
43
- $required.should.not.be.empty
44
- end
45
-
46
- it 'should load {so,rb}, not others' do
47
- Ramaze::acquire 'tmp_dir_for_acquire/*'
48
- $required.sort.should == %w[
49
- tmp_dir_for_acquire/bar.rb
50
- tmp_dir_for_acquire/baz.so
51
- tmp_dir_for_acquire/foo.rb]
52
- end
53
-
54
- it 'should use globbing' do
55
- Ramaze::acquire 'tmp_dir_for_acquire/ba*'
56
- $required.sort.should == %w[
57
- tmp_dir_for_acquire/bar.rb
58
- tmp_dir_for_acquire/baz.so]
59
- end
60
-
61
- it 'should use recursive globbing' do
62
- Ramaze::acquire 'tmp_dir_for_acquire/**/*'
63
- $required.sort.should == %w[
64
- tmp_dir_for_acquire/bar.rb
65
- tmp_dir_for_acquire/baz.so
66
- tmp_dir_for_acquire/foo.rb
67
- tmp_dir_for_acquire/sub/baz.rb]
68
- end
69
-
70
- it 'should accept multiple arguments' do
71
- Ramaze::acquire 'tmp_dir_for_acquire/*', 'tmp_dir_for_acquire/sub/*'
72
- $required.sort.should == %w[
73
- tmp_dir_for_acquire/bar.rb
74
- tmp_dir_for_acquire/baz.so
75
- tmp_dir_for_acquire/foo.rb
76
- tmp_dir_for_acquire/sub/baz.rb]
77
- end
78
-
79
- FileUtils.rm_rf('tmp_dir_for_acquire')
80
- end