eyeballs 0.5.8 → 0.5.8.1

Sign up to get free protection for your applications and to get access to all the features.
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.5.8"
30
+ s.version = "0.5.8.1"
31
31
  s.author = "Paul Campbell"
32
32
  s.email = "paul@rslw.com"
33
33
  s.homepage = "http://www.github.com/paulca/eyeballs.js"
@@ -44,4 +44,4 @@ rescue LoadError
44
44
  puts "Jeweler not available. Install it with: sudo gem install jeweler"
45
45
  end
46
46
 
47
- Jeweler::GemcutterTasks.new
47
+ Jeweler::GemcutterTasks.new
data/app.rb CHANGED
@@ -53,6 +53,10 @@ post '/auth_token' do
53
53
  params[:authenticity_token]
54
54
  end
55
55
 
56
+ get '/reviews/2' do
57
+ '{"id": "2", "title":"funtimes"}'
58
+ end
59
+
56
60
  get '/reviews/:id' do
57
61
  '{"id": "1", "title":"More Magic!"}'
58
62
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{eyeballs}
8
- s.version = "0.5.8"
8
+ s.version = "0.5.8.1"
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"]
@@ -101,11 +101,18 @@ o_O.rest = {
101
101
  {
102
102
  var url = this.figure_url(options, model) + '/' + id;
103
103
  $.get(url, function(response){
104
- try{
105
- var retrieved_object = JSON.parse(response);
104
+ if(typeof response === 'object')
105
+ {
106
+ var retrieved_object = response;
106
107
  }
107
- catch(e){
108
- var retrieved_object = model.initialize({id: id});
108
+ else
109
+ {
110
+ try{
111
+ var retrieved_object = JSON.parse(response);
112
+ }
113
+ catch(e){
114
+ var retrieved_object = model.initialize({id: id});
115
+ }
109
116
  }
110
117
  if(typeof callback === 'function')
111
118
  {
@@ -154,6 +154,13 @@
154
154
  });
155
155
  })
156
156
 
157
+ asyncTest('pulling something in by itself', 1, function(){
158
+ Review.find(2, {success: function(found_review){
159
+ equals(found_review.title, 'funtimes');
160
+ start();
161
+ }})
162
+ })
163
+
157
164
  asyncTest('pulling something in with prefix', 1, function(){
158
165
  Review.find(1, {url:'/my/reviews', success: function(found_review){
159
166
  equals(found_review.title, 'Prefixed');
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyeballs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 69
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
9
  - 8
10
- version: 0.5.8
10
+ - 1
11
+ version: 0.5.8.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Paul Campbell