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,113 +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 Ramaze::Dictionary do
7
- Dictionary = Ramaze::Dictionary
8
-
9
- should 'create' do
10
- dict = Dictionary['z', 1, 'a', 2, 'c', 3]
11
- dict.keys.should == %w[z a c]
12
- end
13
-
14
- should 'store' do
15
- dict = Dictionary.new
16
- dict['z'] = 1
17
- dict['a'] = 2
18
- dict['c'] = 3
19
- dict.keys.should == %w[z a c]
20
-
21
- dict = Dictionary.new
22
- dict[:a] = 1
23
- dict[:c] = 3
24
- dict.values.should == [1, 3]
25
- dict.keys.should == [:a, :c]
26
-
27
- dict[:b, 1] = 2
28
- dict.values.should == [1, 2, 3]
29
- dict.keys.should == [:a, :b, :c]
30
- end
31
-
32
- should 'push' do
33
- dict = Dictionary.new
34
- dict.push('end', 15).should == true
35
- dict['end'].should == 15
36
- dict.push('end', 30).should == false
37
- dict['end'].should == 15
38
- end
39
-
40
- should 'unshift' do
41
- dict = Dictionary['a', 1, 'c', 2, 'z', 3]
42
- dict.push('end', 15).should == true
43
- dict.unshift('begin', 50).should == true
44
- dict['begin'].should == 50
45
- dict.keys.should == %w[begin a c z end]
46
- end
47
-
48
- should 'pop' do
49
- dict = Dictionary['a', 1, 'c', 2, 'z', 3]
50
- dict.pop.should == ['z', 3]
51
- dict.keys.should == %w[a c]
52
- end
53
-
54
- should 'shift' do
55
- dict = Dictionary['a', 1, 'c', 2, 'z', 3]
56
- dict.shift.should == ['a', 1]
57
- dict.keys.should == %w[c z]
58
- end
59
-
60
- should 'insert' do
61
- dict_a = Dictionary['a', 1, 'b', 2, 'c', 3]
62
- dict_b = Dictionary['d', 4, 'a', 1, 'b', 2, 'c', 3]
63
-
64
- dict_a.insert(0, 'd', 4).should == 4
65
- dict_a.should == dict_b
66
-
67
- dict_c = Dictionary['a', 1, 'b', 2, 'c', 3]
68
- dict_d = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
69
-
70
- dict_c.insert(-1, 'd', 4)
71
- dict_c.should == dict_d
72
- end
73
-
74
- should 'update with Dictionary' do
75
- left = Dictionary['a', 1, 'b', 2, 'c', 3]
76
- right = Dictionary['d', 4]
77
- result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
78
-
79
- left.update(right).should == result
80
- left.should == result
81
- end
82
-
83
- should 'update with Hash' do
84
- left = Dictionary['a', 1, 'b', 2, 'c', 3]
85
- right = { 'd' => 4 }
86
- result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
87
- left.update(right).should == result
88
- left.should == result
89
- end
90
-
91
- should 'merge with Dictionary' do
92
- left = Dictionary['a', 1, 'b', 2, 'c', 3]
93
- right = Dictionary['d', 4]
94
- result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
95
- left.merge(right).should == result
96
- left.should.not == result
97
- end
98
-
99
- should 'merge with Hash' do
100
- left = Dictionary['a', 1, 'b', 2, 'c', 3]
101
- right = { 'd' => 4 }
102
- result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
103
- left.merge(right).should == result
104
- left.should.not == result
105
- end
106
-
107
- should 'order by set order_by' do
108
- dict = Dictionary['a', 3, 'b', 2, 'c', 1]
109
- dict.order_by{|k,v| v }
110
- dict.values.should == [1, 2, 3]
111
- dict.keys.should == %w[c b a]
112
- end
113
- 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 Ramaze::Struct do
7
- should 'provide #values_at' do
8
- Point = Ramaze::Struct.new(:x, :y)
9
- point = Point.new(15, 10)
10
-
11
- point.values_at(1, 0).should == [10, 15]
12
- point.values_at(0..1).should == [15, 10]
13
- point.values_at(:y, :x).should == [10, 15]
14
- end
15
- 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 'Thread.into' do
7
- it 'should provide access to thread vars' do
8
- Thread.current[:foo] = :bar
9
- Thread.new{ Thread.current[:foo].should == nil }.join
10
- Thread.into{ Thread.current[:foo].should == :bar }.join
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- namespace :gem do
2
- desc 'builds the gem and moves it to the pkg/ directory'
3
- task :build do
4
- pkg_dir = File.expand_path('../../pkg', __FILE__)
5
-
6
- Dir.mkdir(pkg_dir) if !File.directory?(pkg_dir)
7
-
8
- sh "gem build #{GEMSPEC.name}.gemspec"
9
- sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem #{pkg_dir}"
10
- end
11
-
12
- desc "package and install from gemspec"
13
- task :install => [:build] do
14
- sh "gem install pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
15
- end
16
-
17
- desc "uninstall the gem"
18
- task :uninstall do
19
- sh %{gem uninstall -x #{GEMSPEC.name}}
20
- end
21
- end # namespace :gem
@@ -1,14 +0,0 @@
1
- require File.expand_path('../../lib/ramaze/setup', __FILE__)
2
-
3
- desc 'install all possible dependencies'
4
- task :setup do
5
- Ramaze.setup(:verbose => false) do
6
- deps = Ramaze::DEPENDENCIES + Ramaze::DEVELOPMENT_DEPENDENCIES
7
-
8
- deps.each do |dep|
9
- if dep[:setup] != false
10
- gem(dep[:name], dep[:version], :lib => dep.delete(:lib))
11
- end
12
- end
13
- end
14
- end # task :setup