rave 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/commands/create.rb +2 -0
- data/lib/mixins/data_format.rb +3 -3
- data/lib/ops/blip_ops.rb +4 -1
- metadata +2 -2
data/lib/commands/create.rb
CHANGED
data/lib/mixins/data_format.rb
CHANGED
@@ -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(
|
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
|
-
|
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.
|
8
|
+
version: 0.1.1
|
9
9
|
post_install_message:
|
10
|
-
date: 2009-
|
10
|
+
date: 2009-07-05 07:00:00 +00:00
|
11
11
|
files:
|
12
12
|
- lib/exceptions.rb
|
13
13
|
- lib/rave.rb
|