hexorx-rumblr 0.0.3 → 0.0.4
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.
- data/lib/rumblr/client.rb +3 -3
- data/lib/rumblr/tumblelog.rb +2 -3
- data/rumblr.gemspec +1 -1
- metadata +1 -1
data/lib/rumblr/client.rb
CHANGED
@@ -54,7 +54,7 @@ module Rumblr
|
|
54
54
|
hash
|
55
55
|
end
|
56
56
|
# merge hashes, clean out cruft
|
57
|
-
inner_attrs = cleanup_hash(subclass_attrs)
|
57
|
+
inner_attrs = cleanup_hash(subclass_attrs,post_attrs[:type])
|
58
58
|
inner_attrs.delete(:text)
|
59
59
|
inner_attrs.delete(:tag)
|
60
60
|
post_attrs.merge!(inner_attrs)
|
@@ -128,9 +128,9 @@ module Rumblr
|
|
128
128
|
user_attributes.merge!(:tumblelogs => tumblelogs)
|
129
129
|
end
|
130
130
|
|
131
|
-
def cleanup_hash(attrs={})
|
131
|
+
def cleanup_hash(attrs={},type=nil)
|
132
132
|
clean_attrs = attrs.inject({}) do |hash,(key,value)|
|
133
|
-
mapped_key = key.
|
133
|
+
mapped_key = (key.split('-') - [type]).join('_').to_sym
|
134
134
|
mapped_value = case value
|
135
135
|
when /($1^|$yes^)/ then true
|
136
136
|
when /($0^|$no^)/ then false
|
data/lib/rumblr/tumblelog.rb
CHANGED
@@ -5,10 +5,9 @@ module Rumblr
|
|
5
5
|
:type, :private_id
|
6
6
|
attr_accessor :user
|
7
7
|
|
8
|
-
def posts
|
8
|
+
def posts
|
9
9
|
return [] unless self.url
|
10
|
-
|
11
|
-
log, posts = Client.instance.read(options)
|
10
|
+
log, posts = Client.instance.read({:url => self.url}.merge(self.user.auth))
|
12
11
|
return posts
|
13
12
|
end
|
14
13
|
|
data/rumblr.gemspec
CHANGED