last_tweet_redux 0.1.1 → 0.1.2

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: 77ecf6be0dd245ecbe2d4d8fc4047e4688b20ec3
4
- data.tar.gz: df9a19f5a45b560293d709ec9ada0080741aad9a
3
+ metadata.gz: a0445e3adaa0f542356812c63c4ffa20e644df9a
4
+ data.tar.gz: ab269fb0e3ee4dd485e6622450ba61ed4baebd0a
5
5
  SHA512:
6
- metadata.gz: 31e9c66a430f99f6d3c4960f98b97d633072e59909c9ab7d5d4cbf12f51780faac3d321a73aa89e37505a9670ecc0c02e23fd55498fc4b85ee96fabc167044f6
7
- data.tar.gz: 3aedc544f7a57c494d4a7a629a0519e4410c5d86a9acc85906e6bab994881047d16e3a17dab54ecc9af8d5660d2fbf833b54fefc693632ce7e098fb2999378d4
6
+ metadata.gz: 41fb1c30485effee7623dd32f78baf412cc621f891240f7a96d25d8c5ed74807740e758373e1c903109e6b1b97f7a318ade7c5684e8e43a459817d236d3dbb5f
7
+ data.tar.gz: f05f4de6a8fad702acbae8aa8d0bf6e003032c8cd255777f0cbc1204c358ec46040f02eb3cb9137678d2fd7bfde00cd9b969ecb597d5c28319b51e86ccec6aa8
@@ -13,7 +13,7 @@ module LastTweetRedux
13
13
  loop do
14
14
  job.run
15
15
 
16
- puts job.instance_eval { @client.get('last_tweet') }
16
+ puts job.instance_eval { Marshal.load @client.get('last_tweet') }
17
17
 
18
18
  GC.start
19
19
 
@@ -1,4 +1,5 @@
1
1
  require 'redis'
2
+ require 'ostruct'
2
3
 
3
4
  module LastTweetRedux
4
5
  class Job
@@ -11,7 +12,7 @@ module LastTweetRedux
11
12
  last_tweet = connection.retrieve_tweet
12
13
  formatted_last_tweet = Formatter.process(last_tweet)
13
14
 
14
- save(formatted_last_tweet.to_json)
15
+ save(formatted_last_tweet)
15
16
  end
16
17
 
17
18
  private
@@ -20,8 +21,13 @@ module LastTweetRedux
20
21
  @connection ||= Connection.new(@options.screen_name, @options.oauth_credentials)
21
22
  end
22
23
 
23
- def save(json_data)
24
- @client.set('last_tweet', json_data)
24
+ def save(tweet_obj)
25
+ @client.set('last_tweet', encode_obj(tweet_obj))
26
+ end
27
+
28
+ def encode_obj(obj)
29
+
30
+ Marshal.dump OpenStruct.new(obj)
25
31
  end
26
32
  end
27
33
  end
@@ -1,3 +1,3 @@
1
1
  module LastTweetRedux
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: last_tweet_redux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marian Posaceanu