myfinance-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +2 -0
- data/lib/myfinance/categoria.rb +17 -0
- data/lib/myfinance/centro_receita_custo.rb +27 -0
- data/lib/myfinance/conta_a_pagar.rb +13 -0
- data/lib/myfinance/conta_a_receber.rb +15 -0
- data/lib/myfinance/entidade.rb +24 -0
- data/lib/myfinance/imposto.rb +17 -0
- data/lib/myfinance/pessoa.rb +29 -0
- data/lib/myfinance/version.rb +3 -0
- data/lib/myfinance.rb +50 -0
- data/myfinance-rails.gemspec +25 -0
- data/spec/features/categoria_spec.rb +20 -0
- data/spec/features/contas_a_receber_spec.rb +54 -0
- data/spec/features/entidades_spec.rb +20 -0
- data/spec/features/imposto_spec.rb +16 -0
- data/spec/features/pessoas_spec.rb +35 -0
- data/spec/spec_helper.rb +89 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d541391db166211eecfd92cb217d65cd79284194
|
4
|
+
data.tar.gz: 32d185b2609b14e91ed43621a09d9a783fff6335
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e0c11c0d975fac78bfce3f4fb123bec56edbb17e0055116ccb6340aba9dc7abd407b70131530092e89bb6c72707b797dc32aee8b69c02a3584ce2108b16ed128
|
7
|
+
data.tar.gz: 071eef6e92d2eab6c96c152a13d634cd61602f98c8030413e8eb8982cbfc02b1d05ddf7849ba18ffc9d28ac0942cd3008aabde7d097094dd722fe2e7fcaf39dd
|
data/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
.idea
|
24
|
+
.ruby-gemset
|
25
|
+
.ruby-version
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 José Lopes Neto
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Myfinance::Rails
|
2
|
+
|
3
|
+
API integration with MyFinance (www.myfinance.com.br)
|
4
|
+
|
5
|
+
# API Documentation
|
6
|
+
|
7
|
+
https://app.myfinance.com.br/docs/api
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'myfinance-rails'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install myfinance-rails
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it ( https://github.com/[my-github-username]/myfinance-rails/fork )
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Myfinance
|
2
|
+
|
3
|
+
def self.categoria_id(nome)
|
4
|
+
mid = nil
|
5
|
+
response = lget '/categories.json'
|
6
|
+
response.each do | item |
|
7
|
+
category = item['category']
|
8
|
+
if category['full_name'] == nome
|
9
|
+
mid = category['id']
|
10
|
+
break
|
11
|
+
end
|
12
|
+
end
|
13
|
+
mid
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Myfinance
|
2
|
+
|
3
|
+
def self.centro_de_receita_id(nome)
|
4
|
+
centro_id(nome,false)
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.centro_de_custo_id(nome)
|
8
|
+
centro_id(nome,true)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.centro_id(nome, custo = nil)
|
12
|
+
mid = nil
|
13
|
+
response = lget '/classification_centers.json'
|
14
|
+
response.each do | item |
|
15
|
+
cc = item['classification_center']
|
16
|
+
if cc['name'] == nome
|
17
|
+
if custo.nil? or cc['cost_center'] == custo
|
18
|
+
mid = cc['id']
|
19
|
+
end
|
20
|
+
break
|
21
|
+
end
|
22
|
+
end
|
23
|
+
mid
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Myfinance
|
2
|
+
|
3
|
+
def self.cria_conta_a_pagar(nome_da_entidade,pagamento)
|
4
|
+
entity_id = entidade_id(nome_da_entidade)
|
5
|
+
payable_account = {
|
6
|
+
'payable_account' => pagamento
|
7
|
+
}
|
8
|
+
response = lpost "/entities/#{entity_id}/payable_accounts.json", payable_account
|
9
|
+
response['payable_account']
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Myfinance
|
2
|
+
|
3
|
+
def self.cria_conta_a_receber(nome_da_entidade,faturamento)
|
4
|
+
entity_id = entidade_id(nome_da_entidade)
|
5
|
+
receivable_account = {
|
6
|
+
'receivable_account' => faturamento
|
7
|
+
}
|
8
|
+
response = lpost "/entities/#{entity_id}/receivable_accounts.json", receivable_account
|
9
|
+
response['receivable_account']
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Myfinance
|
2
|
+
|
3
|
+
def self.entidade_id(nome)
|
4
|
+
mid = nil
|
5
|
+
response = lget '/entities.json'
|
6
|
+
response.each do | ent |
|
7
|
+
cliente = ent['entity']
|
8
|
+
if cliente['name'] == nome
|
9
|
+
mid = cliente['id']
|
10
|
+
break
|
11
|
+
end
|
12
|
+
end
|
13
|
+
mid
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.entidade(nome)
|
17
|
+
mid = entidade_id(nome)
|
18
|
+
response = lget "/entities/#{mid}.json"
|
19
|
+
response['entity']
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Myfinance
|
2
|
+
|
3
|
+
def self.pessoa_id(cnpj)
|
4
|
+
mid = nil
|
5
|
+
response = lget '/people.json'
|
6
|
+
response.each do | people |
|
7
|
+
cliente = people['person']
|
8
|
+
if cliente['federation_subscription_number_only_numbers'] == cnpj or cliente['federation_subscription_number'] == cnpj
|
9
|
+
mid = cliente['id']
|
10
|
+
break
|
11
|
+
end
|
12
|
+
end
|
13
|
+
mid
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.pessoa(cnpj)
|
17
|
+
mid = pessoa_id(cnpj)
|
18
|
+
response = lget "/people/#{mid}.json"
|
19
|
+
response['parsed_response']['person']
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.cria_pessoa( pessoa )
|
23
|
+
# Vou rezar para que de certo
|
24
|
+
people = { 'person' => pessoa }
|
25
|
+
lpost '/people.json', people
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
data/lib/myfinance.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'myfinance/version'
|
3
|
+
require 'myfinance/entidade'
|
4
|
+
require 'myfinance/pessoa'
|
5
|
+
require 'myfinance/conta_a_receber'
|
6
|
+
require 'myfinance/imposto'
|
7
|
+
require 'myfinance/categoria'
|
8
|
+
require 'myfinance/centro_receita_custo'
|
9
|
+
|
10
|
+
module Myfinance
|
11
|
+
|
12
|
+
include HTTParty
|
13
|
+
|
14
|
+
attr_accessor :token, :endpoint
|
15
|
+
|
16
|
+
def self.setup(token,production=false)
|
17
|
+
if production
|
18
|
+
@endpoint = 'https://app.myfinance.com.br'
|
19
|
+
else
|
20
|
+
@endpoint = 'https://sandbox.myfinance.com.br'
|
21
|
+
end
|
22
|
+
base_uri @endpoint
|
23
|
+
@token = token
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def self.lget(url)
|
29
|
+
options = {
|
30
|
+
:basic_auth => {:username => @token, :password => 'x'},
|
31
|
+
}
|
32
|
+
get url, options
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.lpost(url,data)
|
36
|
+
options = {
|
37
|
+
:basic_auth => {:username => @token, :password => 'x'},
|
38
|
+
:body => data.to_json,
|
39
|
+
:headers => { 'Content-Type' => 'application/json' }
|
40
|
+
}
|
41
|
+
response = post url, options
|
42
|
+
response
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.format_time(dt)
|
46
|
+
dt.strftime('%FT%H:%MZ') rescue nil
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'myfinance/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'myfinance-rails'
|
8
|
+
spec.version = Myfinance::VERSION
|
9
|
+
spec.authors = ['José Lopes Neto']
|
10
|
+
spec.email = ['jose.neto@taxweb.com.br']
|
11
|
+
spec.summary = %q{GEM para facilitar a uso da API do Myfinance em Aplicativos Rails}
|
12
|
+
spec.description = %q{GEM para facilitar a uso da API do Myfinance em Aplicativos Rails usando HTTParty}
|
13
|
+
spec.homepage = ''
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'rspec'
|
24
|
+
spec.add_dependency 'httparty','~> 0.13.1'
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
describe 'Manipulando Pessoas', type: :feature do
|
2
|
+
|
3
|
+
require 'myfinance'
|
4
|
+
|
5
|
+
it 'deve pegar o id de uma categoria e de centro de receita pelo nome' do
|
6
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
7
|
+
categoria_id = Myfinance.categoria_id('Alimentação / Restaurantes')
|
8
|
+
centro_de_receita_id = Myfinance.centro_de_receita_id('Projetos')
|
9
|
+
expect(categoria_id).to_not be_nil
|
10
|
+
expect(centro_de_receita_id).to_not be_nil
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'Não deve pegar o id de uma categoria de custo para receita' do
|
14
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
15
|
+
centro_de_receita_id = Myfinance.centro_de_custo_id('Projetos')
|
16
|
+
expect(centro_de_receita_id).to be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
describe 'Manipulando Contas a Receber', type: :feature do
|
2
|
+
|
3
|
+
require 'myfinance'
|
4
|
+
|
5
|
+
it 'deve poder criar uma conta a receber para uma entidade e um cliente' do
|
6
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
7
|
+
|
8
|
+
cliente_id = Myfinance.pessoa_id('27.206.831/0001-70')
|
9
|
+
categoria_id = Myfinance.categoria_id('Alimentação / Restaurantes')
|
10
|
+
centro_de_receita_id = Myfinance.centro_de_receita_id('Projetos')
|
11
|
+
|
12
|
+
faturamento = {
|
13
|
+
'due_date' => (Date.today + 30),
|
14
|
+
'occurred_at' => nil,
|
15
|
+
'amount' => '100.0',
|
16
|
+
'nominal_amount' => '100.0',
|
17
|
+
'ticket_amount' => nil,
|
18
|
+
'interest_amount' => 2,
|
19
|
+
'discount_amount' => 5.0,
|
20
|
+
'total_amount' => nil,
|
21
|
+
'description' => 'Descrição do Faturamento',
|
22
|
+
'document' => 'Contrato XPTO 30',
|
23
|
+
'document_emission_date' => Date.today,
|
24
|
+
'observation' => 'Observação do Faturamento',
|
25
|
+
'income_tax_relevant' => true,
|
26
|
+
'category_id' => categoria_id,
|
27
|
+
'classification_center_id' => centro_de_receita_id,
|
28
|
+
'person_id' => cliente_id,
|
29
|
+
'expected_deposit_account_id' => nil,
|
30
|
+
'create_as_recurrent' => nil,
|
31
|
+
'remind' => true,
|
32
|
+
'financial_account_taxes_attributes' => [
|
33
|
+
{
|
34
|
+
'tax_id' => Myfinance.imposto_id('ISS'),
|
35
|
+
'amount' => '20.0'
|
36
|
+
},
|
37
|
+
{
|
38
|
+
'tax_id' => Myfinance.imposto_id('PIS'),
|
39
|
+
'amount' => '1.5'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
'tax_id' => Myfinance.imposto_id('COFINS'),
|
43
|
+
'amount' => '2.0'
|
44
|
+
},
|
45
|
+
|
46
|
+
]
|
47
|
+
}
|
48
|
+
conta_a_receber = Myfinance.cria_conta_a_receber('Minhas Finanças',faturamento)
|
49
|
+
expect(conta_a_receber['id']).to_not be_nil
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
describe 'Manipulando Entidades', type: :feature do
|
2
|
+
|
3
|
+
require 'myfinance'
|
4
|
+
|
5
|
+
it 'deve poder pegar o id de uma entidade pelo seu nome' do
|
6
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
7
|
+
nome = 'Minhas Finanças'
|
8
|
+
id = Myfinance.entidade_id(nome)
|
9
|
+
expect(id).to_not be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'deve poder ler os dados uma entidade pelo seu nome' do
|
13
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
14
|
+
nome = 'Minhas Finanças'
|
15
|
+
entidade = Myfinance.entidade(nome)
|
16
|
+
expect(entidade['created_at']).to_not be_nil
|
17
|
+
expect(entidade['deleted_at']).to be_nil
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
describe 'Manipulando Contas a Receber', type: :feature do
|
2
|
+
|
3
|
+
require 'myfinance'
|
4
|
+
|
5
|
+
it 'devo poder ler o id de um impostos' do
|
6
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
7
|
+
icms_id = Myfinance.imposto_id('ICMS')
|
8
|
+
expect(icms_id).to_not be_nil
|
9
|
+
ipi_id = Myfinance.imposto_id('IPI')
|
10
|
+
expect(ipi_id).to_not be_nil
|
11
|
+
iss_id = Myfinance.imposto_id('ISS')
|
12
|
+
expect(iss_id).to_not be_nil
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
describe 'Manipulando Pessoas', type: :feature do
|
2
|
+
|
3
|
+
require 'myfinance'
|
4
|
+
|
5
|
+
it 'deve poder criar um cliente e achar o seu id pelo cnpj' do
|
6
|
+
Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
|
7
|
+
cliente = {
|
8
|
+
'address'=>'Rua Tal, número 0',
|
9
|
+
'city'=>'Rio de Janeiro',
|
10
|
+
'complement'=>'sala 1234',
|
11
|
+
'country'=>'Brasil',
|
12
|
+
'customer'=>true,
|
13
|
+
'email'=>'cliente@fulano.com',
|
14
|
+
'federation_subscription_number'=>'27.206.831/0001-70',
|
15
|
+
'name'=>'Fulano de Tal',
|
16
|
+
'note'=>'Notas sobre este cliente...',
|
17
|
+
'person_type'=>'JuridicalPerson',
|
18
|
+
'phone'=>'(21) 5555-1234',
|
19
|
+
'site'=>'http=>//www.fulano.com',
|
20
|
+
'state'=>'RJ',
|
21
|
+
'supplier'=>false,
|
22
|
+
'zip_code'=>'22290-080'
|
23
|
+
}
|
24
|
+
novo_cliente = Myfinance.cria_pessoa(cliente)
|
25
|
+
expect(novo_cliente['name']).to_not be_nil
|
26
|
+
|
27
|
+
id = Myfinance.pessoa_id(cliente['federation_subscription_number'])
|
28
|
+
expect(id).to_not be_nil
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
50
|
+
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
57
|
+
|
58
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
59
|
+
# be too noisy due to issues in dependencies.
|
60
|
+
config.warnings = true
|
61
|
+
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
63
|
+
# file, and it's useful to allow more verbose output when running an
|
64
|
+
# individual spec file.
|
65
|
+
if config.files_to_run.one?
|
66
|
+
# Use the documentation formatter for detailed output,
|
67
|
+
# unless a formatter has already been configured
|
68
|
+
# (e.g. via a command-line flag).
|
69
|
+
config.default_formatter = 'doc'
|
70
|
+
end
|
71
|
+
|
72
|
+
# Print the 10 slowest examples and example groups at the
|
73
|
+
# end of the spec run, to help surface which specs are running
|
74
|
+
# particularly slow.
|
75
|
+
config.profile_examples = 10
|
76
|
+
|
77
|
+
# Run specs in random order to surface order dependencies. If you find an
|
78
|
+
# order dependency and want to debug it, you can fix the order by providing
|
79
|
+
# the seed, which is printed after each run.
|
80
|
+
# --seed 1234
|
81
|
+
config.order = :random
|
82
|
+
|
83
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
84
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
85
|
+
# test failures related to randomization by passing the same `--seed` value
|
86
|
+
# as the one that triggered the failure.
|
87
|
+
Kernel.srand config.seed
|
88
|
+
=end
|
89
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: myfinance-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- José Lopes Neto
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: httparty
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.13.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.13.1
|
69
|
+
description: GEM para facilitar a uso da API do Myfinance em Aplicativos Rails usando
|
70
|
+
HTTParty
|
71
|
+
email:
|
72
|
+
- jose.neto@taxweb.com.br
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- lib/myfinance.rb
|
84
|
+
- lib/myfinance/categoria.rb
|
85
|
+
- lib/myfinance/centro_receita_custo.rb
|
86
|
+
- lib/myfinance/conta_a_pagar.rb
|
87
|
+
- lib/myfinance/conta_a_receber.rb
|
88
|
+
- lib/myfinance/entidade.rb
|
89
|
+
- lib/myfinance/imposto.rb
|
90
|
+
- lib/myfinance/pessoa.rb
|
91
|
+
- lib/myfinance/version.rb
|
92
|
+
- myfinance-rails.gemspec
|
93
|
+
- spec/features/categoria_spec.rb
|
94
|
+
- spec/features/contas_a_receber_spec.rb
|
95
|
+
- spec/features/entidades_spec.rb
|
96
|
+
- spec/features/imposto_spec.rb
|
97
|
+
- spec/features/pessoas_spec.rb
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
homepage: ''
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata: {}
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.2.2
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: GEM para facilitar a uso da API do Myfinance em Aplicativos Rails
|
123
|
+
test_files:
|
124
|
+
- spec/features/categoria_spec.rb
|
125
|
+
- spec/features/contas_a_receber_spec.rb
|
126
|
+
- spec/features/entidades_spec.rb
|
127
|
+
- spec/features/imposto_spec.rb
|
128
|
+
- spec/features/pessoas_spec.rb
|
129
|
+
- spec/spec_helper.rb
|