tp_client 0.2.3 → 0.2.4

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: 1d299ffb9c92c622e0e0a530a0d2f541b422ab4e12983014a69b3e6602a0b60f
4
- data.tar.gz: c6c0bd4bae393698a2153b2302706ae179f016d07d5339918cb131263ca51fe9
3
+ metadata.gz: 8b2f4a9b278c3d0435ba587384e32a51cf16fbd22152c20237770f880686540b
4
+ data.tar.gz: 5e80eff590a3d995e059f19343cedfb7ff86fa2164d8b32122f86cdc4e2b1dd5
5
5
  SHA512:
6
- metadata.gz: 902c91b99fc1ae7742a0b0060ea29eafb50b891c651377d727e293f4b37455118050539173b201754dcde4ce257851d6afc56afbc1fd57aac4402368d76e62b7
7
- data.tar.gz: 9ec131e57e4cd270c7bcfc0ebefd71a7d47f2b33166d066910978ce92cc14929939347f6c4431e27c5592f64f0c4b2632c46a0a1eeff56d8a22ab958cbccf0a0
6
+ metadata.gz: 1c8b8ca1690c74b86f134e408b0c9a293211ee2c53a7739279e44e9a1373e074cff31393ea5bcc77cfc80832b62e187e0a5d4b831a6bd6fc300564b34d4a5675
7
+ data.tar.gz: 3fbfd5cda721137b30b81767b19ccfd1599f1d8b71992afbcb0342fae98cd1b59743d66afb17c088d875e76354dc7a8137b1596d45aa52208377fe2f747014f8
data/.gitignore CHANGED
@@ -3,7 +3,9 @@
3
3
  /.config
4
4
  /coverage/
5
5
  /gems/
6
+ /gemfiles/*.lock
6
7
  /gemfiles/gems/
8
+ /gemfiles/vendor/bundle
7
9
  /InstalledFiles
8
10
  /pkg/
9
11
  /spec/reports/
@@ -1,17 +1,41 @@
1
+ dist: bionic
1
2
  sudo: false
2
3
  language: ruby
3
- rvm:
4
- - 2.5.3
5
- gemfile:
6
- - gemfiles/activesupport_4.gemfile
7
- - gemfiles/activesupport_5.gemfile
8
- - gemfiles/activesupport_6.gemfile
9
- deploy:
10
- provider: rubygems
11
- api_key:
12
- secure: vyxUUOg1A7K1iqfjXa/P9URnbh+ntKvgfAYDAxr4My9isOsnlYXtRdDl2RgLttmmtOv5unPDrTv8Mkh5B1WMA6ihKaBUXCaU4cgyh6vLds2fSy1yxUSR/TmfnoXmRVAtBHYiuKuHol5koIW+gSDNHYenzO2mvrOks06Jtkmp0X2OJgVCS1PqWjTrDvlpfRKf2bUnE2/5/XvwnUqKCLRls1CSpV+phW6m9qsAkqMv0TMa8Em3pOUjY8mCAgFArr3cl5MtyX3Nhh95CzcGHeMUfLu8Lz0NcHscG8xNq58NnFFU6m8nQJYyxZOjFtUrJumyvy5qwZZtprwc8XxE6BmY1IJWfKCnDJbEl/qxaX0psfVG2Eiu6e/Y/Lad1NUV9hYZCXkEVEsksZa7n3sd2XOzbJmqPgM0z53Ly3koj1uMZrJ5BJ4AfZIE4gbFm5+UmSez/K9xnCWUc5NXR9+v1kyJYLsjHevn0DMxb+7xvSR5zxyS9du+GUIbIGRIKBERYGS08u+/zaPTLmGSyMpK+x5ichJoSLaJsECGGUbY2kL9aO18w41oZbvQf+Cp/656oRZM8U4DV2HtRCp6Dqc3Y8MJG1Pzft6+mHYPepon21fi08B6GOAFMF/Rcuz/SpnP9dvSCJyEcgNahDDNvRQmOwT00M8tSDeQeuR3uTXfMScBkAA=
13
- gem: tp_client
14
- on:
15
- tags: true
16
- branch: master
17
- repo: TINYhr/tiny_client
4
+ cache: bundler
5
+ script: bundle exec rake
6
+ jobs:
7
+ fast_finish: true
8
+ include:
9
+ - stage: Test
10
+ rvm: 2.4.9
11
+ gemfile: gemfiles/activesupport_4.2.gemfile
12
+ - rvm: 2.4.9
13
+ gemfile: gemfiles/activesupport_5.1.gemfile
14
+ - rvm: 2.5.7
15
+ gemfile: gemfiles/activesupport_5.1.gemfile
16
+ - rvm: 2.5.7
17
+ gemfile: gemfiles/activesupport_5.2.gemfile
18
+ - rvm: 2.5.7
19
+ gemfile: gemfiles/activesupport_6.gemfile
20
+ - rvm: 2.6.5
21
+ gemfile: gemfiles/activesupport_5.2.gemfile
22
+ - rvm: 2.6.5
23
+ gemfile: gemfiles/activesupport_6.gemfile
24
+ - rvm: 2.7.0
25
+ gemfile: gemfiles/activesupport_5.2.gemfile
26
+ - rvm: 2.7.0
27
+ gemfile: gemfiles/activesupport_6.gemfile
28
+ - if: tag IS present
29
+ stage: Release Gem
30
+ rvm: 2.5.7
31
+ gemfile: gemfiles/activesupport_5.1.gemfile
32
+ script: skip
33
+ deploy:
34
+ provider: rubygems
35
+ gem: tp_client
36
+ api_key:
37
+ secure: vyxUUOg1A7K1iqfjXa/P9URnbh+ntKvgfAYDAxr4My9isOsnlYXtRdDl2RgLttmmtOv5unPDrTv8Mkh5B1WMA6ihKaBUXCaU4cgyh6vLds2fSy1yxUSR/TmfnoXmRVAtBHYiuKuHol5koIW+gSDNHYenzO2mvrOks06Jtkmp0X2OJgVCS1PqWjTrDvlpfRKf2bUnE2/5/XvwnUqKCLRls1CSpV+phW6m9qsAkqMv0TMa8Em3pOUjY8mCAgFArr3cl5MtyX3Nhh95CzcGHeMUfLu8Lz0NcHscG8xNq58NnFFU6m8nQJYyxZOjFtUrJumyvy5qwZZtprwc8XxE6BmY1IJWfKCnDJbEl/qxaX0psfVG2Eiu6e/Y/Lad1NUV9hYZCXkEVEsksZa7n3sd2XOzbJmqPgM0z53Ly3koj1uMZrJ5BJ4AfZIE4gbFm5+UmSez/K9xnCWUc5NXR9+v1kyJYLsjHevn0DMxb+7xvSR5zxyS9du+GUIbIGRIKBERYGS08u+/zaPTLmGSyMpK+x5ichJoSLaJsECGGUbY2kL9aO18w41oZbvQf+Cp/656oRZM8U4DV2HtRCp6Dqc3Y8MJG1Pzft6+mHYPepon21fi08B6GOAFMF/Rcuz/SpnP9dvSCJyEcgNahDDNvRQmOwT00M8tSDeQeuR3uTXfMScBkAA=
38
+ on:
39
+ tags: true
40
+ branch: master
41
+ repo: TINYhr/tiny_client
data/Appraisals CHANGED
@@ -1,9 +1,13 @@
1
- appraise 'activesupport-4' do
2
- gem 'activesupport', '~> 4.0'
1
+ appraise 'activesupport-4.2' do
2
+ gem 'activesupport', '~> 4.2'
3
3
  end
4
4
 
5
- appraise 'activesupport-5' do
6
- gem 'activesupport', '~> 5.0'
5
+ appraise 'activesupport-5.1' do
6
+ gem 'activesupport', '~> 5.1'
7
+ end
8
+
9
+ appraise 'activesupport-5.2' do
10
+ gem 'activesupport', '~> 5.2'
7
11
  end
8
12
 
9
13
  appraise 'activesupport-6' do
data/Rakefile CHANGED
@@ -3,6 +3,7 @@ require 'rake/testtask'
3
3
  require 'yard'
4
4
 
5
5
  task default: [:test]
6
+ task gem: [:test, :build]
6
7
 
7
8
  Rake::TestTask.new do |t|
8
9
  t.libs << 'test'
@@ -13,14 +14,3 @@ YARD::Rake::YardocTask.new do |t|
13
14
  t.files = ['lib/**/*.rb']
14
15
  t.options = ['-o docs']
15
16
  end
