ayadn 4.0 → 4.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6ebd67992a3895ceefe25d38e32281b3f40a340
4
- data.tar.gz: 79aa8fc478f5610abc5295c8b54fc80d24becb4c
3
+ metadata.gz: 02a0cccf2fa086175db55a6fea0e5bdff7212108
4
+ data.tar.gz: 3ca2e5ca712ed2c72dc81983f785d7ff2debe8b5
5
5
  SHA512:
6
- metadata.gz: 5bb3f4b17dcb074d1ed73a080e54c125f5c9640db70c71bf719e0a3bd189298f8f84cca6dc0df626436526467ebb722c1c53444e8de6c3f7a853252112fdc4b8
7
- data.tar.gz: a1b6c4e8d91571e74088b0ce64eaf6b1a009e1ec6356df0a1dc8411eeaf61fdc5d833a1df151bf004d74d1b6bc1a9cd7db22466a82d0cfe30d133d8af53addb4
6
+ metadata.gz: 0ecb46003bc51d754efbbe0b06f11952267c9c0f68837c24813382e1df6674eef56bddb605b4ad4d70a6271dfe0ded668e1a1d1052061a3e5a07ac4f6e902c42
7
+ data.tar.gz: eac8e64ac9316910d854e6dcacbc505b9a6caba55e32e8f7deda2d1a0926766d75f9c87f580f3d55e32a1b0322f6a2cfd341a12199d6657aec75d0d8900ba936
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## 4.0- 2016-05-01 - 'Mr. Robot'
1
+ ## 4.0.1 - 2016-09-03 - 'Halt And Catch Fire'
2
+
3
+ - Fixed: crash when attempting to access a deleted channel
4
+
5
+ ## 4.0 - 2016-05-01 - 'Mr. Robot'
2
6
 
3
7
  - Fixed: when possible, unauthorizing a user keeps the current user logged
4
8
  - Fixed: inconsistencies in the 'set' command
data/lib/ayadn/action.rb CHANGED
@@ -399,7 +399,8 @@ module Ayadn
399
399
  @view.downloading
400
400
  resp = channels.call
401
401
  @view.clear_screen
402
- channels = resp["data"].map { |ch| ChannelObject.new(ch) }
402
+ data = resp["data"]
403
+ channels = data.map { |ch| ChannelObject.new(ch) }
403
404
  @view.show_channels(channels, options)
404
405
  end
405
406
  rescue => e
@@ -45,23 +45,26 @@ module Ayadn
45
45
  attr_reader :input, :pagination_id, :is_inactive, :readers, :you_muted, :you_can_edit, :has_unread, :editors, :annotations, :recent_message_id, :writers, :you_subscribed, :owner, :type, :id, :counts, :recent_message
46
46
 
47
47
  def initialize hash
48
- @input = hash
49
- @pagination_id = @input["pagination_id"]
50
- @is_inactive = @input["is_inactive"]
51
- @readers = ChannelReadersObject.new(@input["readers"])
52
- @you_muted = @input["you_muted"]
53
- @you_can_edit = @input["you_can_edit"]
54
- @has_unread = @input["has_unread"]
55
- @editors = ChannelEditorsObject.new(@input["editors"])
56
- @annotations = @input["annotations"].map { |ann| PostAnnotationObject.new(ann) }
57
- @recent_message_id = @input["recent_message_id"]
58
- @writers = ChannelEditorsObject.new(@input["writers"])
59
- @you_subscribed = @input["you_subscribed"]
60
- @owner = @input["owner"].nil? ? nil : UserObject.new(@input["owner"])
61
- @type = @input["type"]
62
- @id = @input["id"]
63
- @counts = ChannelCountsObject.new(@input["counts"])
64
- @recent_message = @input["recent_message"].nil? ? nil : PostObject.new(@input["recent_message"])
48
+ @input = hash
49
+ @pagination_id = @input["pagination_id"]
50
+ @is_inactive = @input["is_inactive"]
51
+ @readers = ChannelReadersObject.new(@input["readers"])
52
+ @you_muted = @input["you_muted"]
53
+ @you_can_edit = @input["you_can_edit"]
54
+ @has_unread = @input["has_unread"]
55
+ @editors = ChannelEditorsObject.new(@input["editors"])
56
+ @annotations = @input["annotations"].map { |ann| PostAnnotationObject.new(ann) }
57
+ @recent_message_id = @input["recent_message_id"]
58
+ @writers = ChannelEditorsObject.new(@input["writers"])
59
+ @you_subscribed = @input["you_subscribed"]
60
+ if @input["owner"].nil?
61
+ return
62
+ end
63
+ @owner = UserObject.new(@input["owner"])
64
+ @type = @input["type"]
65
+ @id = @input["id"]
66
+ @counts = ChannelCountsObject.new(@input["counts"])
67
+ @recent_message = @input["recent_message"].nil? ? nil : PostObject.new(@input["recent_message"])
65
68
  end
66
69
 
67
70
  end
@@ -82,35 +82,35 @@ module Ayadn
82
82
  attr_accessor :input, :you_muted, :you_can_subscribe, :is_following, :is_follower, :timezone, :you_follow, :counts, :canonical_url, :id, :locale, :type, :annotations, :username, :avatar_image, :description, :is_muted, :follows_you, :you_can_follow, :name, :created_at, :you_blocked, :cover_image, :verified_domain, :meta
83
83
 
84
84
  def initialize hash, username = nil
85
- @input = hash['data'].nil? ? hash : hash['data']
86
- @meta = UserMetaObject.new(hash, username)
87
- @you_muted = @input["you_muted"]
88
- @you_can_subscribe = @input["you_can_subscribe"]
89
- @is_follower = @input["is_follower"]
90
- @is_following = @input["is_following"]
91
- @timezone = @input["timezone"]
92
- @you_follow = @input["you_follow"]
93
- @counts = UserCountsObject.new(@input) unless @input.empty?
94
- @canonical_url = @input["canonical_url"]
95
- @id = @input["id"]
96
- @locale = @input["locale"]
97
- @type = @input["type"]
98
- if !@input["annotations"].nil?
99
- @annotations = @input["annotations"].map { |hash| UserAnnotationObject.new(hash) }
100
- else
101
- @annotations = []
102
- end
103
- @username = @input["username"]
104
- @avatar_image = AvatarImageObject.new(@input) unless @input.empty?
105
- @description = UserDescriptionObject.new(@input) unless @input.empty?
106
- @is_muted = @input["is_muted"]
107
- @follows_you = @input["follows_you"]
108
- @you_can_follow = @input["you_can_follow"]
109
- @name = @input["name"].to_s.force_encoding("UTF-8")
110
- @created_at = @input["created_at"]
111
- @you_blocked = @input["you_blocked"]
112
- @cover_image = CoverImageObject.new(@input) unless @input.empty?
113
- @verified_domain = @input["verified_domain"]
85
+ @input = hash['data'].nil? ? hash : hash['data']
86
+ @meta = UserMetaObject.new(hash, username)
87
+ @you_muted = @input["you_muted"]
88
+ @you_can_subscribe = @input["you_can_subscribe"]
89
+ @is_follower = @input["is_follower"]
90
+ @is_following = @input["is_following"]
91
+ @timezone = @input["timezone"]
92
+ @you_follow = @input["you_follow"]
93
+ @counts = UserCountsObject.new(@input) unless @input.empty?
94
+ @canonical_url = @input["canonical_url"]
95
+ @id = @input["id"]
96
+ @locale = @input["locale"]
97
+ @type = @input["type"]
98
+ if !@input["annotations"].nil?
99
+ @annotations = @input["annotations"].map { |hash| UserAnnotationObject.new(hash) }
100
+ else
101
+ @annotations = []
102
+ end
103
+ @username = @input["username"]
104
+ @avatar_image = AvatarImageObject.new(@input) unless @input.empty?
105
+ @description = UserDescriptionObject.new(@input) unless @input.empty?
106
+ @is_muted = @input["is_muted"]
107
+ @follows_you = @input["follows_you"]
108
+ @you_can_follow = @input["you_can_follow"]
109
+ @name = @input["name"].to_s.force_encoding("UTF-8")
110
+ @created_at = @input["created_at"]
111
+ @you_blocked = @input["you_blocked"]
112
+ @cover_image = CoverImageObject.new(@input) unless @input.empty?
113
+ @verified_domain = @input["verified_domain"]
114
114
  end
115
115
  end
116
116
  end
data/lib/ayadn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Ayadn
3
- VERSION = "4.0"
3
+ VERSION = "4.0.1"
4
4
  end
data/lib/ayadn/workers.rb CHANGED
@@ -335,6 +335,7 @@ module Ayadn
335
335
  no_user = {}
336
336
  api = API.new
337
337
  stream.each do |ch|
338
+ next if ch.id.nil?
338
339
  unless ch.writers.user_ids.empty?
339
340
  @status.say_cyan :parsing, "channel #{ch.id}"
340
341
  usernames = []
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ayadn
3
3
  version: !ruby/object:Gem::Version
4
- version: '4.0'
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor