diff --git a/CHANGELOG.md b/CHANGELOG.md index afe13ee..ed54178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Unreleased +- un-deprecated `#path` in both `Operation` classes (marked deprecated in 0.7.0) - fixed `CommitMessage#prev_data` throwing an error if `prevData` is nil - updated Firehose message constructors to verify that required fields aren't nil (not only that they're present), and for `LabelsMessage` that `labels` is an array diff --git a/lib/skyfall/firehose/operation.rb b/lib/skyfall/firehose/operation.rb index 768c788..69b4a94 100644 --- a/lib/skyfall/firehose/operation.rb +++ b/lib/skyfall/firehose/operation.rb @@ -42,15 +42,7 @@ module Skyfall alias did repo # @return [String] path part of the record URI (collection + rkey) - # @deprecated Use {#collection} + {#rkey} def path - @@path_warning_printed ||= false - - unless @@path_warning_printed - $stderr.puts "Warning: Skyfall::Firehose::Operation#path is deprecated - use #collection + #rkey" - @@path_warning_printed = true - end - @json['path'] end @@ -71,7 +63,7 @@ module Skyfall # @return [String] full AT URI of the record def uri - "at://#{repo}/#{@json['path']}" + "at://#{repo}/#{path}" end # @return [Oxygene::CID, nil] CID (Content Identifier) of the record (nil for delete operations) diff --git a/lib/skyfall/jetstream/operation.rb b/lib/skyfall/jetstream/operation.rb index 5ef91c2..4fda43b 100644 --- a/lib/skyfall/jetstream/operation.rb +++ b/lib/skyfall/jetstream/operation.rb @@ -42,16 +42,8 @@ module Skyfall alias did repo # @return [String] path part of the record URI (collection + rkey) - # @deprecated Use {#collection} + {#rkey} def path - @@path_warning_printed ||= false - - unless @@path_warning_printed - $stderr.puts "Warning: Skyfall::Jetstream::Operation#path is deprecated - use #collection + #rkey" - @@path_warning_printed = true - end - - @json['collection'] + '/' + @json['rkey'] + @path ||= "#{@json['collection']}/#{@json['rkey']}" end # @return [Symbol] type of the operation (`:create`, `:update` or `:delete`) diff --git a/spec/firehose/operation_spec.rb b/spec/firehose/operation_spec.rb index 8df4528..4f1c184 100644 --- a/spec/firehose/operation_spec.rb +++ b/spec/firehose/operation_spec.rb @@ -41,6 +41,7 @@ describe Skyfall::Firehose::Operation do op.rkey.should == "3mt37ifa2ev2f" op.path.should == "app.bsky.feed.post/3mt37ifa2ev2f" op.uri.should == "at://did:plc:qwerty/app.bsky.feed.post/3mt37ifa2ev2f" + op.path.should == "app.bsky.feed.post/3mt37ifa2ev2f" op.action.should == :create op.cid.should be_a(Oxygene::CID)