tumbling 0.0.2 → 0.0.3

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/README.markdown ADDED
@@ -0,0 +1,9 @@
1
+ # README #
2
+
3
+ ## Install ##
4
+
5
+ gem install tumbling
6
+
7
+ ## TODO ##
8
+
9
+ 1. Tests [seriously lacks some]
@@ -17,7 +17,7 @@ module Tumbling
17
17
  {
18
18
  :id => attributes['id'],
19
19
  :url => attributes['url_with_slug'],
20
- :date => attributes['date_gmt'],
20
+ :date => parse_time(attributes['date_gmt']),
21
21
  :format => attributes['format'],
22
22
  :slug => attributes['slug'],
23
23
  :body => attributes['audio_player'],
data/lib/tumbling/link.rb CHANGED
@@ -17,7 +17,7 @@ module Tumbling
17
17
  {
18
18
  :id => attributes['id'],
19
19
  :url => attributes['url_with_slug'],
20
- :date => attributes['date_gmt'],
20
+ :date => parse_time(attributes['date_gmt']),
21
21
  :format => attributes['format'],
22
22
  :slug => attributes['slug'],
23
23
  :body => attributes['link_url'],
@@ -18,7 +18,7 @@ module Tumbling
18
18
  {
19
19
  :id => attributes['id'],
20
20
  :url => attributes['url_with_slug'],
21
- :date => attributes['date_gmt'],
21
+ :date => parse_time(attributes['date_gmt']),
22
22
  :format => attributes['format'],
23
23
  :slug => attributes['slug'],
24
24
  :body => build_body(attributes['photo_url']),
data/lib/tumbling/post.rb CHANGED
@@ -17,7 +17,7 @@ module Tumbling
17
17
  {
18
18
  :id => attributes['id'],
19
19
  :url => attributes['url_with_slug'],
20
- :date => attributes['date_gmt'],
20
+ :date => parse_time(attributes['date_gmt']),
21
21
  :format => attributes['format'],
22
22
  :slug => attributes['slug'],
23
23
  :body => attributes['regular_body'],
@@ -18,7 +18,7 @@ module Tumbling
18
18
  {
19
19
  :id => attributes['id'],
20
20
  :url => attributes['url_with_slug'],
21
- :date => attributes['date_gmt'],
21
+ :date => parse_time(attributes['date_gmt']),
22
22
  :format => attributes['format'],
23
23
  :slug => attributes['slug'],
24
24
  :body => attributes['quote_text'],
@@ -3,8 +3,8 @@ module Tumbling
3
3
  include HTTParty
4
4
  format :xml
5
5
 
6
- def self.all
7
- get_resources(type)
6
+ def self.all(query = {})
7
+ get_resources(type, query)
8
8
  end
9
9
 
10
10
  def type
@@ -17,6 +17,10 @@ module Tumbling
17
17
 
18
18
  private
19
19
 
20
+ def self.parse_time(time)
21
+ Time.parse(time)
22
+ end
23
+
20
24
  def initialize(hash = {})
21
25
  hash.each do |key, value|
22
26
  send("#{key}=", value)
@@ -42,8 +46,7 @@ module Tumbling
42
46
  object.build(result)
43
47
  end
44
48
 
45
- def self.get_resources(type)
46
- query = {}
49
+ def self.get_resources(type, query = {})
47
50
  query.merge!({ :type => type }) unless type.nil?
48
51
 
49
52
  results = get '/api/read', :query => query
@@ -18,7 +18,7 @@ module Tumbling
18
18
  {
19
19
  :id => attributes['id'],
20
20
  :url => attributes['url_with_slug'],
21
- :date => attributes['date_gmt'],
21
+ :date => parse_time(attributes['date_gmt']),
22
22
  :format => attributes['format'],
23
23
  :slug => attributes['slug'],
24
24
  :body => attributes['video_player'],
data/lib/tumbling.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'time'
1
2
  require 'httparty'
2
3
 
3
4
  module Tumbling
@@ -20,6 +21,4 @@ module Tumbling
20
21
  Resource.base_uri "http://#{blog}.tumblr.com"
21
22
  end
22
23
  end
23
- end
24
-
25
- Tumbling.blog = "proposable"
24
+ end
Binary file
data/tumbling.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tumbling}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Cameron Cox"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumbling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Cox
@@ -41,8 +41,10 @@ files:
41
41
  - lib/tumbling/video.rb
42
42
  - lib/tumbling.rb
43
43
  - LICENSE
44
+ - README.markdown
44
45
  - script/console
45
46
  - tumbling-0.0.1.gem
47
+ - tumbling-0.0.2.gem
46
48
  - tumbling.gemspec
47
49
  has_rdoc: true
48
50
  homepage: http://github.com/cameroncox/tumbling