hobostove 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fb76c2892a743794debc51500b56ca9b8b222db
4
- data.tar.gz: 12ea293f89da75edfde81e350355a760c544daa0
3
+ metadata.gz: ecaa5839b6d6b36961b1ff7c0cb3fc9027fc29fd
4
+ data.tar.gz: 89defa9c478c1f58bc182b3e7c8de1695d6001e2
5
5
  SHA512:
6
- metadata.gz: e37dafa2929d7ecc9e1c01543649e4a9f8739658e698311b35a6cf91c0f00402d69db36a371e8fbdb97667e7503a885d5e971a5c9331a794b2082271298a8114
7
- data.tar.gz: 4d2e0255a4777d4793bd3518a7f2c697857d8957f221bd619eb4d78bf14bdabd9414214e70b3fa1167be9fcf28e56cff4ceb24d0605cb4f7c2e8080df3fdaf75
6
+ metadata.gz: 1cab7b6a08d667e0eddc20b3e3ae6ea9d3917580e877a572a07fb1f44964b878df5e8d160267cbb9bc8ea49d25661c1e0159fc4f8c73ac7b0664890d7b1ac6ca
7
+ data.tar.gz: 4b54c6cd99624a0be079aa98b40dd359f3143aac8814f91366f5f98d28dbef4351069596eff3f3809d270acfcc41378d4df1580b6beb2eb2f3947bfaa5c7d778
@@ -75,6 +75,7 @@ module Hobostove
75
75
  end
76
76
 
77
77
  def user(user_id)
78
+ return unless user_id
78
79
  return @users[user_id] if @users[user_id]
79
80
  user = connection.get("/users/#{user_id}.json").body
80
81
  user = JSON.parse(user)["user"]
@@ -1,20 +1,6 @@
1
1
  module Hobostove
2
2
  module Models
3
3
  class Message < Value.new(:id, :timestamp, :type, :user, :body)
4
- def self.convert(tinder_message)
5
- # Tinder explicitly sets nil for "user"
6
- tinder_user = tinder_message.fetch("user", {}) || {}
7
- user = User.convert(tinder_user)
8
-
9
- new(
10
- tinder_message["id"],
11
- tinder_message["created_at"],
12
- tinder_message["type"],
13
- user,
14
- tinder_message["body"]
15
- )
16
- end
17
-
18
4
  def username
19
5
  user.name
20
6
  end
@@ -1,13 +1,6 @@
1
1
  module Hobostove
2
2
  module Models
3
3
  class User < Value.new(:id, :name)
4
- def self.convert(tinder_user)
5
- new(
6
- tinder_user[:id],
7
- tinder_user[:name]
8
- )
9
- end
10
-
11
4
  def eql?(other)
12
5
  id == other.id
13
6
  end
data/lib/hobostove.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'tinder'
4
3
  require 'active_support'
5
4
  require 'active_support/core_ext'
6
5
  require 'curses'
6
+ require 'faraday'
7
+ require 'json'
7
8
  require 'notify'
8
9
  require 'values'
9
10
  require 'yaml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobostove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Oestrich
@@ -11,19 +11,19 @@ cert_chain: []
11
11
  date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: tinder
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '0.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement