moysklad 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/rspec.yml +29 -0
  3. data/lib/moysklad/client.rb +9 -4
  4. data/lib/moysklad/entities/assortment.rb +0 -2
  5. data/lib/moysklad/entities/attribute.rb +0 -3
  6. data/lib/moysklad/entities/attribute_metadata.rb +0 -2
  7. data/lib/moysklad/entities/attribute_value.rb +3 -4
  8. data/lib/moysklad/entities/characteristic.rb +0 -2
  9. data/lib/moysklad/entities/characteristic_metadata.rb +0 -2
  10. data/lib/moysklad/entities/collection.rb +0 -3
  11. data/lib/moysklad/entities/company_settings_metadata.rb +0 -2
  12. data/lib/moysklad/entities/consignment.rb +0 -3
  13. data/lib/moysklad/entities/context.rb +0 -2
  14. data/lib/moysklad/entities/counterparty.rb +4 -2
  15. data/lib/moysklad/entities/country.rb +2 -8
  16. data/lib/moysklad/entities/currency.rb +0 -2
  17. data/lib/moysklad/entities/custom_entity.rb +0 -3
  18. data/lib/moysklad/entities/customer_order.rb +0 -7
  19. data/lib/moysklad/entities/customer_order_position.rb +0 -4
  20. data/lib/moysklad/entities/employee.rb +0 -2
  21. data/lib/moysklad/entities/entity.rb +0 -3
  22. data/lib/moysklad/entities/group.rb +5 -2
  23. data/lib/moysklad/entities/image.rb +0 -1
  24. data/lib/moysklad/entities/meta.rb +0 -2
  25. data/lib/moysklad/entities/organization.rb +0 -2
  26. data/lib/moysklad/entities/price.rb +0 -1
  27. data/lib/moysklad/entities/price_type.rb +0 -2
  28. data/lib/moysklad/entities/product.rb +0 -7
  29. data/lib/moysklad/entities/productfolder.rb +0 -2
  30. data/lib/moysklad/entities/rate.rb +0 -3
  31. data/lib/moysklad/entities/resource_metadata.rb +0 -5
  32. data/lib/moysklad/entities/service.rb +5 -10
  33. data/lib/moysklad/entities/shortcut.rb +0 -2
  34. data/lib/moysklad/entities/store.rb +0 -1
  35. data/lib/moysklad/entities/uom.rb +0 -2
  36. data/lib/moysklad/entities/variant.rb +0 -4
  37. data/lib/moysklad/entities.rb +42 -35
  38. data/lib/moysklad/resources/assortments.rb +0 -1
  39. data/lib/moysklad/resources/base.rb +4 -3
  40. data/lib/moysklad/resources/custom_entities.rb +3 -1
  41. data/lib/moysklad/resources/custom_entity_metadata.rb +1 -1
  42. data/lib/moysklad/resources/embedded_entity_metadata.rb +2 -2
  43. data/lib/moysklad/resources/indexed.rb +1 -5
  44. data/lib/moysklad/resources/positions.rb +15 -0
  45. data/lib/moysklad/resources/stock.rb +1 -1
  46. data/lib/moysklad/resources/subresource.rb +0 -1
  47. data/lib/moysklad/resources.rb +22 -9
  48. data/lib/moysklad/universe.rb +1 -1
  49. data/lib/moysklad/version.rb +1 -1
  50. data/lib/moysklad.rb +11 -7
  51. data/moysklad.gemspec +2 -2
  52. data/spec/lib/moysklad/entities/customer_order_position_spec.rb +4 -17
  53. data/spec/lib/moysklad/entities/customer_order_spec.rb +7 -37
  54. data/spec/lib/moysklad/resources/base_spec.rb +0 -54
  55. data/spec/lib/moysklad/resources_spec.rb +0 -2
  56. data/spec/lib/moysklad/universe_spec.rb +0 -23
  57. data/spec/lib/moysklad_spec.rb +0 -1
  58. data/spec/support/resource.rb +1 -66
  59. metadata +10 -146
  60. data/.travis.yml +0 -5
  61. data/lib/moysklad/entities/attachment_document.rb +0 -16
  62. data/lib/moysklad/entities/barcode.rb +0 -19
  63. data/lib/moysklad/entities/common_object.rb +0 -27
  64. data/lib/moysklad/entities/company.rb +0 -20
  65. data/lib/moysklad/entities/company_concern.rb +0 -20
  66. data/lib/moysklad/entities/contact.rb +0 -15
  67. data/lib/moysklad/entities/custom_entity_metadata.rb +0 -11
  68. data/lib/moysklad/entities/embedded_entity_metadata.rb +0 -18
  69. data/lib/moysklad/entities/error.rb +0 -13
  70. data/lib/moysklad/entities/good_folder.rb +0 -10
  71. data/lib/moysklad/entities/good_ref.rb +0 -12
  72. data/lib/moysklad/entities/images.rb +0 -10
  73. data/lib/moysklad/entities/my_company.rb +0 -12
  74. data/lib/moysklad/entities/sale_price.rb +0 -18
  75. data/lib/moysklad/entities/sale_prices.rb +0 -10
  76. data/lib/moysklad/entities/slot.rb +0 -10
  77. data/lib/moysklad/entities/workflow.rb +0 -11
  78. data/lib/moysklad/entities/workflow_state.rb +0 -8
  79. data/spec/fixtures/302.raw +0 -15
  80. data/spec/fixtures/400.raw +0 -8
  81. data/spec/fixtures/401.html +0 -1
  82. data/spec/fixtures/401_2.html +0 -1
  83. data/spec/fixtures/405.raw +0 -9
  84. data/spec/fixtures/500.raw +0 -8
  85. data/spec/fixtures/502.raw +0 -8
  86. data/spec/fixtures/Consignment_list_0.raw +0 -14
  87. data/spec/fixtures/Consignment_list_1000.raw +0 -14
  88. data/spec/fixtures/Country_list.raw +0 -14
  89. data/spec/fixtures/CustomEntityMetadata_list.raw +0 -14
  90. data/spec/fixtures/CustomEntity_list.raw +0 -14
  91. data/spec/fixtures/CustomEntity_list_bad_chars.raw +0 -17
  92. data/spec/fixtures/EmbeddedEntityMetadata_list.raw +0 -15
  93. data/spec/fixtures/Feature_list.raw +0 -14
  94. data/spec/fixtures/Feature_list_1000.raw +0 -14
  95. data/spec/fixtures/Good_WithManyAttributes.raw +0 -13
  96. data/spec/fixtures/Good_e932ebe1-2e22-11e4-9406-002590a28eca.raw +0 -12
  97. data/spec/fixtures/Good_eb77ad57-2e22-11e4-4030-002590a28eca.raw +0 -12
  98. data/spec/fixtures/Goods_list.raw +0 -14
  99. data/spec/fixtures/Metadata_list.raw +0 -14
  100. data/spec/fixtures/PriceType_list.raw +0 -14
  101. data/spec/fixtures/Stock.raw +0 -11
  102. data/spec/fixtures/Stock_showConsignments.raw +0 -11
  103. data/spec/fixtures/Uom_list.raw +0 -14
  104. data/spec/fixtures/Warehouse_list.raw +0 -14
  105. data/spec/fixtures/Workflow_list.raw +0 -15
  106. data/spec/fixtures/attribute_boolean.xml +0 -6
  107. data/spec/fixtures/attribute_dictionary.xml +0 -5
  108. data/spec/fixtures/attribute_double.xml +0 -6
  109. data/spec/fixtures/attribute_file.xml +0 -12
  110. data/spec/fixtures/attribute_long.xml +0 -6
  111. data/spec/fixtures/attribute_text.xml +0 -5
  112. data/spec/fixtures/attribute_time.xml +0 -6
  113. data/spec/fixtures/attribute_url.xml +0 -6
  114. data/spec/fixtures/bad_chars.xml +0 -6
  115. data/spec/fixtures/customer_order.xml +0 -28
  116. data/spec/fixtures/good_with_attributes.raw +0 -12
  117. data/spec/fixtures/good_with_image.xml +0 -39
  118. data/spec/fixtures/resource_forbidden.raw +0 -9
  119. data/spec/fixtures/wrong_password.raw +0 -9
  120. data/spec/fixtures/wrong_type.raw +0 -70
  121. data/spec/fixtures/wrong_user.raw +0 -9
  122. data/spec/lib/moysklad/client/errors_spec.rb +0 -102
  123. data/spec/lib/moysklad/entities/attribute_metadata_spec.rb +0 -30
  124. data/spec/lib/moysklad/entities/attribute_spec.rb +0 -36
  125. data/spec/lib/moysklad/entities/country_spec.rb +0 -25
  126. data/spec/lib/moysklad/entities/custom_entity_metadata_spec.rb +0 -34
  127. data/spec/lib/moysklad/entities/custom_entity_spec.rb +0 -34
  128. data/spec/lib/moysklad/entities/good_spec.rb +0 -55
  129. data/spec/lib/moysklad/resources/countries_spec.rb +0 -22
  130. data/spec/lib/moysklad/resources/custom_entity_metadata_spec.rb +0 -13
  131. data/spec/lib/moysklad/resources/embedded_entity_metadata_indexed_spec.rb +0 -20
  132. data/spec/lib/moysklad/resources/embedded_entity_metadata_spec.rb +0 -11
  133. data/spec/lib/moysklad/resources/good_folders_spec.rb +0 -17
  134. data/spec/lib/moysklad/resources/indexed_spec.rb +0 -61
  135. data/spec/lib/moysklad/resources/stock_spec.rb +0 -63
  136. data/spec/lib/moysklad/resources/warehouses_spec.rb +0 -20
  137. data/spec/lib/moysklad/resources/workflows_spec.rb +0 -21
data/lib/moysklad.rb CHANGED
@@ -1,18 +1,22 @@
1
1
  require 'virtus'
2
+ require 'json'
2
3
  require 'active_support'
3
- require "moysklad/version"
4
+ require 'moysklad/version'
4
5
 
5
6
  require 'logger'
6
7
 
7
8
  module Moysklad
8
9
  mattr_accessor :custom_logger
9
- extend ActiveSupport::Autoload
10
10
 
11
- require_relative 'moysklad/entities'
12
- autoload :Error
13
- autoload :Resources
14
- autoload :Client
15
- autoload :Universe
11
+ %w{
12
+ entities
13
+ error
14
+ resources
15
+ client
16
+ universe
17
+ }.each do |m|
18
+ require_relative "moysklad/#{m}"
19
+ end
16
20
 
17
21
  def self.logger= value
18
22
  self.custom_logger = value
data/moysklad.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["danil@brandymint.ru"]
11
11
  spec.summary = %q{Клиент для работы с API moysklad.ru}
12
12
  spec.description = %q{Правильный клиент для работы c REST XML API moyslad.ru, созданный по принципам SOLID}
13
- spec.homepage = "https://github.com/brandymint/moysklad"
13
+ spec.homepage = "https://github.com/dapi/moysklad"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  # spec.add_runtime_dependency 'nokogiri-happymapper'
26
26
  spec.add_runtime_dependency 'activesupport', '>=3.0.0'
27
27
 
28
- spec.add_development_dependency "bundler", "~> 1.6"
28
+ spec.add_development_dependency "bundler"
29
29
  spec.add_development_dependency "rake"
30
30
  spec.add_development_dependency "rspec"
31
31
  spec.add_development_dependency "rspec-collection_matchers"
@@ -5,31 +5,18 @@ describe Moysklad::Entities::CustomerOrderPosition do
5
5
  subject {
6
6
  p= Moysklad::Entities::CustomerOrderPosition.new
7
7
  p.vat = 18
8
- p.basePrice = Moysklad::Entities::Price.new
9
- p.basePrice.sum = 123
8
+ p.price = Moysklad::Entities::Price.new
9
+ p.price.value = 123
10
10
  p.reserve = true
11
11
  p
12
12
  }
13
13
 
14
- it 'to_xml' do
15
- expect(subject.to_xml).to be_a String
14
+ it 'to_json' do
15
+ expect(subject.to_json).to be_a String
16
16
  end
17
17
 
18
18
  it 'to_s' do
19
19
  expect(subject.to_s).to be_a String
20
20
  end
21
-
22
- it 'include xml' do
23
- expect(subject.to_xml).to include '<?xml version="1.0" encoding="utf-8"?>'
24
- end
25
-
26
- it 'include customerOrderPosition' do
27
- expect(subject.to_xml).to include "<customerOrderPosition"
28
- end
29
-
30
- it 'include basePrice' do
31
- expect(subject.to_xml).to include "<basePrice"
32
- end
33
21
  end
34
-
35
22
  end
@@ -5,54 +5,24 @@ describe Moysklad::Entities::CustomerOrder do
5
5
  subject {
6
6
  p= Moysklad::Entities::CustomerOrderPosition.new
7
7
  p.vat = 18
8
- p.basePrice = Moysklad::Entities::Price.new
9
- p.basePrice.sum = 123
10
- p.reserve = true
8
+ p.price = Moysklad::Entities::Price.new
9
+ p.price.value = 123
10
+ p.reserve = 123
11
11
 
12
12
  co = Moysklad::Entities::CustomerOrder.new
13
13
  co.sum = Moysklad::Entities::Price.new
14
- co.sum.sum = 456
14
+ co.sum.value = 456
15
15
  co.description = 'Описание'
16
- co.customerOrderPosition = p
16
+ co.positions = [p]
17
17
  co
18
18
  }
19
19
 
20
- it 'state' do
21
- stub_rest 'Workflow', :list, 0
22
- allow(subject).to receive(:stateUuid).and_return 'f16b0ca9-ff79-11e4-90a2-8ecb0000fdf9'
23
- expect(subject.state universe).to be_a Moysklad::Entities::WorkflowState
24
- end
25
-
26
- it 'to_xml' do
27
- expect(subject.to_xml).to be_a String
20
+ it 'to_json' do
21
+ expect(subject.to_json).to be_a String
28
22
  end
29
23
 
30
24
  it 'to_s' do
31
25
  expect(subject.to_s).to be_a String
32
26
  end
33
-
34
- it 'include xml' do
35
- expect(subject.to_xml).to include '<?xml version="1.0" encoding="utf-8"?>'
36
- end
37
-
38
- it 'include customerOrder' do
39
- expect(subject.to_xml).to include "<customerOrder"
40
- end
41
-
42
- it 'include customerOrderPosition' do
43
- expect(subject.to_xml).to include "<customerOrderPosition"
44
- end
45
- end
46
-
47
- context 'parse' do
48
- subject { Moysklad::Entities::CustomerOrder.parse File.read './spec/fixtures/customer_order.xml' }
49
-
50
- it 'include customerOrder' do
51
- expect(subject.to_xml).to include "<customerOrder"
52
- end
53
-
54
- it 'include customerOrderPosition' do
55
- expect(subject.to_xml).to include "<customerOrderPosition"
56
- end
57
27
  end
58
28
  end
@@ -4,58 +4,4 @@ describe Moysklad::Resources::Base do
4
4
  it 'should be loaded' do
5
5
  expect(described_class).to be_a Class
6
6
  end
7
-
8
- describe 'правильно определяет название модели' do
9
- let!(:entity_class) { Moysklad::Entities::Computer = Class.new }
10
- subject { Moysklad::Resources::Computers = Class.new described_class }
11
-
12
- it do
13
- expect(subject.entity_class).to eq entity_class
14
- end
15
- end
16
-
17
- describe 'испрвляет на лету xml с плохими символами' do
18
- let(:xml) { File.read './spec/fixtures/bad_chars.xml' }
19
- let(:client) { Moysklad::Client.new }
20
- let(:res) { described_class.new client: client }
21
-
22
- before do
23
- allow(described_class).to receive(:entity_class).and_return Moysklad::Entities::CustomEntity
24
- end
25
-
26
- subject { res.send :parse_page, xml }
27
-
28
- it do
29
- expect{subject}.to_not raise_error
30
- end
31
-
32
- context 'ошибка есть если парсинг напрямую' do
33
- before do
34
- expect_any_instance_of(described_class).to receive(:parse_content).and_return xml
35
- end
36
- it do
37
- expect{subject}.to raise_error Nokogiri::XML::SyntaxError
38
- end
39
- end
40
-
41
- end
42
-
43
- describe 'page' do
44
- let(:resource) { Moysklad::Resources::Features.new client: client }
45
-
46
- before do
47
- stub_rest :Feature
48
- end
49
-
50
- subject { resource.page }
51
-
52
- it do
53
- expect(subject).to be_a Moysklad::Entities::Page
54
- expect(subject.total).to eq feature_list_items_count
55
- expect(subject.count).to eq Moysklad::Entities::Collection::DEFAULT_COUNT
56
- expect(subject.start).to eq 0
57
- expect(subject.items.count).to eq feature_list_items_count
58
- end
59
-
60
- end
61
7
  end
@@ -3,8 +3,6 @@ require 'spec_helper'
3
3
  describe Moysklad::Resources do
4
4
  it 'should be loaded' do
5
5
  expect(Moysklad::Resources).to be_a Module
6
-
7
- expect(Moysklad::Resources.resources).to include(Moysklad::Resources::Features)
8
6
  expect(Moysklad::Resources.resources).to include(Moysklad::Resources::EmbeddedEntityMetadata)
9
7
  end
10
8
  end
@@ -5,14 +5,6 @@ describe Moysklad::Universe do
5
5
 
6
6
  subject { described_class.new client: client }
7
7
 
8
- it 'should have a features resoruce' do
9
- expect(subject.features).to be_a Moysklad::Resources::Indexed
10
- end
11
-
12
- it do
13
- expect(subject.features.resource).to be_a Moysklad::Resources::Features
14
- end
15
-
16
8
  it do
17
9
  expect(subject.embedded_entity_metadata.resource).to be_a Moysklad::Resources::EmbeddedEntityMetadata
18
10
  end
@@ -21,10 +13,6 @@ describe Moysklad::Universe do
21
13
  expect(subject.resources_list).to have_at_least(10).items
22
14
  end
23
15
 
24
- it do
25
- expect(subject.resources_list).to include(:features)
26
- end
27
-
28
16
  describe '.build' do
29
17
  let(:login) { 'alala' }
30
18
  let(:password) { 'ulala' }
@@ -38,16 +26,5 @@ describe Moysklad::Universe do
38
26
  it do
39
27
  expect(subject.client).to be_a Moysklad::Client
40
28
  end
41
-
42
29
  end
43
-
44
- describe do
45
- before do
46
- stub_rest :CustomEntityMetadata, :list, 0, './spec/fixtures/resource_forbidden.raw'
47
- end
48
- it do
49
- expect{subject.custom_entity_metadata.all}.to raise_error Moysklad::Client::ResourceForbidden
50
- end
51
- end
52
-
53
30
  end
@@ -3,6 +3,5 @@ require 'spec_helper'
3
3
  describe Moysklad do
4
4
  it 'should be loaded' do
5
5
  expect(Moysklad::Entities::Base).to be_a Class
6
- expect(Moysklad::Entities::Company).to be_a Class
7
6
  end
8
7
  end
@@ -1,70 +1,5 @@
1
1
  module RspecResourceSupport
2
-
3
- def raw_consignment_0_list
4
- File.new './spec/fixtures/Consignment_list_0.raw'
5
- end
6
-
7
- def raw_consignment_1000_list
8
- File.new './spec/fixtures/Consignment_list_1000.raw'
9
- end
10
-
11
- def total_consignment_count
12
- 1280
13
- end
14
-
15
- def feature_list_items_count
16
- 863
17
- end
18
-
19
- def raw_feature_list
20
- File.new './spec/fixtures/Feature_list.raw'
21
- end
22
-
23
- def feature_list_items_count
24
- 863
25
- end
26
-
27
- def stub_rest type, action=:list, start=nil, file=nil
28
- url = "https://online.moysklad.ru/exchange/rest/ms/xml/#{type}/#{action}"
29
- url << "?start=#{start}" if start
30
- stub_request(:get, url).to_return File.new( file || "./spec/fixtures/#{type}_#{action}.raw" )
31
- end
32
-
33
- def stub_stock_rest_with_consignments
34
- url = 'https://online.moysklad.ru/exchange/rest/stock/xml?showConsignments=true'
35
- stub_request(:get, url).to_return File.new "./spec/fixtures/Stock_showConsignments.raw"
36
- end
37
-
38
- def stub_stock_rest
39
- url = 'https://online.moysklad.ru/exchange/rest/stock/xml'
40
- stub_request(:get, url).to_return File.new "./spec/fixtures/Stock.raw"
41
- end
42
-
43
- def client
44
- @client ||= Moysklad::Client.new
45
- end
46
-
47
- def universe
48
- @universe ||= Moysklad::Universe.new client: client
49
- end
50
-
51
- def resource_list_url res=nil, start=nil
52
- res ||= resource
53
- url = Moysklad::Client::URL + '/' + res.send(:list_path)
54
- url+="?start=#{start}" if start
55
-
56
- return url
57
- end
58
-
59
- def consignments_resource
60
- @consignments_resource ||= Moysklad::Resources::Consignments.new client: client
61
- end
62
-
63
- def stub_consignments_requests
64
- stub_request(:get, resource_list_url(consignments_resource, 0)).to_return(raw_consignment_0_list)
65
- stub_request(:get, resource_list_url(consignments_resource, 1000)).to_return(raw_consignment_1000_list)
66
- end
67
-
2
+ # TODO json stub
68
3
  end
69
4
 
70
5
  RSpec.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moysklad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danil Pismenny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-13 00:00:00.000000000 Z
11
+ date: 2023-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '1.6'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '1.6'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -228,9 +228,9 @@ executables: []
228
228
  extensions: []
229
229
  extra_rdoc_files: []
230
230
  files:
231
+ - ".github/workflows/rspec.yml"
231
232
  - ".gitignore"
232
233
  - ".rspec"
233
- - ".travis.yml"
234
234
  - CHANGELOG.md
235
235
  - Gemfile
236
236
  - Guardfile
@@ -242,43 +242,30 @@ files:
242
242
  - lib/moysklad/client/errors.rb
243
243
  - lib/moysklad/entities.rb
244
244
  - lib/moysklad/entities/assortment.rb
245
- - lib/moysklad/entities/attachment_document.rb
246
245
  - lib/moysklad/entities/attribute.rb
247
246
  - lib/moysklad/entities/attribute_metadata.rb
248
247
  - lib/moysklad/entities/attribute_value.rb
249
- - lib/moysklad/entities/barcode.rb
250
248
  - lib/moysklad/entities/base.rb
251
249
  - lib/moysklad/entities/bundle.rb
252
250
  - lib/moysklad/entities/characteristic.rb
253
251
  - lib/moysklad/entities/characteristic_metadata.rb
254
252
  - lib/moysklad/entities/collection.rb
255
253
  - lib/moysklad/entities/collection_meta.rb
256
- - lib/moysklad/entities/common_object.rb
257
- - lib/moysklad/entities/company.rb
258
- - lib/moysklad/entities/company_concern.rb
259
254
  - lib/moysklad/entities/company_settings_metadata.rb
260
255
  - lib/moysklad/entities/consignment.rb
261
- - lib/moysklad/entities/contact.rb
262
256
  - lib/moysklad/entities/context.rb
263
257
  - lib/moysklad/entities/contract.rb
264
258
  - lib/moysklad/entities/counterparty.rb
265
259
  - lib/moysklad/entities/country.rb
266
260
  - lib/moysklad/entities/currency.rb
267
261
  - lib/moysklad/entities/custom_entity.rb
268
- - lib/moysklad/entities/custom_entity_metadata.rb
269
262
  - lib/moysklad/entities/customer_order.rb
270
263
  - lib/moysklad/entities/customer_order_position.rb
271
- - lib/moysklad/entities/embedded_entity_metadata.rb
272
264
  - lib/moysklad/entities/employee.rb
273
265
  - lib/moysklad/entities/entity.rb
274
- - lib/moysklad/entities/error.rb
275
- - lib/moysklad/entities/good_folder.rb
276
- - lib/moysklad/entities/good_ref.rb
277
266
  - lib/moysklad/entities/group.rb
278
267
  - lib/moysklad/entities/image.rb
279
- - lib/moysklad/entities/images.rb
280
268
  - lib/moysklad/entities/meta.rb
281
- - lib/moysklad/entities/my_company.rb
282
269
  - lib/moysklad/entities/organization.rb
283
270
  - lib/moysklad/entities/owner.rb
284
271
  - lib/moysklad/entities/page.rb
@@ -288,17 +275,12 @@ files:
288
275
  - lib/moysklad/entities/productfolder.rb
289
276
  - lib/moysklad/entities/rate.rb
290
277
  - lib/moysklad/entities/resource_metadata.rb
291
- - lib/moysklad/entities/sale_price.rb
292
- - lib/moysklad/entities/sale_prices.rb
293
278
  - lib/moysklad/entities/service.rb
294
279
  - lib/moysklad/entities/shortcut.rb
295
- - lib/moysklad/entities/slot.rb
296
280
  - lib/moysklad/entities/store.rb
297
281
  - lib/moysklad/entities/time.rb
298
282
  - lib/moysklad/entities/uom.rb
299
283
  - lib/moysklad/entities/variant.rb
300
- - lib/moysklad/entities/workflow.rb
301
- - lib/moysklad/entities/workflow_state.rb
302
284
  - lib/moysklad/error.rb
303
285
  - lib/moysklad/errors.rb
304
286
  - lib/moysklad/resources.rb
@@ -311,6 +293,7 @@ files:
311
293
  - lib/moysklad/resources/indexed.rb
312
294
  - lib/moysklad/resources/indexed_cache.rb
313
295
  - lib/moysklad/resources/load_all.rb
296
+ - lib/moysklad/resources/positions.rb
314
297
  - lib/moysklad/resources/products.rb
315
298
  - lib/moysklad/resources/stock.rb
316
299
  - lib/moysklad/resources/subresource.rb
@@ -319,76 +302,17 @@ files:
319
302
  - lib/moysklad/version.rb
320
303
  - moysklad.gemspec
321
304
  - scripts/rest.sh
322
- - spec/fixtures/302.raw
323
- - spec/fixtures/400.raw
324
- - spec/fixtures/401.html
325
- - spec/fixtures/401_2.html
326
- - spec/fixtures/405.raw
327
- - spec/fixtures/500.raw
328
- - spec/fixtures/502.raw
329
- - spec/fixtures/Consignment_list_0.raw
330
- - spec/fixtures/Consignment_list_1000.raw
331
- - spec/fixtures/Country_list.raw
332
- - spec/fixtures/CustomEntityMetadata_list.raw
333
- - spec/fixtures/CustomEntity_list.raw
334
- - spec/fixtures/CustomEntity_list_bad_chars.raw
335
- - spec/fixtures/EmbeddedEntityMetadata_list.raw
336
- - spec/fixtures/Feature_list.raw
337
- - spec/fixtures/Feature_list_1000.raw
338
- - spec/fixtures/Good_WithManyAttributes.raw
339
- - spec/fixtures/Good_e932ebe1-2e22-11e4-9406-002590a28eca.raw
340
- - spec/fixtures/Good_eb77ad57-2e22-11e4-4030-002590a28eca.raw
341
- - spec/fixtures/Goods_list.raw
342
- - spec/fixtures/Metadata_list.raw
343
- - spec/fixtures/PriceType_list.raw
344
- - spec/fixtures/Stock.raw
345
- - spec/fixtures/Stock_showConsignments.raw
346
- - spec/fixtures/Uom_list.raw
347
- - spec/fixtures/Warehouse_list.raw
348
- - spec/fixtures/Workflow_list.raw
349
- - spec/fixtures/attribute_boolean.xml
350
- - spec/fixtures/attribute_dictionary.xml
351
- - spec/fixtures/attribute_double.xml
352
- - spec/fixtures/attribute_file.xml
353
- - spec/fixtures/attribute_long.xml
354
- - spec/fixtures/attribute_text.xml
355
- - spec/fixtures/attribute_time.xml
356
- - spec/fixtures/attribute_url.xml
357
- - spec/fixtures/bad_chars.xml
358
- - spec/fixtures/customer_order.xml
359
- - spec/fixtures/good_with_attributes.raw
360
- - spec/fixtures/good_with_image.xml
361
- - spec/fixtures/resource_forbidden.raw
362
- - spec/fixtures/wrong_password.raw
363
- - spec/fixtures/wrong_type.raw
364
- - spec/fixtures/wrong_user.raw
365
- - spec/lib/moysklad/client/errors_spec.rb
366
- - spec/lib/moysklad/entities/attribute_metadata_spec.rb
367
- - spec/lib/moysklad/entities/attribute_spec.rb
368
- - spec/lib/moysklad/entities/country_spec.rb
369
- - spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
370
- - spec/lib/moysklad/entities/custom_entity_spec.rb
371
305
  - spec/lib/moysklad/entities/customer_order_position_spec.rb
372
306
  - spec/lib/moysklad/entities/customer_order_spec.rb
373
- - spec/lib/moysklad/entities/good_spec.rb
374
307
  - spec/lib/moysklad/resources/base_spec.rb
375
- - spec/lib/moysklad/resources/countries_spec.rb
376
- - spec/lib/moysklad/resources/custom_entity_metadata_spec.rb
377
- - spec/lib/moysklad/resources/embedded_entity_metadata_indexed_spec.rb
378
- - spec/lib/moysklad/resources/embedded_entity_metadata_spec.rb
379
- - spec/lib/moysklad/resources/good_folders_spec.rb
380
- - spec/lib/moysklad/resources/indexed_spec.rb
381
- - spec/lib/moysklad/resources/stock_spec.rb
382
308
  - spec/lib/moysklad/resources/subresource_spec.rb
383
- - spec/lib/moysklad/resources/warehouses_spec.rb
384
- - spec/lib/moysklad/resources/workflows_spec.rb
385
309
  - spec/lib/moysklad/resources_spec.rb
386
310
  - spec/lib/moysklad/universe_spec.rb
387
311
  - spec/lib/moysklad_spec.rb
388
312
  - spec/spec_helper.rb
389
313
  - spec/support/resource.rb
390
314
  - test.rb
391
- homepage: https://github.com/brandymint/moysklad
315
+ homepage: https://github.com/dapi/moysklad
392
316
  licenses:
393
317
  - MIT
394
318
  metadata: {}
@@ -407,75 +331,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
331
  - !ruby/object:Gem::Version
408
332
  version: '0'
409
333
  requirements: []
410
- rubyforge_project:
411
- rubygems_version: 2.5.2
334
+ rubygems_version: 3.4.7
412
335
  signing_key:
413
336
  specification_version: 4
414
337
  summary: Клиент для работы с API moysklad.ru
415
338
  test_files:
416
- - spec/fixtures/302.raw
417
- - spec/fixtures/400.raw
418
- - spec/fixtures/401.html
419
- - spec/fixtures/401_2.html
420
- - spec/fixtures/405.raw
421
- - spec/fixtures/500.raw
422
- - spec/fixtures/502.raw
423
- - spec/fixtures/Consignment_list_0.raw
424
- - spec/fixtures/Consignment_list_1000.raw
425
- - spec/fixtures/Country_list.raw
426
- - spec/fixtures/CustomEntityMetadata_list.raw
427
- - spec/fixtures/CustomEntity_list.raw
428
- - spec/fixtures/CustomEntity_list_bad_chars.raw
429
- - spec/fixtures/EmbeddedEntityMetadata_list.raw
430
- - spec/fixtures/Feature_list.raw
431
- - spec/fixtures/Feature_list_1000.raw
432
- - spec/fixtures/Good_WithManyAttributes.raw
433
- - spec/fixtures/Good_e932ebe1-2e22-11e4-9406-002590a28eca.raw
434
- - spec/fixtures/Good_eb77ad57-2e22-11e4-4030-002590a28eca.raw
435
- - spec/fixtures/Goods_list.raw
436
- - spec/fixtures/Metadata_list.raw
437
- - spec/fixtures/PriceType_list.raw
438
- - spec/fixtures/Stock.raw
439
- - spec/fixtures/Stock_showConsignments.raw
440
- - spec/fixtures/Uom_list.raw
441
- - spec/fixtures/Warehouse_list.raw
442
- - spec/fixtures/Workflow_list.raw
443
- - spec/fixtures/attribute_boolean.xml
444
- - spec/fixtures/attribute_dictionary.xml
445
- - spec/fixtures/attribute_double.xml
446
- - spec/fixtures/attribute_file.xml
447
- - spec/fixtures/attribute_long.xml
448
- - spec/fixtures/attribute_text.xml
449
- - spec/fixtures/attribute_time.xml
450
- - spec/fixtures/attribute_url.xml
451
- - spec/fixtures/bad_chars.xml
452
- - spec/fixtures/customer_order.xml
453
- - spec/fixtures/good_with_attributes.raw
454
- - spec/fixtures/good_with_image.xml
455
- - spec/fixtures/resource_forbidden.raw
456
- - spec/fixtures/wrong_password.raw
457
- - spec/fixtures/wrong_type.raw
458
- - spec/fixtures/wrong_user.raw
459
- - spec/lib/moysklad/client/errors_spec.rb
460
- - spec/lib/moysklad/entities/attribute_metadata_spec.rb
461
- - spec/lib/moysklad/entities/attribute_spec.rb
462
- - spec/lib/moysklad/entities/country_spec.rb
463
- - spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
464
- - spec/lib/moysklad/entities/custom_entity_spec.rb
465
339
  - spec/lib/moysklad/entities/customer_order_position_spec.rb
466
340
  - spec/lib/moysklad/entities/customer_order_spec.rb
467
- - spec/lib/moysklad/entities/good_spec.rb
468
341
  - spec/lib/moysklad/resources/base_spec.rb
469
- - spec/lib/moysklad/resources/countries_spec.rb
470
- - spec/lib/moysklad/resources/custom_entity_metadata_spec.rb
471
- - spec/lib/moysklad/resources/embedded_entity_metadata_indexed_spec.rb
472
- - spec/lib/moysklad/resources/embedded_entity_metadata_spec.rb
473
- - spec/lib/moysklad/resources/good_folders_spec.rb
474
- - spec/lib/moysklad/resources/indexed_spec.rb
475
- - spec/lib/moysklad/resources/stock_spec.rb
476
342
  - spec/lib/moysklad/resources/subresource_spec.rb
477
- - spec/lib/moysklad/resources/warehouses_spec.rb
478
- - spec/lib/moysklad/resources/workflows_spec.rb
479
343
  - spec/lib/moysklad/resources_spec.rb
480
344
  - spec/lib/moysklad/universe_spec.rb
481
345
  - spec/lib/moysklad_spec.rb
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 2.1.0
5
- - 2.2.0
@@ -1,16 +0,0 @@
1
- module Moysklad::Entities
2
- class AttachmentDocument < Base
3
- include Moysklad::Entities::Common
4
-
5
- tag 'file'
6
-
7
- attribute :filename, String
8
- attribute :miniatureUuid, String
9
- attribute :name, String
10
-
11
- #def self.parse node, options
12
- ## TODO create AttachmentDocument
13
- #''
14
- #end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- module Moysklad::Entities
2
- class Barcode < Base
3
- include HappyMapper
4
- include Moysklad::Entities::XmlFix
5
-
6
- tag 'barcode'
7
-
8
- attribute :barcode, String
9
- attribute :barcodeType, String
10
-
11
- attribute :accountUuid, String
12
- attribute :accountId, String
13
- attribute :uuid, String
14
- attribute :groupUuid, String
15
- attribute :ownerUuid, String
16
-
17
- attribute :shared, Boolean
18
- end
19
- end
@@ -1,27 +0,0 @@
1
- module Moysklad::Entities::CommonObject
2
- extend ActiveSupport::Concern
3
-
4
- # Используется в Good
5
- # https://online.moysklad.ru/exchange/rest/ms/xml/Good/list
6
- #
7
- # В Metadata
8
- # https://online.moysklad.ru/exchange/rest/ms/xml/Metadata/list
9
- #
10
- # Во Feature
11
- # https://online.moysklad.ru/exchange/rest/ms/xml/Feature/list
12
- #
13
- # CustomerOrder
14
- # https://online.moysklad.ru/exchange/rest/ms/xml/CustomerOrder/list
15
- #
16
- included do
17
- include Moysklad::Entities::Common
18
-
19
- attribute :updated, Time
20
- attribute :updatedBy, String
21
-
22
- attribute :name, String
23
-
24
- element :externalcode, String
25
- element :description, String
26
- end
27
- end