16
-
17
- desc 'Build the gem'
18
- task gem: [:test] do
19
- sh 'gem build tp_client.gemspec'
20
- end
21
-
22
- desc 'Clean up'
23
- task :clean do
24
- sh 'rm -rf docs'
25
- sh 'rm -f tp_client*.gem'
26
- end
@@ -0,0 +1,16 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 4.2"
6
+
7
+ group :test, :development do
8
+ gem "byebug"
9
+ gem "minitest"
10
+ gem "mocha"
11
+ gem "rake"
12
+ gem "webmock"
13
+ gem "yard"
14
+ end
15
+
16
+ gemspec path: "../"
@@ -0,0 +1,16 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 5.1"
6
+
7
+ group :test, :development do
8
+ gem "byebug"
9
+ gem "minitest"
10
+ gem "mocha"
11
+ gem "rake"
12
+ gem "webmock"
13
+ gem "yard"
14
+ end
15
+
16
+ gemspec path: "../"
@@ -0,0 +1,16 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 5.2"
6
+
7
+ group :test, :development do
8
+ gem "byebug"
9
+ gem "minitest"
10
+ gem "mocha"
11
+ gem "rake"
12
+ gem "webmock"
13
+ gem "yard"
14
+ end
15
+
16
+ gemspec path: "../"
@@ -1,16 +1,16 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
- gem 'activesupport', '~> 6.0'
5
+ gem "activesupport", "~> 6.0"
6
6
 
7
7
  group :test, :development do
8
- gem 'byebug'
9
- gem 'minitest'
10
- gem 'mocha'
11
- gem 'rake'
12
- gem 'webmock'
13
- gem 'yard'
8
+ gem "byebug"
9
+ gem "minitest"
10
+ gem "mocha"
11
+ gem "rake"
12
+ gem "webmock"
13
+ gem "yard"
14
14
  end
15
15
 
16
- gemspec path: '../'
16
+ gemspec path: "../"
@@ -22,14 +22,14 @@ module TinyClient
22
22
  def nested_show(resource_class, id, params = {})
23
23
  raise ArgumentError, 'Works only for TinyClient::Resource' unless resource_class <= Resource
24
24
  path = UrlBuilder.url(resource_class.path).path(id).build!
25
- self.class.get(params, @id, path, resource_class)
25
+ self.class.get(params, id, path, resource_class)
26
26
  end
27
27
 
28
28
  # @raise [ArgumentError] if the given resource_class is not a Resource
29
29
  # @raise [ResponseError] if the server respond with an error status (i.e 404, 500..)
30
30
  def nested_index(resource_class, params = {})
31
31
  raise ArgumentError, 'Works only for TinyClient::Resource' unless resource_class <= Resource
32
- self.class.get(params, @id, resource_class.path, resource_class)
32
+ self.class.get(params, id, resource_class.path, resource_class)
33
33
  end
34
34
 
35
35
  # @raise [ArgumentError] if the given resource does not have an id or is not Resource instance
@@ -39,7 +39,7 @@ module TinyClient
39
39
  raise ArgumentError, 'resource must have id set' if resource.id.nil?
40
40
  path = UrlBuilder.url(resource.class.path).path(resource.id).build!
41
41
  data = resource.changes.to_a.each_with_object({}) { |fld, h| h[fld] = resource.send(fld) }
42
- self.class.put({ resource.class.low_name => data }, @id, path, resource.class)
42
+ self.class.put({ resource.class.low_name => data }, id, path, resource.class)
43
43
  end
44
44
 
45
45
  # @raise [ArgumentError] if the given resource does not have an id or is not a Resource instance
@@ -12,9 +12,6 @@ module TinyClient
12
12
  include PaginationSupport
13
13
  include NestedSupport
14
14
 
15
- # A resource always have an id
16
- attr_accessor :id
17
-
18
15
  class << self
19
16
  # Set this resource client configuration
20
17
  # @param [Configuration] config the api url and client default headers.
@@ -157,10 +154,14 @@ module TinyClient
157
154
  end
158
155
  end
159
156
 
157
+ # A resource always have an id
158
+ attr_accessor :id
159
+
160
160
  # the fields that has beem modified, and will be save on {save!}
161
161
  attr_reader :changes
162
162
 
163
163
  def initialize(*_args)
164
+ @id = nil
164
165
  @changes = Set.new # store the fields change here
165
166
  end
166
167
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'tp_client'
4
- s.version = '0.2.3'
4
+ s.version = '0.2.4'
5
5
  s.authors = ['TINYpulse Devops']
6
6
  s.email = 'devops@tinypulse.com'
7
7
 
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
24
  end
25
25
  s.require_paths = %w[lib ext]
26
- s.rubyforge_project = 'tiny_client'
27
26
  s.test_files = ['test/tiny_client/']
28
27
 
29
28
  #### Documentation
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TINYpulse Devops
@@ -54,22 +54,22 @@ dependencies:
54
54
  name: appraisal
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '2.2'
60
57
  - - ">="
61
58
  - !ruby/object:Gem::Version
62
59
  version: 2.2.0
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '2.2'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '2.2'
70
67
  - - ">="
71
68
  - !ruby/object:Gem::Version
72
69
  version: 2.2.0
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '2.2'
73
73
  description: TINYclient is an HTTP/JSON crud toolkit inspired by ActiveRecord and
74
74
  based on Curb.
75
75
  email: devops@tinypulse.com
@@ -88,12 +88,10 @@ files:
88
88
  - README.md
89
89
  - Rakefile
90
90
  - gemfiles/.bundle/config
91
- - gemfiles/activesupport_4.gemfile
92
- - gemfiles/activesupport_4.gemfile.lock
93
- - gemfiles/activesupport_5.gemfile
94
- - gemfiles/activesupport_5.gemfile.lock
91
+ - gemfiles/activesupport_4.2.gemfile
92
+ - gemfiles/activesupport_5.1.gemfile
93
+ - gemfiles/activesupport_5.2.gemfile
95
94
  - gemfiles/activesupport_6.gemfile
96
- - gemfiles/activesupport_6.gemfile.lock
97
95
  - lib/tiny_client.rb
98
96
  - lib/tiny_client/base_error.rb
99
97
  - lib/tiny_client/configuration.rb
@@ -132,8 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
130
  - !ruby/object:Gem::Version
133
131
  version: '0'
134
132
  requirements: []
135
- rubyforge_project: tiny_client
136
- rubygems_version: 2.7.7
133
+ rubygems_version: 3.0.6
137
134
  signing_key:
138
135
  specification_version: 4
