flowcommerce_spree 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 6893ddfb8f021ff6400c0bbe31fc6b2c532886892730a1c9097d172944a8eca8
4
- data.tar.gz: 9d3a1b190708053a5ad664588abe553617cf07a02ce6fb8f8b2b9d8d17b393a7
3
+ metadata.gz: 679a3d268ba2e06caff2460bcfd86b671630de034567017f5a9b8f51a6c20d4b
4
+ data.tar.gz: 6c95ee74d3783dbb01f1aa1ae9107b386b75de5de9f298d9ea65270ed5a43ffa
5
5
  SHA512:
6
- metadata.gz: 531a87c9a666b3057d16983c3e6168492ac124112a881821891e3bb2174f7e5589785301e023348f3bb06ef2ea105961f20a6a2aaa884e9845e92896973586d7
7
- data.tar.gz: c84a3cb370744c3313b04cdc513d38d70ea0aaa01e7e09470bdf768f77d41fdb0c4bb9df240bbe4fec58adc4068b96d64fa538a315d73e8a361a1f718ecc6b46
6
+ metadata.gz: af6dba3c9673dbedf2b3d3672c9dc7a09375a7bc12581393ec4173df0cefe2157d2d4022bcf3b0ac0ceeedf87b91fd6e71558d296d1d848d60abac18de9de47a
7
+ data.tar.gz: 9ad313a9ab18cb88bb9fe68dff643933bf2b940613ca1a11fd5014c51cfa26bf911443074254c719d393cb1671ef36819b3e292730d677622135bf94a464c83e
data/README.md CHANGED
@@ -57,35 +57,79 @@ All flowcommerce_spree code is located in the ./app and ./lib folders.
57
57
  `serialize :flow_data, ActiveRecord::Coders::JSON.new(symbolize_keys: true)`
58
58
 
59
59
 
60
+ ## FlowcommerceSpree::Api module
60
61
 
61
- ## Flow API specific
62
-
63
- Classes that begin with Flow are responsible for communicating with flow API.
64
-
65
- ### Flow
66
-
67
- Helper class that offers low level flow api access and few helper methods.
62
+ This is a legacy module using the `curl` gem for making direct calls to flow.io API. It will be refactored out in
63
+ future versions of the gem in favor of using the official flow.io API client from the `flowcommerce` gem.
68
64
 
69
65
  ### FlowcommerceSpree::ExperienceService
70
66
 
71
67
  Responsible for selecting current experience. You have to define available experiences in flow console.
72
68
 
73
- ### Flow::Order
69
+ ### FlowcommerceSpree::OrderSync
74
70
 
75
71
  Maintain and synchronizes Spree::Order with Flow API.
76
72
 
77
- ### Flow::Session
73
+ ### FlowcommerceSpree::Session
78
74
 
79
75
  Every shop user has a session. This class helps in creating and maintaining session with Flow.
80
76
 
81
- ## Decorators
77
+ ### Decorators
82
78
 
83
- Decorators are found in ./app/flow/decorators folders and they decorate Spree models with Flow specific methods.
84
-
85
- All methods are prefixed with ```flow_```.
86
-
87
- ## Helper lib
79
+ Decorators are used extensively across the gem to modify or add behaviour of several Spree classes and modules. To
80
+ properly deal with the precedence in the Ruby ancestor chain, the `class_eval`, `include` and `prepend` methods are
81
+ being used, depending on the level of modification.
88
82
 
89
83
  ### Spree::Flow::Gateway
90
84
 
91
85
  Adapter for Spree, that allows using [Flow.io](https://www.flow.io) as payment gateway. Flow is PCI compliant payment processor.
86
+
87
+ ## Gem Maintenance
88
+
89
+ ### Preparing a release
90
+
91
+ Merge all the pull requests that should make it into the new release into the `main` branch, then checkout and pull the
92
+ branch and run the `github_changelog_generator`, specifying the new version as a `--future-release` cli parameter:
93
+
94
+ ```
95
+ git checkout main
96
+ git pull
97
+
98
+ github_changelog_generator -u mejuri-inc -p flowcommerce_spree --future-release v0.0.2
99
+ ```
100
+
101
+ Then add the changes to `git`, commit and push the `Preparing the new release` commit directly into the `main` branch:
102
+
103
+ ```
104
+ git add .
105
+ git commit -m 'Preparing the new v0.0.2 release'
106
+ git push
107
+ ```
108
+
109
+ ### RubyGems credentials
110
+
111
+ Ensure you have the RubyGems credentials located in the `~/.gem/credentials` file.
112
+
113
+ ### Adding a gem owner
114
+
115
+ ```
116
+ gem owner flowcommerce_spree -a sebastian.deluca@mejuri.com
117
+ ```
118
+
119
+ ### Building a new gem version
120
+
121
+ Adjust the new gem version number in the `lib/flowcommerce_spree/version.rb` file. It is used when building the gem
122
+ by the following command:
123
+
124
+ ```
125
+ gem build flowcommerce_spree.gemspec
126
+ ```
127
+
128
+ Asuming the version was set to `0.0.1`, a `flowcommerce_spree-0.0.1.gem` will be generated at the root of the app
129
+ (repo).
130
+
131
+ ### Pushing a new gem release to RubyGems
132
+
133
+ ```
134
+ gem push flowcommerce_spree-0.0.1.gem # don't forget to specify the correct version number
135
+ ```
@@ -49,7 +49,7 @@ module Spree
49
49
  rmin = min&.amount&.to_s(:rounded, precision: 0) || 0
50
50
  rmax = max&.amount&.to_s(:rounded, precision: 0) || 0
51
51
 
52
- prices[currency] = rmin == rmax ? { amount: rmin } : { min: rmin, max: rmax }
52
+ prices[currency] = { min: rmin, max: rmax }
53
53
  end
54
54
 
55
55
  add_flow_price_range(prices, product_zone)
@@ -82,7 +82,7 @@ module Spree
82
82
  rmin = min&.amount&.to_s(:rounded, precision: 0) || 0
83
83
  rmax = max&.amount&.to_s(:rounded, precision: 0) || 0
84
84
 
85
- prices[currency] = rmin == rmax ? { amount: rmin } : { min: rmin, max: rmax }
85
+ prices[currency] = { min: rmin, max: rmax }
86
86
  prices
87
87
  end
88
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FlowcommerceSpree
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce_spree
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
  - Aurel Branzeanu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-03 00:00:00.000000000 Z
12
+ date: 2021-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize