transaction 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
  SHA256:
3
- metadata.gz: 3c8e4895b33f06acdd20d5e554880338920870cbb301aa92ea699ac567e67e92
4
- data.tar.gz: 1700236fbc3b59f83fcb1ca6316241452e761e8362affa4e831db924ce752cce
3
+ metadata.gz: ebe1a80b5e33a5409fde10ec7fc5820b79ec8102789326a9ac8bbf8b4b8a3ec1
4
+ data.tar.gz: de004f228488f2b36c58c9028e427787bf5d03bff8d676226186729ec52a1aab
5
5
  SHA512:
6
- metadata.gz: 012baa32c98a5c4ebc90011160ad07df92d80dfbb5ab95173bd8842d373ad1664a46d686adbc23c1d38465af18a311c11f78f1f5b601179ddc9fe4a050aaa657
7
- data.tar.gz: fa079efa3d5abf4dcd35de166dfa0e59c7ec0105b03d01c6568d89083300b01df998de7a18881d078ac827dafbc860c90ee7db256a39560d99a5f791de9c85a6
6
+ metadata.gz: d47be2f17326d9520819bed175dc04c7f9913eb45b2820442c144645d1322bd27013727ed5cb81f2692769d231736b907611db837216e5d1bf465afbc2db6dd2
7
+ data.tar.gz: b87d4532392b8e955299a35fb43be6655a4de2d922ffeb80ae74feb43ab1d6c20743686797d2cd872f7ada9507f1a60006464a36f5fd8347867c12d7805e477b
data/.travis.yml CHANGED
@@ -1,7 +1,14 @@
1
1
  ---
2
+ brances:
3
+ - master
2
4
  sudo: false
3
5
  language: ruby
4
6
  cache: bundler
5
7
  rvm:
6
8
  - 2.5.3
9
+ services:
10
+ - redis-server
7
11
  before_install: gem install bundler -v 2.0.1
12
+ before_script:
13
+ script:
14
+ bundle exec rake spec
data/CHANGELOG.MD CHANGED
@@ -4,11 +4,23 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.2] - 2019-07-18
8
+
9
+ ### Added
10
+ - Travis configuration.
11
+ - Unit tests for methods.
12
+
13
+ ### Changed
14
+ - Status is now always returned as a string (not a sym)
15
+
7
16
  ## [0.1.1] - 2019-07-18
8
17
 
9
18
  ### Added
10
19
  - Changelog to track version changes.
11
20
 
21
+ ### Removed
22
+ - Removed redis from gemfile. Use it as a runtime dependency.
23
+
12
24
  ### Changed
13
25
  - Default attributes
14
26
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transaction (0.1.1)
4
+ transaction (0.1.2)
5
5
  redis (>= 4.0.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/transaction.svg)](https://badge.fury.io/rb/transaction)
2
+ [![Build Status](https://travis-ci.com/t2013anurag/transaction.svg?branch=master)](https://travis-ci.com/t2013anurag/transaction)
3
+
2
4
 
3
5
  # Transaction
4
6
 
data/lib/transaction.rb CHANGED
@@ -39,13 +39,13 @@ module Transaction
39
39
  @attributes = parsed_attributes || {}
40
40
  update_attributes(options) if @attributes.empty?
41
41
 
42
- @status = @attributes[:status]
42
+ @status = @attributes[:status].to_s
43
43
  end
44
44
 
45
45
  def update_attributes(options)
46
46
  @attributes = symbolize_keys!(@attributes.merge!(options))
47
47
  redis_set(@transaction_id, @attributes.to_json)
48
- @status = @attributes[:status]
48
+ @status = @attributes[:status].to_s
49
49
  end
50
50
 
51
51
  def update_status(status)
@@ -59,7 +59,7 @@ module Transaction
59
59
  update_status(:processing)
60
60
  end
61
61
 
62
- def finish! status, clear = false
62
+ def finish!(status, clear = false)
63
63
  update_status(status)
64
64
 
65
65
  redis_delete if clear
@@ -74,7 +74,7 @@ module Transaction
74
74
  @attributes = parsed_attributes
75
75
  raise 'Transaction expired' if @attributes.nil?
76
76
 
77
- @status = @attributes[:status]
77
+ @status = @attributes[:status].to_s
78
78
  end
79
79
 
80
80
  private
@@ -1,3 +1,3 @@
1
1
  module Transaction
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transaction
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
  - Anurag Tiwari