omie-client 0.1.4 → 0.1.5

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: 72a1de613fdbc2ba050cfaa890e82d04b57ce34d9715dd2b00a81dfb6816129a
4
- data.tar.gz: cb79914f46a01909b57f794c09ac1b529ba6c03a4a4daa29ef67c972b5452c09
3
+ metadata.gz: 93709fdff9221e8360fe0c77374ff883659d5e158fc8bfa1353dad9c961470f9
4
+ data.tar.gz: bf3d5191c9d1479515d665a1b36ec1e1fb420cb0f6d9823946129c475b2190de
5
5
  SHA512:
6
- metadata.gz: f08dd02f8e999d00b363d0075eca5482ee467d738ee18824883b6c2021ab103aa3bf5663e4d6adb00a7ed3e1b363df83c5265c6ea664d525ccf20780c5d5030a
7
- data.tar.gz: d552b52fca09746097ee3558fa4db1aeb7f8ac74682405a858012572e2daedbe68249322011ed27a316ee4338496a8ebff94048cd1efa4a970d30b4f40dbaaa0
6
+ metadata.gz: f672cb89d67a4587c0bb42ea780627f28669e45bc4b92d0b0159ead56e8965e557f7a3b473c59980fcd451a8d6229d068bb2fa9b780c62bb693c357e8ba7d1f2
7
+ data.tar.gz: e0a1dd775e8897a5f1c1c192e1e748315a23b8942ae05de01654c47b1fa31d77090aceb33ba8ea14399ebe5c8c12019b24aaa21b788986e3a975bb2de11f1fd2
data/.rubocop.yml CHANGED
@@ -14,3 +14,12 @@ Metrics/BlockLength:
14
14
  Lint/AmbiguousBlockAssociation:
15
15
  Exclude:
16
16
  - "spec/**/*"
17
+
18
+ Style/HashEachMethods:
19
+ Enabled: true
20
+
21
+ Style/HashTransformKeys:
22
+ Enabled: true
23
+
24
+ Style/HashTransformValues:
25
+ Enabled: true
data/README.md CHANGED
@@ -104,7 +104,7 @@ from the API, please open an issue first to avoid duplicated work.
104
104
  To properly test if the gem is working properly, you can install it locally:
105
105
  ```sh
106
106
  gem build omie-client.gemspec
107
- gem install ./omie-client.gemspec-x.y.z.gem
107
+ gem install ./omie-client-x.y.z.gem
108
108
  ```
109
109
  The `x.y.z` represents the version described in [lib/omie/version.rb](lib/omie/version.rb)
110
110
 
@@ -117,10 +117,10 @@ irb
117
117
  ```
118
118
 
119
119
  ```ruby
120
- require 'omie-client'
120
+ require 'omie'
121
121
  => true
122
- Omie.version
123
- => x.y.z
122
+ Omie::VERSION
123
+ => "x.y.z"
124
124
  # Default credentials provided by Omie API for tests
125
125
  Omie.app_key = '1560731700'
126
126
  Omie.app_secret = '226dcf372489bb45ceede61bfd98f0f1'
@@ -129,6 +129,16 @@ Omie::Company.list
129
129
  Omie::Product.list
130
130
  ```
131
131
 
132
+ If everything is working fine and you have the proper credentials to upload
133
+ the new version, run:
134
+
135
+ ```sh
136
+ gem push omie-client-x.y.z.gem
137
+ Pushing gem to RubyGems.org...
138
+ Successfully registered gem: omie-client (x.y.z)
139
+ ```
140
+ > You may need to authenticate at rubygems first => https://guides.rubygems.org/make-your-own-gem/
141
+
132
142
  ## License
133
143
 
134
144
  See the [LICENSE](LICENSE) file.
data/lib/omie/product.rb CHANGED
@@ -24,6 +24,7 @@ module Omie
24
24
 
25
25
  attr_accessor :ncm, :valor_unitario, :unidade, :descricao_status
26
26
  attr_accessor :codigo_produto_integracao, :codigo_produto, :descricao
27
+ attr_accessor :codigo, :tipoItem # They do not keep the same name style =(
27
28
 
28
29
  # Record a new product using the
29
30
  # {https://app.omie.com.br/api/v1/geral/produtos/#IncluirProduto
@@ -92,10 +93,20 @@ module Omie
92
93
  # the page to be returned.
93
94
  # @param per_page [Integer]
94
95
  # the number of items per page (max: 50).
96
+ # @param only_imported [String]
97
+ # related to 'apenas_importado_api' params, accept 'S' or 'N'.
98
+ # @param only_pdv [String]
99
+ # related to 'filtrar_apenas_omiepdv' params, accept 'S' or 'N'.
95
100
  # @return [Array<Omie::Product>]
96
101
  # the list of found companies
97
- def self.list(page = 1, per_page = 50)
98
- params = { pagina: page, registros_por_pagina: per_page }
102
+ def self.list(
103
+ page = 1, per_page = 50, only_imported = 'N', only_pdv = 'N'
104
+ )
105
+ params = {
106
+ pagina: page, registros_por_pagina: per_page,
107
+ apenas_importado_api: only_imported,
108
+ filtrar_apenas_omiepdv: only_pdv
109
+ }
99
110
 
100
111
  response = request(URI, CALLS[:list], params)
101
112
  response['produto_servico_cadastro'].map do |product|
data/lib/omie/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Omie
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omie-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peerdustry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-17 00:00:00.000000000 Z
11
+ date: 2020-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler