ki 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -1
- data/Gemfile +6 -3
- data/Gemfile.lock +81 -0
- data/Guardfile +9 -0
- data/LICENSE.txt +1 -1
- data/README.rdoc +8 -1
- data/Rakefile +17 -3
- data/VERSION +1 -1
- data/bin/ki +3 -2
- data/examples/base/Gemfile +1 -7
- data/examples/base/Gemfile.lock +24 -0
- data/examples/base/app.rb +1 -2
- data/examples/base/config.ru +4 -0
- data/examples/{example → northpole}/Gemfile +0 -1
- data/examples/northpole/Gemfile.lock +33 -0
- data/examples/northpole/app.rb +19 -0
- data/examples/northpole/config.ru +6 -0
- data/examples/northpole/config.yml +3 -0
- data/examples/northpole/views/index.haml +1 -0
- data/examples/northpole/views/website.haml +1 -0
- data/ki.gemspec +125 -0
- data/lib/db.rb +43 -13
- data/lib/extensions/mail.rb +41 -0
- data/lib/helpers.rb +16 -0
- data/lib/ki.rb +8 -27
- data/lib/ki_cli.rb +63 -0
- data/lib/model.rb +59 -92
- data/lib/modules/callbacks.rb +27 -0
- data/lib/modules/query_interface.rb +29 -0
- data/lib/modules/restrictions.rb +62 -0
- data/lib/req.rb +30 -0
- data/lib/resp.rb +50 -0
- data/lib/static_file.rb +14 -0
- data/lib/util.rb +21 -30
- data/lib/views/404.haml +7 -0
- data/lib/views/406.haml +7 -0
- data/lib/views/index.haml +5 -17
- data/logo.png +0 -0
- data/spec/db_spec.rb +71 -0
- data/spec/ki_spec.rb +2 -2
- data/spec/model_spec.rb +82 -0
- data/spec/modules/callbacks_spec.rb +14 -0
- data/spec/modules/query_interface_spec.rb +63 -0
- data/spec/modules/restrictions_spec.rb +64 -0
- data/spec/req_spec.rb +4 -0
- data/spec/spec_helper.rb +30 -1
- data/spec/util_spec.rb +32 -16
- metadata +89 -36
- data/examples/base/config.yml +0 -3
- data/examples/example/app.rb +0 -15
- data/examples/example/config.ru +0 -2
- data/examples/example/config.yml +0 -3
- data/examples/example/public/custom.css +0 -0
- data/examples/example/public/custom.js +0 -0
- data/lib/cli.rb +0 -51
- data/lib/controller.rb +0 -15
- data/lib/modules.rb +0 -54
- data/lib/public/bootstrap.css +0 -6004
- data/lib/public/bootstrap.js +0 -2036
- data/lib/public/custom.css +0 -0
- data/lib/public/custom.js +0 -0
- data/lib/public/glyphicons-halflings-white.png +0 -0
- data/lib/public/glyphicons-halflings.png +0 -0
- data/lib/public/jquery-1.8.2.min.js +0 -2
- data/lib/public/ki.css +0 -56
- data/lib/request.rb +0 -14
- data/lib/response.rb +0 -51
- data/lib/views/container.haml +0 -6
- data/lib/views/footer.haml +0 -2
- data/lib/views/form.haml +0 -10
- data/lib/views/models.haml +0 -14
- data/lib/views/navbar.haml +0 -11
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use 1.9.3@ki
|
1
|
+
rvm use 1.9.3@ki --create
|
data/Gemfile
CHANGED
@@ -1,15 +1,18 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
gem "rack"
|
4
|
-
gem "thin"
|
5
4
|
gem "mongo"
|
6
5
|
gem "bson_ext"
|
7
|
-
gem "haml"
|
8
6
|
gem "thor"
|
7
|
+
gem "haml"
|
8
|
+
gem "thin"
|
9
9
|
|
10
10
|
group :development do
|
11
|
-
gem "shotgun"
|
12
11
|
gem "rspec"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem 'rb-inotify', '~> 0.8.8' # for guard-rspec
|
14
|
+
gem "rdoc"
|
13
15
|
gem "bundler"
|
14
16
|
gem "jeweler"
|
17
|
+
gem "simplecov"
|
15
18
|
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
bson (1.8.2)
|
5
|
+
bson_ext (1.8.2)
|
6
|
+
bson (~> 1.8.2)
|
7
|
+
coderay (1.0.8)
|
8
|
+
daemons (1.1.9)
|
9
|
+
diff-lcs (1.1.3)
|
10
|
+
eventmachine (1.0.0)
|
11
|
+
ffi (1.3.1)
|
12
|
+
git (1.2.5)
|
13
|
+
guard (1.6.2)
|
14
|
+
listen (>= 0.6.0)
|
15
|
+
lumberjack (>= 1.0.2)
|
16
|
+
pry (>= 0.9.10)
|
17
|
+
terminal-table (>= 1.4.3)
|
18
|
+
thor (>= 0.14.6)
|
19
|
+
guard-rspec (2.4.0)
|
20
|
+
guard (>= 1.1)
|
21
|
+
rspec (~> 2.11)
|
22
|
+
haml (3.1.7)
|
23
|
+
jeweler (1.8.4)
|
24
|
+
bundler (~> 1.0)
|
25
|
+
git (>= 1.2.5)
|
26
|
+
rake
|
27
|
+
rdoc
|
28
|
+
json (1.7.6)
|
29
|
+
listen (0.7.2)
|
30
|
+
lumberjack (1.0.2)
|
31
|
+
method_source (0.8.1)
|
32
|
+
mongo (1.8.2)
|
33
|
+
bson (~> 1.8.2)
|
34
|
+
multi_json (1.5.0)
|
35
|
+
pry (0.9.11.4)
|
36
|
+
coderay (~> 1.0.5)
|
37
|
+
method_source (~> 0.8)
|
38
|
+
slop (~> 3.4)
|
39
|
+
rack (1.5.1)
|
40
|
+
rake (10.0.3)
|
41
|
+
rb-inotify (0.8.8)
|
42
|
+
ffi (>= 0.5.0)
|
43
|
+
rdoc (3.12)
|
44
|
+
json (~> 1.4)
|
45
|
+
rspec (2.12.0)
|
46
|
+
rspec-core (~> 2.12.0)
|
47
|
+
rspec-expectations (~> 2.12.0)
|
48
|
+
rspec-mocks (~> 2.12.0)
|
49
|
+
rspec-core (2.12.2)
|
50
|
+
rspec-expectations (2.12.1)
|
51
|
+
diff-lcs (~> 1.1.3)
|
52
|
+
rspec-mocks (2.12.2)
|
53
|
+
simplecov (0.7.1)
|
54
|
+
multi_json (~> 1.0)
|
55
|
+
simplecov-html (~> 0.7.1)
|
56
|
+
simplecov-html (0.7.1)
|
57
|
+
slop (3.4.3)
|
58
|
+
terminal-table (1.4.5)
|
59
|
+
thin (1.5.0)
|
60
|
+
daemons (>= 1.0.9)
|
61
|
+
eventmachine (>= 0.12.6)
|
62
|
+
rack (>= 1.0.0)
|
63
|
+
thor (0.17.0)
|
64
|
+
|
65
|
+
PLATFORMS
|
66
|
+
ruby
|
67
|
+
|
68
|
+
DEPENDENCIES
|
69
|
+
bson_ext
|
70
|
+
bundler
|
71
|
+
guard-rspec
|
72
|
+
haml
|
73
|
+
jeweler
|
74
|
+
mongo
|
75
|
+
rack
|
76
|
+
rb-inotify (~> 0.8.8)
|
77
|
+
rdoc
|
78
|
+
rspec
|
79
|
+
simplecov
|
80
|
+
thin
|
81
|
+
thor
|
data/Guardfile
ADDED
data/LICENSE.txt
CHANGED
data/README.rdoc
CHANGED
@@ -4,9 +4,16 @@ Description goes here.
|
|
4
4
|
|
5
5
|
== Contributing to ki
|
6
6
|
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
7
14
|
|
8
15
|
== Copyright
|
9
16
|
|
10
|
-
Copyright (c)
|
17
|
+
Copyright (c) 2013 Cristian Mircea Messel. See LICENSE.txt for
|
11
18
|
further details.
|
12
19
|
|
data/Rakefile
CHANGED
@@ -17,11 +17,10 @@ Jeweler::Tasks.new do |gem|
|
|
17
17
|
gem.name = "ki"
|
18
18
|
gem.homepage = "http://github.com/mess110/ki"
|
19
19
|
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{
|
21
|
-
gem.description = %Q{
|
20
|
+
gem.summary = %Q{Prototyping noSQL RESTful API cloud database}
|
21
|
+
gem.description = %Q{Fuck setting up a database for your prototypes. Some call it an ORM with a RESTful interface. Some say its for prototyping.}
|
22
22
|
gem.email = "mess110@gmail.com"
|
23
23
|
gem.authors = ["Cristian Mircea Messel"]
|
24
|
-
# dependencies defined in Gemfile
|
25
24
|
end
|
26
25
|
Jeweler::RubygemsDotOrgTasks.new
|
27
26
|
|
@@ -32,3 +31,18 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
32
31
|
end
|
33
32
|
|
34
33
|
task :default => :spec
|
34
|
+
|
35
|
+
require 'rdoc/task'
|
36
|
+
Rake::RDocTask.new do |rdoc|
|
37
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
38
|
+
|
39
|
+
rdoc.rdoc_dir = 'rdoc'
|
40
|
+
rdoc.title = "ki #{version}"
|
41
|
+
rdoc.rdoc_files.include('README*')
|
42
|
+
rdoc.rdoc_files.include('lib/extensions/*.rb')
|
43
|
+
rdoc.rdoc_files.include('lib/modules/*.rb')
|
44
|
+
rdoc.rdoc_files.include('lib/model.rb')
|
45
|
+
rdoc.rdoc_files.include('lib/db.rb')
|
46
|
+
rdoc.rdoc_files.include('lib/req.rb')
|
47
|
+
rdoc.rdoc_files.include('lib/resp.rb')
|
48
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/bin/ki
CHANGED
data/examples/base/Gemfile
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../../
|
3
|
+
specs:
|
4
|
+
ki (0.0.1)
|
5
|
+
rack
|
6
|
+
thin
|
7
|
+
thor
|
8
|
+
|
9
|
+
GEM
|
10
|
+
specs:
|
11
|
+
daemons (1.1.9)
|
12
|
+
eventmachine (1.0.0)
|
13
|
+
rack (1.5.1)
|
14
|
+
thin (1.5.0)
|
15
|
+
daemons (>= 1.0.9)
|
16
|
+
eventmachine (>= 0.12.6)
|
17
|
+
rack (>= 1.0.0)
|
18
|
+
thor (0.17.0)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
ki!
|
data/examples/base/app.rb
CHANGED
data/examples/base/config.ru
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../../
|
3
|
+
specs:
|
4
|
+
ki (0.0.1)
|
5
|
+
bson_ext
|
6
|
+
haml
|
7
|
+
mongo
|
8
|
+
rack
|
9
|
+
thin
|
10
|
+
thor
|
11
|
+
|
12
|
+
GEM
|
13
|
+
specs:
|
14
|
+
bson (1.8.2)
|
15
|
+
bson_ext (1.8.2)
|
16
|
+
bson (~> 1.8.2)
|
17
|
+
daemons (1.1.9)
|
18
|
+
eventmachine (1.0.0)
|
19
|
+
haml (3.1.7)
|
20
|
+
mongo (1.8.2)
|
21
|
+
bson (~> 1.8.2)
|
22
|
+
rack (1.5.1)
|
23
|
+
thin (1.5.0)
|
24
|
+
daemons (>= 1.0.9)
|
25
|
+
eventmachine (>= 0.12.6)
|
26
|
+
rack (>= 1.0.0)
|
27
|
+
thor (0.17.0)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
ki!
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'ki'
|
2
|
+
|
3
|
+
class Email < Ki::Model
|
4
|
+
include Ki::Mail
|
5
|
+
|
6
|
+
forbid :find, :update, :delete
|
7
|
+
respond_to :json
|
8
|
+
requires :from, :to, :subject, :body
|
9
|
+
|
10
|
+
def after_create
|
11
|
+
send_mail required_attributes
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Website < Ki::Model
|
16
|
+
forbid :delete, :create, :update
|
17
|
+
|
18
|
+
respond_to :html
|
19
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
.salut hello
|
@@ -0,0 +1 @@
|
|
1
|
+
.salut hello world
|
data/ki.gemspec
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "ki"
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Cristian Mircea Messel"]
|
12
|
+
s.date = "2013-02-09"
|
13
|
+
s.description = "Fuck setting up a database for your prototypes. Some call it an ORM with a RESTful interface. Some say its for prototyping."
|
14
|
+
s.email = "mess110@gmail.com"
|
15
|
+
s.executables = ["ki"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE.txt",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
".rspec",
|
23
|
+
".rvmrc",
|
24
|
+
"Gemfile",
|
25
|
+
"Gemfile.lock",
|
26
|
+
"Guardfile",
|
27
|
+
"LICENSE.txt",
|
28
|
+
"README.rdoc",
|
29
|
+
"Rakefile",
|
30
|
+
"VERSION",
|
31
|
+
"bin/ki",
|
32
|
+
"examples/base/Gemfile",
|
33
|
+
"examples/base/Gemfile.lock",
|
34
|
+
"examples/base/app.rb",
|
35
|
+
"examples/base/config.ru",
|
36
|
+
"examples/northpole/Gemfile",
|
37
|
+
"examples/northpole/Gemfile.lock",
|
38
|
+
"examples/northpole/app.rb",
|
39
|
+
"examples/northpole/config.ru",
|
40
|
+
"examples/northpole/config.yml",
|
41
|
+
"examples/northpole/views/index.haml",
|
42
|
+
"examples/northpole/views/website.haml",
|
43
|
+
"ki.gemspec",
|
44
|
+
"lib/db.rb",
|
45
|
+
"lib/extensions/mail.rb",
|
46
|
+
"lib/helpers.rb",
|
47
|
+
"lib/ki.rb",
|
48
|
+
"lib/ki_cli.rb",
|
49
|
+
"lib/model.rb",
|
50
|
+
"lib/modules/callbacks.rb",
|
51
|
+
"lib/modules/query_interface.rb",
|
52
|
+
"lib/modules/restrictions.rb",
|
53
|
+
"lib/req.rb",
|
54
|
+
"lib/resp.rb",
|
55
|
+
"lib/static_file.rb",
|
56
|
+
"lib/util.rb",
|
57
|
+
"lib/views/404.haml",
|
58
|
+
"lib/views/406.haml",
|
59
|
+
"lib/views/index.haml",
|
60
|
+
"logo.png",
|
61
|
+
"spec/db_spec.rb",
|
62
|
+
"spec/ki_spec.rb",
|
63
|
+
"spec/model_spec.rb",
|
64
|
+
"spec/modules/callbacks_spec.rb",
|
65
|
+
"spec/modules/query_interface_spec.rb",
|
66
|
+
"spec/modules/restrictions_spec.rb",
|
67
|
+
"spec/req_spec.rb",
|
68
|
+
"spec/spec_helper.rb",
|
69
|
+
"spec/util_spec.rb"
|
70
|
+
]
|
71
|
+
s.homepage = "http://github.com/mess110/ki"
|
72
|
+
s.licenses = ["MIT"]
|
73
|
+
s.require_paths = ["lib"]
|
74
|
+
s.rubygems_version = "1.8.24"
|
75
|
+
s.summary = "Prototyping noSQL RESTful API cloud database"
|
76
|
+
|
77
|
+
if s.respond_to? :specification_version then
|
78
|
+
s.specification_version = 3
|
79
|
+
|
80
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
81
|
+
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
82
|
+
s.add_runtime_dependency(%q<mongo>, [">= 0"])
|
83
|
+
s.add_runtime_dependency(%q<bson_ext>, [">= 0"])
|
84
|
+
s.add_runtime_dependency(%q<thor>, [">= 0"])
|
85
|
+
s.add_runtime_dependency(%q<haml>, [">= 0"])
|
86
|
+
s.add_runtime_dependency(%q<thin>, [">= 0"])
|
87
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
88
|
+
s.add_development_dependency(%q<guard-rspec>, [">= 0"])
|
89
|
+
s.add_development_dependency(%q<rb-inotify>, ["~> 0.8.8"])
|
90
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
91
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
92
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
93
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
94
|
+
else
|
95
|
+
s.add_dependency(%q<rack>, [">= 0"])
|
96
|
+
s.add_dependency(%q<mongo>, [">= 0"])
|
97
|
+
s.add_dependency(%q<bson_ext>, [">= 0"])
|
98
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
99
|
+
s.add_dependency(%q<haml>, [">= 0"])
|
100
|
+
s.add_dependency(%q<thin>, [">= 0"])
|
101
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
102
|
+
s.add_dependency(%q<guard-rspec>, [">= 0"])
|
103
|
+
s.add_dependency(%q<rb-inotify>, ["~> 0.8.8"])
|
104
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
105
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
106
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
107
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
108
|
+
end
|
109
|
+
else
|
110
|
+
s.add_dependency(%q<rack>, [">= 0"])
|
111
|
+
s.add_dependency(%q<mongo>, [">= 0"])
|
112
|
+
s.add_dependency(%q<bson_ext>, [">= 0"])
|
113
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
114
|
+
s.add_dependency(%q<haml>, [">= 0"])
|
115
|
+
s.add_dependency(%q<thin>, [">= 0"])
|
116
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
117
|
+
s.add_dependency(%q<guard-rspec>, [">= 0"])
|
118
|
+
s.add_dependency(%q<rb-inotify>, ["~> 0.8.8"])
|
119
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
120
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
121
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
122
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|