139
136
  summary: TINYclient, an HTTP/JSON crud client toolkit.
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source 'https://rubygems.org'
4
-
5
- gem 'activesupport', '~> 4.0'
6
-
7
- group :test, :development do
8
- gem 'byebug'
9
- gem 'minitest'
10
- gem 'mocha'
11
- gem 'rake'
12
- gem 'webmock'
13
- gem 'yard'
14
- end
15
-
16
- gemspec path: '../'
@@ -1,62 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- tp_client (0.2.3)
5
- activesupport (>= 4.0, < 7.0)
6
- curb (> 0.7.0, < 1.0.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activesupport (4.2.11.1)
12
- i18n (~> 0.7)
13
- minitest (~> 5.1)
14
- thread_safe (~> 0.3, >= 0.3.4)
15
- tzinfo (~> 1.1)
16
- addressable (2.6.0)
17
- public_suffix (>= 2.0.2, < 4.0)
18
- appraisal (2.2.0)
19
- bundler
20
- rake
21
- thor (>= 0.14.0)
22
- byebug (11.0.1)
23
- concurrent-ruby (1.1.5)
24
- crack (0.4.3)
25
- safe_yaml (~> 1.0.0)
26
- curb (0.9.10)
27
- hashdiff (1.0.0)
28
- i18n (0.9.5)
29
- concurrent-ruby (~> 1.0)
30
- metaclass (0.0.4)
31
- minitest (5.11.3)
32
- mocha (1.9.0)
33
- metaclass (~> 0.0.1)
34
- public_suffix (3.1.1)
35
- rake (12.3.3)
36
- safe_yaml (1.0.5)
37
- thor (0.20.3)
38
- thread_safe (0.3.6)
39
- tzinfo (1.2.5)
40
- thread_safe (~> 0.1)
41
- webmock (3.7.0)
42
- addressable (>= 2.3.6)
43
- crack (>= 0.3.2)
44
- hashdiff (>= 0.4.0, < 2.0.0)
45
- yard (0.9.20)
46
-
47
- PLATFORMS
48
- ruby
49
-
50
- DEPENDENCIES
51
- activesupport (~> 4.0)
52
- appraisal (~> 2.2, >= 2.2.0)
53
- byebug
54
- minitest
55
- mocha
56
- rake
57
- tp_client!
58
- webmock
59
- yard
60
-
61
- BUNDLED WITH
62
- 1.17.3
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source 'https://rubygems.org'
4
-
5
- gem 'activesupport', '~> 5.0'
6
-
7
- group :test, :development do
8
- gem 'byebug'
9
- gem 'minitest'
10
- gem 'mocha'
11
- gem 'rake'
12
- gem 'webmock'
13
- gem 'yard'
14
- end
15
-
16
- gemspec path: '../'
@@ -1,62 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- tp_client (0.2.3)
5
- activesupport (>= 4.0, < 7.0)
6
- curb (> 0.7.0, < 1.0.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activesupport (5.2.3)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- addressable (2.6.0)
17
- public_suffix (>= 2.0.2, < 4.0)
18
- appraisal (2.2.0)
19
- bundler
20
- rake
21
- thor (>= 0.14.0)
22
- byebug (11.0.1)
23
- concurrent-ruby (1.1.5)
24
- crack (0.4.3)
25
- safe_yaml (~> 1.0.0)
26
- curb (0.9.10)
27
- hashdiff (1.0.0)
28
- i18n (1.6.0)
29
- concurrent-ruby (~> 1.0)
30
- metaclass (0.0.4)
31
- minitest (5.11.3)
32
- mocha (1.9.0)
33
- metaclass (~> 0.0.1)
34
- public_suffix (3.1.1)
35
- rake (12.3.3)
36
- safe_yaml (1.0.5)
37
- thor (0.20.3)
38
- thread_safe (0.3.6)
39
- tzinfo (1.2.5)
40
- thread_safe (~> 0.1)
41
- webmock (3.7.0)
42
- addressable (>= 2.3.6)
43
- crack (>= 0.3.2)
44
- hashdiff (>= 0.4.0, < 2.0.0)
45
- yard (0.9.20)
46
-
47
- PLATFORMS
48
- ruby
49
-
50
- DEPENDENCIES
51
- activesupport (~> 5.0)
52
- appraisal (~> 2.2, >= 2.2.0)
53
- byebug
54
- minitest
55
- mocha
56
- rake
57
- tp_client!
58
- webmock
59
- yard
60
-
61
- BUNDLED WITH
62
- 1.17.3
@@ -1,64 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- tp_client (0.2.3)
5
- activesupport (>= 4.0, < 7.0)
6
- curb (> 0.7.0, < 1.0.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activesupport (6.0.0)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- zeitwerk (~> 2.1, >= 2.1.8)
17
- addressable (2.6.0)
18
- public_suffix (>= 2.0.2, < 4.0)
19
- appraisal (2.2.0)
20
- bundler
21
- rake
22
- thor (>= 0.14.0)
23
- byebug (11.0.1)
24
- concurrent-ruby (1.1.5)
25
- crack (0.4.3)
26
- safe_yaml (~> 1.0.0)
27
- curb (0.9.10)
28
- hashdiff (1.0.0)
29
- i18n (1.6.0)
30
- concurrent-ruby (~> 1.0)
31
- metaclass (0.0.4)
32
- minitest (5.11.3)
33
- mocha (1.9.0)
34
- metaclass (~> 0.0.1)
35
- public_suffix (3.1.1)
36
- rake (12.3.3)
37
- safe_yaml (1.0.5)
38
- thor (0.20.3)
39
- thread_safe (0.3.6)
40
- tzinfo (1.2.5)
41
- thread_safe (~> 0.1)
42
- webmock (3.7.0)
43
- addressable (>= 2.3.6)
44
- crack (>= 0.3.2)
45
- hashdiff (>= 0.4.0, < 2.0.0)
46
- yard (0.9.20)
47
- zeitwerk (2.1.9)
48
-
49
- PLATFORMS
50
- ruby
51
-
52
- DEPENDENCIES
53
- activesupport (~> 6.0)
54
- appraisal (~> 2.2, >= 2.2.0)
55
- byebug
56
- minitest
57
- mocha
58
- rake
59
- tp_client!
60
- webmock
61
- yard
62
-
63
- BUNDLED WITH
64
- 1.17.3