net-hippie 1.1.0 → 1.2.0

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: 4d4fa43c3b9fd3549ccfa003cf06c2355c472e4d9e34838a78ca2bca1eff2c26
4
- data.tar.gz: f1f01ac4e24b1414a5aa4e2f0434d3b12f4df21cd921bee0b6ada5c4c20ef1ae
3
+ metadata.gz: 8022bf107e849103e21fc49ea92cfc570394c301cae3568fc57173471432578f
4
+ data.tar.gz: f0b3442b8b5ccf7fd51fb09e31f85877d66ea0368eaa713ac689c7ed58e5340c
5
5
  SHA512:
6
- metadata.gz: 4a5d071dd9acb91eec03dfc30ce0f33473752330b1a5ae8f7ea9a4f7ca1733bd3d81d2b8270e2f76f3ed71c7c6e13794346a061093aebbaf733c0b07e01fcdb5
7
- data.tar.gz: beceb3cf65e42d844b9dbd7976f26bc96e3d72c8759a7b10dd26ce4ce5aadc0a62bc153d58464afd2ffc085a364ba5adddfa5bdc84a61455621d2d602161b7ad
6
+ metadata.gz: 7239565953fd5222222cb4f0b4181443dd96fdf01389deb27e352389b90707c16f44d01548b4277935a31ced02224c5f821441db6f0ae116d75402beaadba163
7
+ data.tar.gz: 818f4b089eb080640819a153259267ff54152f1429b525ae6ac82c3ae192e67f4ca38e2a7b114c731047126a91b1f17a433ff60f19c1b199edb42caa24384ff7
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: "bundler"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "daily"
8
+ assignees:
9
+ - "xlgmokha"
@@ -0,0 +1,31 @@
1
+ name: ci
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ matrix:
12
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby-version }}
19
+ bundler-cache: true
20
+ - name: Running tests…
21
+ run: sh bin/test
22
+ style:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: '3.4'
29
+ bundler-cache: true
30
+ - name: Running style checks…
31
+ run: sh bin/style
data/.rubocop.yml CHANGED
@@ -8,6 +8,9 @@ AllCops:
8
8
  NewCops: enable
9
9
  TargetRubyVersion: 2.5
10
10
 
11
+ Gemspec/DevelopmentDependencies:
12
+ EnforcedStyle: gemspec
13
+
11
14
  Layout/ParameterAlignment:
12
15
  EnforcedStyle: with_fixed_indentation
13
16
 
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- Version 1.1.0
1
+ Version 1.2.0
2
2
 
3
3
  # Changelog
4
4
  All notable changes to this project will be documented in this file.
@@ -7,6 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7
7
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
9
  ## [Unreleased]
10
+ ## [1.2.0] - 2024-12-05
11
+ ### Changed
12
+ - Disable logger by default
13
+
14
+ ## [1.1.1] - 2021-01-30
15
+ ### Changed
16
+ - Update Gem Metadata
10
17
 
11
18
  ## [1.1.0] - 2020-12-26
12
19
  ### Added
@@ -74,30 +81,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
74
81
 
75
82
  ## [0.2.1] - 2019-02-01
76
83
  ### Added
77
- - with\_retry.https://www.mokhan.ca/%F0%9F%92%8E/2018/11/10/net-hippie-0-2-0.html
84
+ - with\_retry.
78
85
  - authorization header helpers
79
86
 
