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 CHANGED
@@ -1,3 +1,8 @@
1
+ Thu Jun 17 2010
2
+ - - - - - - - -
3
+ - Add "prefix" to Rails find method
4
+ - Add callback to find method
5
+
1
6
  Wed Jun 8 2010
2
7
  - - - - - - - -
3
8
  - Detect public folder and modify accordingly
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ begin
27
27
  require 'jeweler'
28
28
  Jeweler::Tasks.new do |s|
29
29
  s.name = "eyeballs"
30
- s.version = "0.3.4.1"
30
+ s.version = "0.3.5"
31
31
  s.author = "Paul Campbell"
32
32
  s.email = "paul@rslw.com"
33
33
  s.homepage = "http://www.github.com/paulca/eyeballs.js"
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{eyeballs}
8
- s.version = "0.3.4.1"
8
+ s.version = "0.3.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Campbell"]
@@ -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
- $.get('/' + model.table_name + '/' + id, function(response){
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
@@ -206,7 +206,7 @@ o_O.model = {
206
206
  {
207
207
  run_callback(callback, 'failure', found_object);
208
208
  }
209
- });
209
+ }, callback);
210
210
  }
211
211
  },
212
212
  model_name: model_name,
@@ -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: 69
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- - 1
11
- version: 0.3.4.1
9
+ - 5
10
+ version: 0.3.5
12
11
  platform: ruby
13
12
  authors:
14
13
  - Paul Campbell