ssd 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3612cdb1ce4050fcce37d43f7bed735b2ab3a8e3
4
- data.tar.gz: 034c08db0254a426d7236d79374ff042e1ea5c5e
3
+ metadata.gz: 8b92b6965932b8d802b091967ab77bb96bc70aeb
4
+ data.tar.gz: 31f3d7183f06ebf5bcfb994f9ea98dcce56f25b0
5
5
  SHA512:
6
- metadata.gz: 1e7700b75c47565ac400f184fee70134bf52e94f69dca1a923a25dea8a0d8db008b408775461e27dd0b791fa7909c64c726436a7b4184f14a4bf3fa7ee524fb8
7
- data.tar.gz: 2e4b4138b8031616a268ccf5fabb1cbff44635467e7fe14231a3b56a59dcee7bc974c990780846e19abfaeb07d5cb8de1b4217dac80c6c754733cde9b61d15ff
6
+ metadata.gz: f7ab0c3636b09dffd47ed82beb7f5f1bdd1ffc149822b172e6be1d8269e8eb9acf33a28c9f365b2c3d8621c5f230189546c38ae1fd2ae5a098abe1462f18f912
7
+ data.tar.gz: 4b8a3d685f228d66a99ab8791603c7819b316e6e4ad1669c516b35a2fa37d22ff5880eed16c5c05ce2f8c39c56e05b91415a5cb4b60e56afcf6ad860ea5c0fbe
data/README.md CHANGED
@@ -28,6 +28,15 @@ class User
28
28
  include SSD
29
29
  attr_accessor :id # ssd key
30
30
  end
31
+
32
+ class API
33
+ get '\' do
34
+ @user = User.new # Initialize an object form any Class that `include SSD`
35
+ @user.id = "generated_id" # Give it an ssd key via it's :id
36
+ @user.append # Do an `append` operation and viola! DONE
37
+ User.get("generated_id") # Later to read it via Class.get(id)
38
+ end
39
+ end
31
40
  ```
32
41
 
33
42
  Concerns FAQs
data/lib/ssd.rb CHANGED
@@ -56,9 +56,9 @@ module SSD
56
56
  end
57
57
  end
58
58
 
59
- alias append []=
60
- alias save []=
61
- alias store []=
59
+ alias append! []=
60
+ alias save! []=
61
+ alias store! []=
62
62
  end
63
63
 
64
64
  module ClassMethods
data/lib/ssd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SSD
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/specs/ssd_spec.rb CHANGED
@@ -11,12 +11,12 @@ describe SSD do
11
11
  @generated_id = Random.new.seed
12
12
  end
13
13
 
14
- describe "#append" do
14
+ describe "#append!" do
15
15
  it "saves an object to the database" do
16
16
  #skip
17
17
  @user = User.new
18
18
  @user.id = @generated_id
19
- @user.append
19
+ @user.append!
20
20
  @user.id.must_equal @generated_id
21
21
  end
22
22
  end
@@ -26,27 +26,27 @@ describe SSD do
26
26
  # skip
27
27
  @user = User.new
28
28
  @user.id = @generated_id
29
- @user.append
29
+ @user.append!
30
30
  user = User.get(@generated_id)
31
31
  user.id.must_equal @generated_id
32
32
  end
33
33
  end
34
34
 
35
- describe "an append-only operations" do
35
+ describe "an append!-only operations" do
36
36
  it "it keeps adding new objects" do
37
37
  @user = User.new
38
38
 
39
39
  @user.id = @generated_id
40
40
  @user.location = "Egypt"
41
- @user.append
41
+ @user.append!
42
42
 
43
43
  @user = User.get(@generated_id)
44
44
  @user.location = "Brazil"
45
- @user.append
45
+ @user.append!
46
46
 
47
47
  @user = User.get(@generated_id)
48
48
  @user.location = "France"
49
- @user.append
49
+ @user.append!
50
50
 
51
51
  User.count(@generated_id).must_equal 3
52
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - zotherstupidguy