80
- [Unreleased]: https://github.com/mokhan/net-hippie/compare/v1.1.0...HEAD
81
- [1.1.0]: https://github.com/mokhan/net-hippie/compare/v1.0.1...v1.1.0
82
- [1.0.1]: https://github.com/mokhan/net-hippie/compare/v1.0.0...v1.0.1
83
- [1.0.0]: https://github.com/mokhan/net-hippie/compare/v0.3.2...v1.0.0
84
- [0.3.2]: https://github.com/mokhan/net-hippie/compare/v0.3.1...v0.3.2
85
- [0.3.1]: https://github.com/mokhan/net-hippie/compare/v0.3.0...v0.3.1
86
- [0.3.0]: https://github.com/mokhan/net-hippie/compare/v0.2.7...v0.3.0
87
- [0.2.7]: https://github.com/mokhan/net-hippie/compare/v0.2.6...v0.2.7
88
- [0.2.6]: https://github.com/mokhan/net-hippie/compare/v0.2.5...v0.2.6
89
- [0.2.5]: https://github.com/mokhan/net-hippie/compare/v0.2.4...v0.2.5
90
- [0.2.4]: https://github.com/mokhan/net-hippie/compare/v0.2.3...v0.2.4
91
- [0.2.3]: https://github.com/mokhan/net-hippie/compare/v0.2.2...v0.2.3
92
- [0.2.2]: https://github.com/mokhan/net-hippie/compare/v0.2.1...v0.2.2
93
- [0.2.1]: https://github.com/mokhan/net-hippie/compare/v0.2.0...v0.2.1
94
- [0.2.0]: https://github.com/mokhan/net-hippie/compare/v0.1.9...v0.2.0
95
- [0.1.9]: https://github.com/mokhan/net-hippie/compare/v0.1.8...v0.1.9
96
- [0.1.8]: https://github.com/mokhan/net-hippie/compare/v0.1.7...v0.1.8
97
- [0.1.7]: https://github.com/mokhan/net-hippie/compare/v0.1.6...v0.1.7
98
- [0.1.6]: https://github.com/mokhan/net-hippie/compare/v0.1.5...v0.1.6
99
- [0.1.5]: https://github.com/mokhan/net-hippie/compare/v0.1.4...v0.1.5
100
- [0.1.4]: https://github.com/mokhan/net-hippie/compare/v0.1.3...v0.1.4
101
- [0.1.3]: https://github.com/mokhan/net-hippie/compare/v0.1.2...v0.1.3
102
- [0.1.2]: https://github.com/mokhan/net-hippie/compare/v0.1.1...v0.1.2
103
- [0.1.1]: https://github.com/mokhan/net-hippie/compare/v0.1.0...v0.1.1
87
+ [Unreleased]: https://github.com/xlgmokha/net-hippie/compare/v1.2.0...HEAD
88
+ [1.2.0]: https://github.com/xlgmokha/net-hippie/compare/v1.1.1...v1.2.0
89
+ [1.1.1]: https://github.com/xlgmokha/net-hippie/compare/v1.1.0...v1.1.1
90
+ [1.1.0]: https://github.com/xlgmokha/net-hippie/compare/v1.0.1...v1.1.0
91
+ [1.0.1]: https://github.com/xlgmokha/net-hippie/compare/v1.0.0...v1.0.1
92
+ [1.0.0]: https://github.com/xlgmokha/net-hippie/compare/v0.3.2...v1.0.0
93
+ [0.3.2]: https://github.com/xlgmokha/net-hippie/compare/v0.3.1...v0.3.2
94
+ [0.3.1]: https://github.com/xlgmokha/net-hippie/compare/v0.3.0...v0.3.1
95
+ [0.3.0]: https://github.com/xlgmokha/net-hippie/compare/v0.2.7...v0.3.0
96
+ [0.2.7]: https://github.com/xlgmokha/net-hippie/compare/v0.2.6...v0.2.7
97
+ [0.2.6]: https://github.com/xlgmokha/net-hippie/compare/v0.2.5...v0.2.6
98
+ [0.2.5]: https://github.com/xlgmokha/net-hippie/compare/v0.2.4...v0.2.5
99
+ [0.2.4]: https://github.com/xlgmokha/net-hippie/compare/v0.2.3...v0.2.4
100
+ [0.2.3]: https://github.com/xlgmokha/net-hippie/compare/v0.2.2...v0.2.3
101
+ [0.2.2]: https://github.com/xlgmokha/net-hippie/compare/v0.2.1...v0.2.2
102
+ [0.2.1]: https://github.com/xlgmokha/net-hippie/compare/v0.2.0...v0.2.1
103
+ [0.2.0]: https://github.com/xlgmokha/net-hippie/compare/v0.1.9...v0.2.0
104
+ [0.1.9]: https://github.com/xlgmokha/net-hippie/compare/v0.1.8...v0.1.9
105
+ [0.1.8]: https://github.com/xlgmokha/net-hippie/compare/v0.1.7...v0.1.8
106
+ [0.1.7]: https://github.com/xlgmokha/net-hippie/compare/v0.1.6...v0.1.7
107
+ [0.1.6]: https://github.com/xlgmokha/net-hippie/compare/v0.1.5...v0.1.6
108
+ [0.1.5]: https://github.com/xlgmokha/net-hippie/compare/v0.1.4...v0.1.5
109
+ [0.1.4]: https://github.com/xlgmokha/net-hippie/compare/v0.1.3...v0.1.4
110
+ [0.1.3]: https://github.com/xlgmokha/net-hippie/compare/v0.1.2...v0.1.3
111
+ [0.1.2]: https://github.com/xlgmokha/net-hippie/compare/v0.1.1...v0.1.2
112
+ [0.1.1]: https://github.com/xlgmokha/net-hippie/compare/v0.1.0...v0.1.1
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 mo
3
+ Copyright (c) 2018 mo khan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Net::Hippie
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/net-hippie.svg)](https://rubygems.org/gems/net-hippie)
4
- [![Build Status](https://github.com/mokhan/net-hippie/workflows/Test/badge.svg)](https://github.com/mokhan/net-hippie/actions)
4
+ [![Build Status](https://github.com/xlgmokha/net-hippie/actions/workflows/ci.yml/badge.svg))](https://github.com/xlgmokha/net-hippie/actions)
5
+
5
6
 
6
7
  `Net::Hippie` is a light weight wrapper around `net/http` that defaults to
7
8
  sending `JSON` messages.
@@ -65,6 +66,12 @@ client = Net::Hippie::Client.new(
65
66
  )
66
67
  ```
67
68
 
69
+ To disable logging you will need to override the default logger.
70
+
71
+ ```ruby
72
+ client = Net::Hippie::Client.new(logger: nil)
73
+ ```
74
+
68
75
  ### Basic Auth
69
76
 
70
77
  ```ruby
@@ -95,7 +102,7 @@ push git commits and tags, and push the `.gem` file to [rubygems.org](https://ru
95
102
 
96
103
  ## Contributing
97
104
 
98
- Bug reports and pull requests are welcome on GitHub at https://github.com/mokhan/net-hippie.
105
+ Bug reports and pull requests are welcome on GitHub at https://github.com/xlgmokha/net-hippie.
99
106
 
100
107
  ## License
101
108
 
data/bin/console CHANGED
@@ -4,12 +4,5 @@
4
4
  require 'bundler/setup'
5
5
  require 'net/hippie'
6
6
 
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
7
  require 'irb'
15
8
  IRB.start(__FILE__)
data/bin/setup CHANGED
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
1
+ #!/bin/sh
2
+ set -e
3
+ [ -z "$DEBUG" ] || set -x
4
+
5
+ cd "$(dirname "$0")/.."
4
6
 
5
- ruby -v
6
- gem install bundler -v '~> 2.0'
7
7
  bundle install
data/bin/shipit CHANGED
@@ -1,10 +1,8 @@
1
1
  #!/bin/sh
2
2
 
3
3
  set -e
4
+ [ -z "$DEBUG" ] || set -x
4
5
 
5
6
  cd "$(dirname "$0")/.."
6
7
 
7
- [ -z "$DEBUG" ] || set -x
8
-
9
- bin/cibuild
10
8
  bundle exec rake release
data/bin/style ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+ [ -z "$DEBUG" ] || set -x
5
+
6
+ cd "$(dirname "$0")/.."
7
+
8
+ bundle exec rake rubocop
data/bin/test CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  set -e
4
+ [ -z "$DEBUG" ] || set -x
4
5
 
5
6
  cd "$(dirname "$0")/.."
6
7
 
@@ -84,7 +84,7 @@ module Net
84
84
  raise error if attempt == max
85
85
 
86
86
  delay = ((2**attempt) * 0.1) + Random.rand(0.05) # delay + jitter
87
- logger.warn("`#{error.message}` #{attempt + 1}/#{max} Delay: #{delay}s")
87
+ logger&.warn("`#{error.message}` #{attempt + 1}/#{max} Delay: #{delay}s")
88
88
  sleep delay
89
89
  end
90
90
 
@@ -10,7 +10,7 @@ module Net
10
10
  http.open_timeout = options.fetch(:open_timeout, 10)
11
11
  http.use_ssl = scheme == 'https'
12
12
  http.verify_mode = options.fetch(:verify_mode, Net::Hippie.verify_mode)
13
- http.set_debug_output(options.fetch(:logger, Net::Hippie.logger))
13
+ http.set_debug_output(options[:logger]) if options[:logger]
14
14
  apply_client_tls_to(http, options)
15
15
  @http = http
16
16
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Net
4
4
  module Hippie
5
- VERSION = '1.1.0'
5
+ VERSION = '1.2.0'
6
6
  end
7
7
  end
data/lib/net/hippie.rb CHANGED
@@ -31,7 +31,7 @@ module Net
31
31
  ].freeze
32
32
 
33
33
  def self.logger
34
- @logger ||= Logger.new($stderr)
34
+ @logger ||= Logger.new(nil)
35
35
  end
36
36
 
37
37
  def self.logger=(logger)
data/net-hippie.gemspec CHANGED
@@ -12,10 +12,14 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = 'net/http for hippies. ☮️ '
14
14
  spec.description = 'net/http for hippies. ☮️ '
15
- spec.homepage = 'https://github.com/mokhan/net-hippie/'
15
+ spec.homepage = 'https://rubygems.org/gems/net-hippie'
16
16
  spec.license = 'MIT'
17
+ spec.metadata = {
18
+ 'source_code_uri' => 'https://github.com/xlgmokha/net-hippie',
19
+ 'rubygems_mfa_required' => 'true'
20
+ }
17
21
 
18
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
22
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
23
  f.match(%r{^(test|spec|features)/})
20
24
  end
21
25
  spec.bindir = 'exe'
@@ -23,9 +27,10 @@ Gem::Specification.new do |spec|
23
27
  spec.require_paths = ['lib']
24
28
  spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
25
29
 
30
+ spec.add_dependency 'logger', '~> 1.0'
26
31
  spec.add_development_dependency 'minitest', '~> 5.0'
27
32
  spec.add_development_dependency 'rake', '~> 13.0'
28
- spec.add_development_dependency 'rubocop', '~> 0.55'
33
+ spec.add_development_dependency 'rubocop', '~> 1.9'
29
34
  spec.add_development_dependency 'vcr', '~> 6.0'
30
35
  spec.add_development_dependency 'webmock', '~> 3.4'
31
36
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-hippie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-26 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: minitest
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +58,14 @@ dependencies:
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '0.55'
61
+ version: '1.9'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '0.55'
68
+ version: '1.9'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: vcr
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -88,20 +102,19 @@ executables:
88
102
  extensions: []
89
103
  extra_rdoc_files: []
90
104
  files:
91
- - ".github/workflows/test.yml"
105
+ - ".github/dependabot.yml"
106
+ - ".github/workflows/ci.yml"
92
107
  - ".gitignore"
93
- - ".gitlab-ci.yml"
94
108
  - ".rubocop.yml"
95
109
  - CHANGELOG.md
96
110
  - Gemfile
97
111
  - LICENSE.txt
98
112
  - README.md
99
113
  - Rakefile
100
- - bin/cibuild
101
114
  - bin/console
102
- - bin/lint
103
115
  - bin/setup
104
116
  - bin/shipit
117
+ - bin/style
105
118
  - bin/test
106
119
  - exe/net-hippie
107
120
  - lib/net/hippie.rb
@@ -110,11 +123,13 @@ files:
110
123
  - lib/net/hippie/content_type_mapper.rb
111
124
  - lib/net/hippie/version.rb
112
125
  - net-hippie.gemspec
113
- homepage: https://github.com/mokhan/net-hippie/
126
+ homepage: https://rubygems.org/gems/net-hippie
114
127
  licenses:
115
128
  - MIT
116
- metadata: {}
117
- post_install_message:
129
+ metadata:
130
+ source_code_uri: https://github.com/xlgmokha/net-hippie
131
+ rubygems_mfa_required: 'true'
132
+ post_install_message:
118
133
  rdoc_options: []
119
134
  require_paths:
120
135
  - lib
@@ -129,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
144
  - !ruby/object:Gem::Version
130
145
  version: '0'
131
146
  requirements: []
132
- rubygems_version: 3.2.3
133
- signing_key:
147
+ rubygems_version: 3.5.23
148
+ signing_key:
134
149
  specification_version: 4
135
150
  summary: net/http for hippies. ☮️
136
151
  test_files: []
@@ -1,17 +0,0 @@
1
- name: Test
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- test:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- matrix:
10
- ruby: [ '2.5', '2.6', '2.7' ]
11
- steps:
12
- - uses: actions/checkout@v1
13
- - uses: actions/setup-ruby@v1
14
- with:
15
- ruby-version: ${{ matrix.ruby }}
16
- - name: cibuild
17
- run: bin/cibuild
data/.gitlab-ci.yml DELETED
@@ -1,11 +0,0 @@
1
- image: ruby:2.6
2
-
3
- before_script:
4
- - apt-get update && apt-get install -y locales
5
- - echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
6
- - locale-gen
7
- - export LC_ALL=en_US.UTF-8
8
-
9
- ci:
10
- script:
11
- - bin/cibuild
data/bin/cibuild DELETED
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -e
4
- [ -z "$DEBUG" ] || set -x
5
-
6
- cd "$(dirname "$0")/.."
7
-
8
- export RUBY_GC_MALLOC_LIMIT=79000000
9
- export RUBY_GC_HEAP_INIT_SLOTS=800000
10
- export RUBY_HEAP_FREE_MIN=100000
11
- export RUBY_HEAP_SLOTS_INCREMENT=400000
12
- export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
13
- export CIBUILD=1
14
-
15
- echo "[$(date "+%H:%M:%S")] ==> Running setup…"
16
- bin/setup
17
-
18
- echo "[$(date "+%H:%M:%S")] ==> Running tests…"
19
- bin/test
20
-
21
- echo "[$(date "+%H:%M:%S")] ==> Running linters…"
22
- bin/lint
data/bin/lint DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -e
4
-
5
- bundle exec rake lint