rave 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,6 +67,8 @@ require 'rave'
67
67
  module #{module_name}
68
68
  class Robot < Rave::Models::Robot
69
69
 
70
+ ME = "appropriate-casey@appspot.com"
71
+
70
72
  #Define handlers here:
71
73
  # e.g. if the robot should act on a DOCUMENT_CHANGED event:
72
74
  #
@@ -77,7 +77,7 @@ module Rave
77
77
  json['blips']['map'].values.collect do |blip_data|
78
78
  blip = Rave::Models::Blip.new(
79
79
  :id => blip_data['blipId'],
80
- :annotations => annotations_from_json(json),
80
+ :annotations => annotations_from_json(blip_data),
81
81
  :child_blip_ids => blip_data['childBlipIds'],
82
82
  :content => blip_data['content'],
83
83
  :contributors => blip_data['contributors'],
@@ -96,8 +96,8 @@ module Rave
96
96
  end
97
97
 
98
98
  def annotations_from_json(json)
99
- if json['annotation']
100
- json['annotations'].collect do |annotation|
99
+ if json['annotation'] && json['annotations']['list']
100
+ json['annotations']['list'].collect do |annotation|
101
101
  Rave::Models::Annotation.new(
102
102
  :name => annotation['name'],
103
103
  :value => annotation['value'],
data/lib/ops/blip_ops.rb CHANGED
@@ -37,8 +37,11 @@ module Rave
37
37
 
38
38
  #Deletes the text in a given range and replaces it with the given text
39
39
  def set_text_in_range(range, text)
40
- delete_range(range)
40
+ #Note: I'm doing this in the opposite order from the python API, because
41
+ # otherwise, if you are setting text at the end of the content, the cursor
42
+ # gets moved to the start of the range...
41
43
  insert_text(text, range.first)
44
+ delete_range(range.first+text.length..range.last+text.length)
42
45
  end
43
46
 
44
47
  #Appends text to the end of the content
metadata CHANGED
@@ -5,9 +5,9 @@ homepage: http://github.com/diminish7/rave
5
5
  executables:
6
6
  - rave
7
7
  version: !ruby/object:Gem::Version
8
- version: 0.1.0
8
+ version: 0.1.1
9
9
  post_install_message:
10
- date: 2009-06-20 07:00:00 +00:00
10
+ date: 2009-07-05 07:00:00 +00:00
11
11
  files:
12
12
  - lib/exceptions.rb
13
13
  - lib/rave.rb