ki 0.3.3 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +1 -1
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +2 -21
- data/Gemfile.lock +60 -100
- data/Guardfile +1 -1
- data/LICENSE.md +21 -0
- data/README.md +63 -0
- data/Rakefile +3 -45
- data/bin/ki +1 -1
- data/ki.gemspec +31 -137
- data/lib/ki.rb +21 -21
- data/lib/ki/api_error.rb +28 -0
- data/lib/ki/base_request.rb +34 -0
- data/lib/ki/helpers.rb +55 -0
- data/lib/ki/ki.rb +40 -0
- data/lib/ki/ki_cli.rb +46 -0
- data/lib/ki/ki_config.rb +20 -0
- data/lib/ki/middleware.rb +155 -0
- data/lib/ki/model.rb +70 -0
- data/lib/{modules → ki/modules}/callbacks.rb +0 -0
- data/lib/ki/modules/format_of.rb +10 -0
- data/lib/{modules → ki/modules}/model_helpers.rb +0 -12
- data/lib/ki/modules/public_file_helper.rb +13 -0
- data/lib/ki/modules/query_interface.rb +36 -0
- data/lib/{modules → ki/modules}/restrictions.rb +0 -30
- data/lib/ki/modules/view_helper.rb +13 -0
- data/lib/ki/orm.rb +65 -0
- data/lib/ki/version.rb +3 -0
- data/spec/examples/base/.ruby-gemset +1 -0
- data/spec/examples/base/.ruby-version +1 -0
- data/spec/examples/base/Gemfile +4 -0
- data/spec/examples/base/app.rb +1 -0
- data/{examples → spec/examples}/base/config.ru +0 -3
- data/spec/examples/base/config.yml +17 -0
- data/spec/examples/base/public/favicon.ico +0 -0
- data/spec/examples/base/public/javascripts/.gitkeep +0 -0
- data/spec/examples/base/public/stylesheets/.gitkeep +0 -0
- data/spec/examples/base/views/index.haml +6 -0
- data/spec/examples/couch-lock/.ruby-gemset +1 -0
- data/spec/examples/couch-lock/.ruby-version +1 -0
- data/spec/examples/couch-lock/Gemfile +4 -0
- data/spec/examples/couch-lock/Gemfile.lock +48 -0
- data/spec/examples/couch-lock/app.rb +42 -0
- data/spec/examples/couch-lock/config.ru +3 -0
- data/spec/examples/couch-lock/config.yml +17 -0
- data/spec/examples/couch-lock/install.sh +3 -0
- data/spec/examples/couch-lock/public/favicon.ico +0 -0
- data/spec/examples/couch-lock/public/javascripts/.gitkeep +0 -0
- data/spec/examples/couch-lock/public/stylesheets/.gitkeep +0 -0
- data/spec/examples/couch-lock/views/index.haml +18 -0
- data/spec/examples/json.northpole.ro/.ruby-gemset +1 -0
- data/spec/examples/json.northpole.ro/.ruby-version +1 -0
- data/spec/examples/json.northpole.ro/Capfile +25 -0
- data/spec/examples/json.northpole.ro/Gemfile +6 -0
- data/spec/examples/json.northpole.ro/Gemfile.lock +68 -0
- data/spec/examples/json.northpole.ro/app.rb +79 -0
- data/spec/examples/json.northpole.ro/client.rb +25 -0
- data/spec/examples/json.northpole.ro/config.ru +3 -0
- data/spec/examples/json.northpole.ro/config.yml +17 -0
- data/spec/examples/json.northpole.ro/config/deploy.rb +59 -0
- data/spec/examples/json.northpole.ro/config/deploy/production.rb +39 -0
- data/spec/examples/json.northpole.ro/foo.rb +10 -0
- data/spec/examples/json.northpole.ro/public/JNorthPole.jar +0 -0
- data/spec/examples/json.northpole.ro/public/favicon.ico +0 -0
- data/spec/examples/json.northpole.ro/public/font/FontAwesome.otf +0 -0
- data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.eot +0 -0
- data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.svg +284 -0
- data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.ttf +0 -0
- data/spec/examples/json.northpole.ro/public/font/fontawesome-webfont.woff +0 -0
- data/spec/examples/json.northpole.ro/public/images/bear.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/bg.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/cloud.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/dotnet.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/dotnet_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/footer.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/glyphicons-halflings-white.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/glyphicons-halflings.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/ice.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/java.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/java_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/json.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/json_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/logo.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/mobile.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/php.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/php_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/python.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/python_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/ruby.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/ruby_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/shell.png +0 -0
- data/spec/examples/json.northpole.ro/public/images/shell_small.png +0 -0
- data/spec/examples/json.northpole.ro/public/javascripts/analytics.js +9 -0
- data/spec/examples/json.northpole.ro/public/javascripts/app.coffee +133 -0
- data/spec/examples/json.northpole.ro/public/javascripts/docs.min.js +16 -0
- data/spec/examples/json.northpole.ro/public/javascripts/jnorthpole.coffee +34 -0
- data/spec/examples/json.northpole.ro/public/javascripts/util.coffee +31 -0
- data/spec/examples/json.northpole.ro/public/stylesheets/app.sass +23 -0
- data/spec/examples/json.northpole.ro/public/stylesheets/application.sass +222 -0
- data/spec/examples/json.northpole.ro/public/stylesheets/cover.css +154 -0
- data/spec/examples/json.northpole.ro/views/curl.haml +19 -0
- data/spec/examples/json.northpole.ro/views/doc.haml +16 -0
- data/spec/examples/json.northpole.ro/views/doc_table.haml +45 -0
- data/spec/examples/json.northpole.ro/views/dotnet.haml +24 -0
- data/spec/examples/json.northpole.ro/views/examples.haml +28 -0
- data/spec/examples/json.northpole.ro/views/faq.haml +32 -0
- data/spec/examples/json.northpole.ro/views/foo.haml +7 -0
- data/spec/examples/json.northpole.ro/views/index.haml +4 -0
- data/spec/examples/json.northpole.ro/views/java.haml +0 -0
- data/spec/examples/json.northpole.ro/views/layout.haml +42 -0
- data/spec/examples/json.northpole.ro/views/php.haml +37 -0
- data/spec/examples/json.northpole.ro/views/playground.haml +38 -0
- data/spec/examples/json.northpole.ro/views/python.haml +17 -0
- data/spec/examples/json.northpole.ro/views/ruby.haml +12 -0
- data/spec/examples/json.northpole.ro/views/signup.haml +2 -0
- data/spec/examples/json.northpole.ro/views/thanks.haml +12 -0
- data/spec/functional_spec.rb +4 -0
- data/spec/lib/ki/base_request_spec.rb +88 -0
- data/spec/lib/ki/helpers_spec.rb +12 -0
- data/spec/lib/ki/ki_config_spec.rb +7 -0
- data/spec/lib/ki/middleware_spec.rb +11 -0
- data/spec/lib/ki/model_spec.rb +100 -0
- data/spec/lib/ki/modules/format_of_spec.rb +15 -0
- data/spec/lib/ki/orm_spec.rb +83 -0
- data/spec/spec_helper.rb +18 -5
- data/spec/util_spec.rb +7 -36
- metadata +269 -193
- data/.document +0 -5
- data/.rvmrc +0 -1
- data/LICENSE.txt +0 -20
- data/README.rdoc +0 -3
- data/VERSION +0 -1
- data/examples/base/Gemfile +0 -3
- data/examples/base/Gemfile.lock +0 -24
- data/examples/base/app.rb +0 -4
- data/examples/base/config.yml +0 -16
- data/gfx/colors.xcf +0 -0
- data/gfx/ki3.eps +0 -0
- data/gfx/logo.png +0 -0
- data/ki_wrap.rb +0 -35
- data/lib/conf.rb +0 -28
- data/lib/db.rb +0 -73
- data/lib/helpers.rb +0 -34
- data/lib/ki_cli.rb +0 -76
- data/lib/mockreq.rb +0 -45
- data/lib/model.rb +0 -110
- data/lib/modules/email.rb +0 -51
- data/lib/modules/query_interface.rb +0 -42
- data/lib/req.rb +0 -57
- data/lib/resp.rb +0 -70
- data/lib/static_file.rb +0 -68
- data/lib/util.rb +0 -114
- data/lib/views/404.haml +0 -1
- data/lib/views/406.haml +0 -1
- data/lib/views/index.haml +0 -7
- data/lib/views/layout.haml +0 -1
- data/spec/conf_spec.rb +0 -6
- data/spec/db_spec.rb +0 -93
- data/spec/integration/integration_spec.rb +0 -114
- data/spec/ki_spec.rb +0 -7
- data/spec/model_spec.rb +0 -91
- data/spec/modules/callbacks_spec.rb +0 -25
- data/spec/modules/email_spec.rb +0 -19
- data/spec/modules/query_interface_spec.rb +0 -93
- data/spec/modules/restrictions_spec.rb +0 -110
- data/spec/performance/performance.sh +0 -1
- data/spec/req_spec.rb +0 -29
@@ -1 +0,0 @@
|
|
1
|
-
ab -n 10000 -c 100 http://localhost:3000/
|
data/spec/req_spec.rb
DELETED
@@ -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
|