eyeballs 0.3.4.1 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Rakefile +1 -1
- data/app.rb +22 -0
- data/eyeballs.gemspec +1 -1
- data/src/jquery.o_O.rails.js +7 -2
- data/src/o_O.js +1 -1
- data/test/unit/test_rails.html +7 -1
- metadata +3 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/app.rb
CHANGED
@@ -3,4 +3,26 @@ require 'sinatra'
|
|
3
3
|
set :static, true
|
4
4
|
set :public, Proc.new { File.expand_path('.') }
|
5
5
|
|
6
|
+
get '/reviews' do
|
7
|
+
'[{"id": "1", "title":"Local, baby"}]'
|
8
|
+
end
|
6
9
|
|
10
|
+
post '/reviews' do
|
11
|
+
'{"id": "1"}'
|
12
|
+
end
|
13
|
+
|
14
|
+
get '/reviews/:id' do
|
15
|
+
'{"id": "1", "title":"More Magic!"}'
|
16
|
+
end
|
17
|
+
|
18
|
+
get '/my/reviews/:id' do
|
19
|
+
'{"id": "1", "title":"Prefixed"}'
|
20
|
+
end
|
21
|
+
|
22
|
+
put '/reviews/:id' do
|
23
|
+
'{"id": "1", "title":"Tennessee"}'
|
24
|
+
end
|
25
|
+
|
26
|
+
delete '/reviews/:id' do
|
27
|
+
'{"id": "1", "title":"Tennessee"}'
|
28
|
+
end
|
data/eyeballs.gemspec
CHANGED
data/src/jquery.o_O.rails.js
CHANGED
@@ -54,9 +54,14 @@ o_O.rails = {
|
|
54
54
|
})
|
55
55
|
}
|
56
56
|
},
|
57
|
-
find: function(model, id, callback)
|
57
|
+
find: function(model, id, callback, options)
|
58
58
|
{
|
59
|
-
|
59
|
+
var url = '/' + model.table_name + '/' + id;
|
60
|
+
if(typeof options === 'object' && options.prefix)
|
61
|
+
{
|
62
|
+
url = options.prefix + url;
|
63
|
+
}
|
64
|
+
$.get(url, function(response){
|
60
65
|
var retrieved_object = JSON.parse(response);
|
61
66
|
if(typeof callback === 'function')
|
62
67
|
{
|
data/src/o_O.js
CHANGED
data/test/unit/test_rails.html
CHANGED
@@ -43,6 +43,13 @@
|
|
43
43
|
});
|
44
44
|
})
|
45
45
|
|
46
|
+
asyncTest('pulling something in with prefix', 1, function(){
|
47
|
+
Review.find(1, {prefix:'/my', success: function(found_review){
|
48
|
+
equals(found_review.title, 'Prefixed');
|
49
|
+
start();
|
50
|
+
}})
|
51
|
+
})
|
52
|
+
|
46
53
|
asyncTest('getting all', 2, function(){
|
47
54
|
var review = Review.initialize({title: 'Local, baby'});
|
48
55
|
review.save(function(saved_review){
|
@@ -58,7 +65,6 @@
|
|
58
65
|
var review = Review.initialize()
|
59
66
|
equals(review.new_record, true, 'should be a new record review');
|
60
67
|
review.save(function(saved_review){
|
61
|
-
console.log(saved_review)
|
62
68
|
equals(saved_review.new_record, false, 'should not be a new record after')
|
63
69
|
start();
|
64
70
|
});
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyeballs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.3.4.1
|
9
|
+
- 5
|
10
|
+
version: 0.3.5
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Paul Campbell
|