stream-ruby 2.3.1 → 2.4.0

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: e14cbffdc409dcf7c7563a61762ebd8fca569440
4
- data.tar.gz: 4a0926b1ab3df85e99e690ad0ea708df3cff2ddb
3
+ metadata.gz: 1efedf45fcda44ba8f4fb337e4ce94d2727a1e3a
4
+ data.tar.gz: 967edf9f6e4e47e37e691f928bfffa69f497f9f5
5
5
  SHA512:
6
- metadata.gz: 8b0c17fb5b1bd49899b6e400bd077c11d46f4e1057f35a6435c48c1a14579ffd5b14b0079e00183d09ff80ddf6359dab0b0fee8e33bdaa45ea8f0a1d036760b7
7
- data.tar.gz: 8baed05bc37bfae4b4e71460960c3f6853e342ac0fb7b8b9f54ba8573d72bcd83acbfcfec326753245d80083f5e044a8bfaaa4632acb34e98909879823982dcb
6
+ metadata.gz: e197fd0fadfa20d6715f11908de2ed12b6fd043142af9355000257771e4cd2c34ab8983dd19cb0bd3959c5326d4fd49bf5cb0546012a0ac47eb4725240cd6284
7
+ data.tar.gz: 749465c6d58fa721ab789b6700be7183222e46d056d4333a1142da78dd505c8e8739e14055794295b97054b3f0267f293cbdfe4635563b8a57643596deb510f1
data/README.md CHANGED
@@ -3,7 +3,7 @@ stream-ruby
3
3
 
4
4
  [![Build Status](https://travis-ci.org/GetStream/stream-ruby.svg?branch=master)](https://travis-ci.org/GetStream/stream-ruby) [![Gem Version](https://badge.fury.io/rb/stream-ruby.svg)](http://badge.fury.io/rb/stream-ruby)
5
5
 
6
- stream-ruby is the official Ruby client for [Stream](https://getstream.io/), a web service for building scalable newsfeeds and activity streams.
6
+ stream-ruby is the official Ruby client for [Stream](https://getstream.io/), a web service for building scalable newsfeeds and activity streams.
7
7
  The full documentation is available on [GetStream.io/docs](http://getstream.io/docs/). Note that there is also a [higher level Rails integration](https://github.com/getstream/stream-rails) which hooks into your ORM.
8
8
 
9
9
  ### Installation
@@ -39,6 +39,13 @@ activity_data = {:actor => 1, :verb => 'tweet', :object => 1, :foreign_id => 'tw
39
39
  }
40
40
  activity_response = user_feed_1.add_activity(activity_data)
41
41
 
42
+ # Update an existing activity (requires both :foreign_id and :time fields)
43
+ activity_data = {:actor => 1, :verb => 'tweet', :object => 1, :foreign_id => 'tweet:1', :popularity => 100}
44
+ user_feed_1.update_activity(activity_data)
45
+
46
+ # Update activities
47
+ user_feed_1.update_activities([activity_data])
48
+
42
49
  # Remove an activity by its id
43
50
  user_feed_1.remove_activity('e561de8f-00f1-11e4-b400-0cc47a024be0')
44
51
 
@@ -106,4 +113,3 @@ client.add_to_many(activity, feeds)
106
113
  ```
107
114
 
108
115
  Docs are available on [GetStream.io](http://getstream.io/docs/).
109
-
data/lib/stream/feed.rb CHANGED
@@ -91,6 +91,16 @@ module Stream
91
91
  @client.make_request(:delete, uri, auth_token, params)
92
92
  end
93
93
 
94
+ def update_activity(activity)
95
+ update_activities([activity])
96
+ end
97
+
98
+ def update_activities(activities)
99
+ auth_token = create_jwt_token("activities", "*", "*")
100
+
101
+ @client.make_request(:post, "/activities/", auth_token, {}, { "activities" => activities })
102
+ end
103
+
94
104
  def delete
95
105
  uri = "/feed/#{@feed_url}/"
96
106
  auth_token = create_jwt_token("feed", "delete")
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = "2.3.1"
2
+ VERSION = "2.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommaso Barbugli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty