net-hippie 1.1.1 → 1.2.0

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: 051e8891d5a55b98ee703ccb8369925b80179a2bccd2867e07a94ca4b11133e3
4
- data.tar.gz: d161c75b62c9dbb25d16be41d02a322e6c39a0fb316f78f2af6a22055cf187a5
3
+ metadata.gz: 8022bf107e849103e21fc49ea92cfc570394c301cae3568fc57173471432578f
4
+ data.tar.gz: f0b3442b8b5ccf7fd51fb09e31f85877d66ea0368eaa713ac689c7ed58e5340c
5
5
  SHA512:
6
- metadata.gz: 67be78740aa0c2911bc34a061ce2ab23e08ce06234252eb9eacb802b29af95dac8e4c8e9942762e1c69c1361cd6cb263d9f4f74155f3d887661379ad98e0a6c9
7
- data.tar.gz: 1453850332a746d001243ebf0b2dd9c1df61deaddeb54bd39b97cc5c2bfab06d4421624403c187bcbcf3e2f370bc46d8654d73dd9126d5cf73a2399e397c8e38
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.1
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,9 +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
+
10
14
  ## [1.1.1] - 2021-01-30
11
15
  ### Changed
12
- - Update
16
+ - Update Gem Metadata
13
17
 
14
18
  ## [1.1.0] - 2020-12-26
15
19
  ### Added
@@ -80,7 +84,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
80
84
  - with\_retry.
81
85
  - authorization header helpers
82
86
 
83
- [Unreleased]: https://github.com/xlgmokha/net-hippie/compare/v1.1.0...HEAD
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
84
90
  [1.1.0]: https://github.com/xlgmokha/net-hippie/compare/v1.0.1...v1.1.0
85
91
  [1.0.1]: https://github.com/xlgmokha/net-hippie/compare/v1.0.0...v1.0.1
86
92
  [1.0.0]: https://github.com/xlgmokha/net-hippie/compare/v0.3.2...v1.0.0
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/xlgmokha/net-hippie/workflows/Test/badge.svg)](https://github.com/xlgmokha/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
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.1'
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
@@ -15,7 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://rubygems.org/gems/net-hippie'
16
16
  spec.license = 'MIT'
17
17
  spec.metadata = {
18
- 'source_code_uri' => 'https://github.com/xlgmokha/net-hippie'
18
+ 'source_code_uri' => 'https://github.com/xlgmokha/net-hippie',
19
+ 'rubygems_mfa_required' => 'true'
19
20
  }
20
21
 
21
22
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -26,9 +27,10 @@ Gem::Specification.new do |spec|
26
27
  spec.require_paths = ['lib']
27
28
  spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
28
29
 
30
+ spec.add_dependency 'logger', '~> 1.0'
29
31
  spec.add_development_dependency 'minitest', '~> 5.0'
30
32
  spec.add_development_dependency 'rake', '~> 13.0'
31
- spec.add_development_dependency 'rubocop', '~> 0.55'
33
+ spec.add_development_dependency 'rubocop', '~> 1.9'
32
34
  spec.add_development_dependency 'vcr', '~> 6.0'
33
35
  spec.add_development_dependency 'webmock', '~> 3.4'
34
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.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-31 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
@@ -115,6 +128,7 @@ licenses:
115
128
  - MIT
116
129
  metadata:
117
130
  source_code_uri: https://github.com/xlgmokha/net-hippie
131
+ rubygems_mfa_required: 'true'
118
132
  post_install_message:
119
133
  rdoc_options: []
120
134
  require_paths:
@@ -130,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
144
  - !ruby/object:Gem::Version
131
145
  version: '0'
132
146
  requirements: []
133
- rubygems_version: 3.2.3
147
+ rubygems_version: 3.5.23
134
148
  signing_key:
135
149
  specification_version: 4
136
150
  summary: net/http for hippies. ☮️
@@ -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