skypescraper 0.0.1 → 0.0.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: b8ff00cfaff82852dcbb128034de157a1e553e31
4
- data.tar.gz: 0caca056b0710d33e62a16034eefe7d6fc3d53a2
3
+ metadata.gz: 6a29a8c06de5ba99381efb06a5f5b1982a8eedd3
4
+ data.tar.gz: e19bf97d8b23725470df7f3081c39a295ac617d7
5
5
  SHA512:
6
- metadata.gz: ed817bb46322ed23444c96b20358401e6c992af8b73114056b87af9ce2a89291c75ad69e3af4941b424a7bfe69abc3cd728a23e6228575033e4e84da02aac7c9
7
- data.tar.gz: 45b0961100ecb1b623770aef42c89a126c04cf594bce6129bf4fcc09b57556713e6baddae6cf2a78dbd7a7d29959f669cd53a9119ce676d72fbcf7a0be0e9b95
6
+ metadata.gz: 3cd20854dd5f28b59b3ba285f35bc433679bec0136f94fe39f21feb4933de1e492d55f48121ac50cec781e5dbcf945788750ab626592740397b47536dae153f2
7
+ data.tar.gz: 1dd52043b7d5613c3860815fff2655ce68e8a6e7886776e345f695e5acda206c1f703deedff4e8948bcd782d3704a19fc13bfc6af89851044269aa3bba98807a
data/README.md CHANGED
@@ -29,6 +29,10 @@ participants = conversation.participants # array of participants
29
29
  messages = conversation.messages # array of messages
30
30
  ````
31
31
 
32
+ ## Changelog
33
+
34
+ 0.0.2 - Fixed bug with wrong conversations memoization
35
+
32
36
  ## Development
33
37
 
34
38
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -34,13 +34,16 @@ module Skypescraper
34
34
  ORDER BY last_activity_timestamp DESC
35
35
  SQL
36
36
  def conversations_for(identity)
37
- return @conversations if @conversations
37
+ return @conversations[identity] if @conversations && @conversations[identity]
38
+
39
+ @conversations ||= {}
40
+ @conversations[identity] = []
38
41
 
39
- @conversations = []
40
42
  connection.execute(CONVERSATIONS_SQL, identity) do |row|
41
- @conversations << Skypescraper::Conversation.new(*row)
43
+ @conversations[identity] << Skypescraper::Conversation.new(*row)
42
44
  end
43
- @conversations
45
+
46
+ @conversations[identity]
44
47
  end
45
48
  end
46
49
  end
@@ -1,3 +1,3 @@
1
1
  module Skypescraper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skypescraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Nosov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3