ki 0.3.3 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -1
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +2 -21
  7. data/Gemfile.lock +60 -100
  8. data/Guardfile +1 -1
  9. data/LICENSE.md +21 -0
  10. data/README.md +63 -0
  11. data/Rakefile +3 -45
  12. data/bin/ki +1 -1
  13. data/ki.gemspec +31 -137
  14. data/lib/ki.rb +21 -21
  15. data/lib/ki/api_error.rb +28 -0
  16. data/lib/ki/base_request.rb +34 -0
  17. data/lib/ki/helpers.rb +55 -0
  18. data/lib/ki/ki.rb +40 -0
  19. data/lib/ki/ki_cli.rb +46 -0
  20. data/lib/ki/ki_config.rb +20 -0
  21. data/lib/ki/middleware.rb +155 -0
  22. data/lib/ki/model.rb +70 -0
  23. data/lib/{modules → ki/modules}/callbacks.rb +0 -0
  24. data/lib/ki/modules/format_of.rb +10 -0
  25. data/lib/{modules → ki/modules}/model_helpers.rb +0 -12
  26. data/lib/ki/modules/public_file_helper.rb +13 -0
  27. data/lib/ki/modules/query_interface.rb +36 -0
  28. data/lib/{modules → ki/modules}/restrictions.rb +0 -30
  29. data/lib/ki/modules/view_helper.rb +13 -0
  30. data/lib/ki/orm.rb +65 -0
  31. data/lib/ki/version.rb +3 -0
  32. data/spec/examples/base/.ruby-gemset +1 -0
  33. data/spec/examples/base/.ruby-version +1 -0
  34. data/spec/examples/base/Gemfile +4 -0
  35. data/spec/examples/base/app.rb +1 -0
  36. data/{examples → spec/examples}/base/config.ru +0 -3
  37. data/spec/examples/base/config.yml +17 -0
  38. data/spec/examples/base/public/favicon.ico +0 -0
  39. data/spec/examples/base/public/javascripts/.gitkeep +0 -0
  40. data/spec/examples/base/public/stylesheets/.gitkeep +0 -0
  41. data/spec/examples/base/views/index.haml +6 -0
  42. data/spec/examples/couch-lock/.ruby-gemset +1 -0
  43. data/spec/examples/couch-lock/.ruby-version +1 -0
  44. data/spec/examples/couch-lock/Gemfile +4 -0
  45. data/spec/examples/couch-lock/Gemfile.lock +48 -0
  46. data/spec/examples/couch-lock/app.rb +42 -0
  47. data/spec/examples/couch-lock/config.ru +3 -0
  48. data/spec/examples/couch-lock/config.yml +17 -0
  49. data/spec/examples/couch-lock/install.sh +3 -0
  50. data/spec/examples/couch-lock/public/favicon.ico +0 -0
  51. data/spec/examples/couch-lock/public/javascripts/.gitkeep +0 -0
  52. data/spec/examples/couch-lock/public/stylesheets/.gitkeep +0 -0
  53. data/spec/examples/couch-lock/views/index.haml +18 -0
  54. data/spec/examples/json.northpole.ro/.ruby-gemset +1 -0
  55. data/spec/examples/json.northpole.ro/.ruby-version +1 -0
  56. data/spec/examples/json.northpole.ro/Capfile +25 -0
  57. data/spec/examples/json.northpole.ro/Gemfile +6 -0
  58. data/spec/examples/json.northpole.ro/Gemfile.lock +68 -0
  59. data/spec/examples/json.northpole.ro/app.rb +79 -0
  60. data/spec/examples/json.northpole.ro/client.rb +25 -0
  61. data/spec/examples/json.northpole.ro/config.ru +3 -0
  62. data/spec/examples/json.northpole.ro/config.yml +17 -0
  63. data/spec/examples/json.northpole.ro/config/deploy.rb +59 -0
  64. data/spec/examples/json.northpole.ro/config/deploy/production.rb +39 -0
  65. data/spec/examples/json.northpole.ro/foo.rb +10 -0
  66. data/spec/examples/json.northpole.ro/public/JNorthPole.jar +0 -0
  67. data/spec/examples/json.northpole.ro/public/favicon.ico +0 -0
  68. data/spec/examples/json.northpole.ro/public/font/FontAwesome.otf +0 -0
  69. data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.eot +0 -0
  70. data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.svg +284 -0
  71. data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.ttf +0 -0
  72. data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.woff +0 -0
  73. data/spec/examples/json.northpole.ro/public/images/bear.png +0 -0
  74. data/spec/examples/json.northpole.ro/public/images/bg.png +0 -0
  75. data/spec/examples/json.northpole.ro/public/images/cloud.png +0 -0
  76. data/spec/examples/json.northpole.ro/public/images/dotnet.png +0 -0
  77. data/spec/examples/json.northpole.ro/public/images/dotnet_small.png +0 -0
  78. data/spec/examples/json.northpole.ro/public/images/footer.png +0 -0
  79. data/spec/examples/json.northpole.ro/public/images/glyphicons-halflings-white.png +0 -0
  80. data/spec/examples/json.northpole.ro/public/images/glyphicons-halflings.png +0 -0
  81. data/spec/examples/json.northpole.ro/public/images/ice.png +0 -0
  82. data/spec/examples/json.northpole.ro/public/images/java.png +0 -0
  83. data/spec/examples/json.northpole.ro/public/images/java_small.png +0 -0
  84. data/spec/examples/json.northpole.ro/public/images/json.png +0 -0
  85. data/spec/examples/json.northpole.ro/public/images/json_small.png +0 -0
  86. data/spec/examples/json.northpole.ro/public/images/logo.png +0 -0
  87. data/spec/examples/json.northpole.ro/public/images/mobile.png +0 -0
  88. data/spec/examples/json.northpole.ro/public/images/php.png +0 -0
  89. data/spec/examples/json.northpole.ro/public/images/php_small.png +0 -0
  90. data/spec/examples/json.northpole.ro/public/images/python.png +0 -0
  91. data/spec/examples/json.northpole.ro/public/images/python_small.png +0 -0
  92. data/spec/examples/json.northpole.ro/public/images/ruby.png +0 -0
  93. data/spec/examples/json.northpole.ro/public/images/ruby_small.png +0 -0
  94. data/spec/examples/json.northpole.ro/public/images/shell.png +0 -0
  95. data/spec/examples/json.northpole.ro/public/images/shell_small.png +0 -0
  96. data/spec/examples/json.northpole.ro/public/javascripts/analytics.js +9 -0
  97. data/spec/examples/json.northpole.ro/public/javascripts/app.coffee +133 -0
  98. data/spec/examples/json.northpole.ro/public/javascripts/docs.min.js +16 -0
  99. data/spec/examples/json.northpole.ro/public/javascripts/jnorthpole.coffee +34 -0
  100. data/spec/examples/json.northpole.ro/public/javascripts/util.coffee +31 -0
  101. data/spec/examples/json.northpole.ro/public/stylesheets/app.sass +23 -0
  102. data/spec/examples/json.northpole.ro/public/stylesheets/application.sass +222 -0
  103. data/spec/examples/json.northpole.ro/public/stylesheets/cover.css +154 -0
  104. data/spec/examples/json.northpole.ro/views/curl.haml +19 -0
  105. data/spec/examples/json.northpole.ro/views/doc.haml +16 -0
  106. data/spec/examples/json.northpole.ro/views/doc_table.haml +45 -0
  107. data/spec/examples/json.northpole.ro/views/dotnet.haml +24 -0
  108. data/spec/examples/json.northpole.ro/views/examples.haml +28 -0
  109. data/spec/examples/json.northpole.ro/views/faq.haml +32 -0
  110. data/spec/examples/json.northpole.ro/views/foo.haml +7 -0
  111. data/spec/examples/json.northpole.ro/views/index.haml +4 -0
  112. data/spec/examples/json.northpole.ro/views/java.haml +0 -0
  113. data/spec/examples/json.northpole.ro/views/layout.haml +42 -0
  114. data/spec/examples/json.northpole.ro/views/php.haml +37 -0
  115. data/spec/examples/json.northpole.ro/views/playground.haml +38 -0
  116. data/spec/examples/json.northpole.ro/views/python.haml +17 -0
  117. data/spec/examples/json.northpole.ro/views/ruby.haml +12 -0
  118. data/spec/examples/json.northpole.ro/views/signup.haml +2 -0
  119. data/spec/examples/json.northpole.ro/views/thanks.haml +12 -0
  120. data/spec/functional_spec.rb +4 -0
  121. data/spec/lib/ki/base_request_spec.rb +88 -0
  122. data/spec/lib/ki/helpers_spec.rb +12 -0
  123. data/spec/lib/ki/ki_config_spec.rb +7 -0
  124. data/spec/lib/ki/middleware_spec.rb +11 -0
  125. data/spec/lib/ki/model_spec.rb +100 -0
  126. data/spec/lib/ki/modules/format_of_spec.rb +15 -0
  127. data/spec/lib/ki/orm_spec.rb +83 -0
  128. data/spec/spec_helper.rb +18 -5
  129. data/spec/util_spec.rb +7 -36
  130. metadata +269 -193
  131. data/.document +0 -5
  132. data/.rvmrc +0 -1
  133. data/LICENSE.txt +0 -20
  134. data/README.rdoc +0 -3
  135. data/VERSION +0 -1
  136. data/examples/base/Gemfile +0 -3
  137. data/examples/base/Gemfile.lock +0 -24
  138. data/examples/base/app.rb +0 -4
  139. data/examples/base/config.yml +0 -16
  140. data/gfx/colors.xcf +0 -0
  141. data/gfx/ki3.eps +0 -0
  142. data/gfx/logo.png +0 -0
  143. data/ki_wrap.rb +0 -35
  144. data/lib/conf.rb +0 -28
  145. data/lib/db.rb +0 -73
  146. data/lib/helpers.rb +0 -34
  147. data/lib/ki_cli.rb +0 -76
  148. data/lib/mockreq.rb +0 -45
  149. data/lib/model.rb +0 -110
  150. data/lib/modules/email.rb +0 -51
  151. data/lib/modules/query_interface.rb +0 -42
  152. data/lib/req.rb +0 -57
  153. data/lib/resp.rb +0 -70
  154. data/lib/static_file.rb +0 -68
  155. data/lib/util.rb +0 -114
  156. data/lib/views/404.haml +0 -1
  157. data/lib/views/406.haml +0 -1
  158. data/lib/views/index.haml +0 -7
  159. data/lib/views/layout.haml +0 -1
  160. data/spec/conf_spec.rb +0 -6
  161. data/spec/db_spec.rb +0 -93
  162. data/spec/integration/integration_spec.rb +0 -114
  163. data/spec/ki_spec.rb +0 -7
  164. data/spec/model_spec.rb +0 -91
  165. data/spec/modules/callbacks_spec.rb +0 -25
  166. data/spec/modules/email_spec.rb +0 -19
  167. data/spec/modules/query_interface_spec.rb +0 -93
  168. data/spec/modules/restrictions_spec.rb +0 -110
  169. data/spec/performance/performance.sh +0 -1
  170. data/spec/req_spec.rb +0 -29
@@ -1 +0,0 @@
1
- ab -n 10000 -c 100 http://localhost:3000/
@@ -1,29 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Ki::Req do
4
- before :each do
5
- class Book < Ki::Model
6
- end
7
- @db = Ki::Db.instance
8
- @db.remove_collections
9
- end
10
-
11
- it "should handle SEARCH verb" do
12
- post = Ki::ReqFactory.new(:post, { :title => 'Foundation' })
13
- hash = Book.new(post).hash
14
-
15
- search = Ki::ReqFactory.new(:search, { :title => 'Foundation' })
16
- hash = Book.new(search).hash
17
- hash[0]['title'].should == 'Foundation'
18
- end
19
-
20
- it "should format the id properly" do
21
- post = Ki::ReqFactory.new(:post, { :title => 'Foundation' })
22
- id = Book.new(post).hash['id']
23
-
24
- get = Ki::ReqFactory.new(:get, { :title => 'Foundation' })
25
- Book.new(get).hash[0]['id'].should == id
26
-
27
- update = Ki::ReqFactory.new(:put, { 'id' => id, :title => 'Foundation' })
28
- end
29
- end