process-path 0.1.0 → 0.1.3

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: d3f58ece4d9a8e00e0dd8698b74a7b8eabc96d6c36bb4bb1a75867c7e8174b8d
4
- data.tar.gz: 4dc83eabcbbfd01144a040511ea53b38296ceccf0228b3d143da805a98f13c21
3
+ metadata.gz: f0dff0424ce27501e4d95a875dbb9c472e89638e7eefa78b553e2851f4d8d1f9
4
+ data.tar.gz: 5907ad972bd99848f74b5665bda98f33e9b8c05ef2f5edfa7751aac991e479f1
5
5
  SHA512:
6
- metadata.gz: cb0997a5e3ed2397db32dd0841e8d9e50633bd2b21bcbe6c5244a42035056c40d188f8677e267b87f336d89b0a031c1b18d3ccf924e48c86d4f4b117d2d45336
7
- data.tar.gz: 22858822b17571493644d17e7b72b63bce5e4b56aa07002b8f56d3cebc9277a88f6ea692bb9117965f665d69f1ad3f6872346b884fc7589d164d82ee063d486c
6
+ metadata.gz: 6eb02bd5d52958a01bab9858368d78aa0e8543549db86ca66b09a61375665c842a4edd5e7ab66807f858433689d0ae44e0c073819502fd03e238f57dfba1a157
7
+ data.tar.gz: b509a7535efa599427050b01296d2f90a40783186e3928cdb5bd395a5e113a6c9fcc2be2c4f30486c22f77ac6b4b0105413599f9c6b6674b75a186afc390c95b
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: yagihiro
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,30 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+
15
+ jobs:
16
+ test:
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu, macos]
21
+ ruby: [2.7, 3.0.4, 3.1] # Explicitly specifying 3.0.4 because specifying 3.0 will cause 3.1.2 to be used
22
+ runs-on: ${{ matrix.os }}-latest
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ bundler-cache: true
29
+ - run: bundle install --jobs 2 --retry 3
30
+ - run: bundle exec rake
data/.gitignore CHANGED
@@ -6,6 +6,9 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
13
+
14
+ Gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,3 +1,5 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  # The behavior of RuboCop can be controlled via the .rubocop.yml
2
4
  # configuration file. It makes it possible to enable/disable
3
5
  # certain cops (checks) and to alter their behavior if they accept
@@ -8,17 +10,3 @@
8
10
  # where the inspected file is and continue its way up to the root directory.
9
11
  #
10
12
  # See https://docs.rubocop.org/rubocop/configuration
11
-
12
- inherit_from: .rubocop_todo.yml
13
-
14
- AllCops:
15
- RubyInterpreters:
16
- - ruby
17
- TargetRubyVersion: 2.6
18
- NewCops: enable
19
- Exclude:
20
- - 'bin/*'
21
-
22
- Lint/AmbiguousBlockAssociation:
23
- Exclude:
24
- - 'spec/**/*'
data/.rubocop_todo.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-08-09 05:48:45 UTC using RuboCop version 0.89.0.
3
+ # on 2021-06-25 15:59:13 UTC using RuboCop version 1.17.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
-
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ 3.1.2
data/Gemfile CHANGED
@@ -5,8 +5,9 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in process-path.gemspec
6
6
  gemspec
7
7
 
8
+ gem 'panolint', require: false
8
9
  gem 'pry'
9
10
  gem 'rake', require: false
10
11
  gem 'rspec'
11
12
  gem 'rubocop', require: false
12
- gem 'simplecov', '~> 0.17.0', require: false
13
+ gem 'simplecov', require: false
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Process::Path
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/process-path.svg)](https://badge.fury.io/rb/process-path)
4
+ ![Ruby](https://github.com/yagihiro/process-path/workflows/Ruby/badge.svg)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/39b1c2e07668d7354cdb/maintainability)](https://codeclimate.com/github/yagihiro/process-path/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/39b1c2e07668d7354cdb/test_coverage)](https://codeclimate.com/github/yagihiro/process-path/test_coverage)
7
+
3
8
  Process::Path is a small library to get the path of the currently running process.
4
9
 
5
10
  ## Installation
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "process/path"
4
+ require 'bundler/setup'
5
+ require 'process/path'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "process/path"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Process
4
+ module Path
5
+ # @!visibility private
6
+ # Process::Path::LinuxImpl module
7
+ module LinuxImpl
8
+ def self.path
9
+ `readlink -f /proc/#{Process.pid}/exe`
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fiddle/import'
4
+
5
+ module Process
6
+ module Path
7
+ # @!visibility private
8
+ # Process::Path::OSXImpl module
9
+ module OSXImpl
10
+ extend Fiddle::Importer
11
+ dlload 'libSystem.B.dylib'
12
+ extern 'int proc_pidpath(int, void *, unsigned int)'
13
+
14
+ def self.path
15
+ s = ' ' * 4096
16
+ proc_pidpath(Process.pid, s, 4096)
17
+ s.unpack1('Z*')
18
+ end
19
+ end
20
+ end
21
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Process
4
4
  module Path
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
data/lib/process/path.rb CHANGED
@@ -7,35 +7,15 @@ require_relative 'path/version'
7
7
  module Process
8
8
  # Process::Path module
9
9
  module Path
10
- # @!visibility private
11
- # Process::Path::OSXImpl module
12
- module OSXImpl
13
- extend Fiddle::Importer
14
- dlload 'libSystem.B.dylib'
15
- extern 'int proc_pidpath(int, void *, unsigned int)'
16
-
17
- def self.path
18
- s = ' ' * 4096
19
- proc_pidpath(Process.pid, s, 4096)
20
- s.unpack1('Z*')
21
- end
22
- end
23
-
24
- # @!visibility private
25
- # Process::Path::LinuxImpl module
26
- module LinuxImpl
27
- def self.path
28
- `readlink -f /proc/#{Process.pid}/exe`
29
- end
30
- end
31
-
32
10
  # Returns the path to the current ruby running as a string.
33
11
  # @return [String] The path to the current ruby running as a string.
34
12
  # @note Currently only osx and linux are supported.
35
13
  def self.path
36
14
  if Process::Path::OS.mac?
15
+ require_relative 'path/osx'
37
16
  Process::Path::OSXImpl.path
38
17
  elsif Process::Path::OS.linux?
18
+ require_relative 'path/linux'
39
19
  Process::Path::LinuxImpl.path
40
20
  else
41
21
  raise 'Not implemented'
data/process-path.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Process::Path is a small library to get the path of the currently running process.'
13
13
  spec.homepage = 'https://github.com/yagihiro/process-path'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
 
18
18
  # Specify which files should be added to the gem when it is released.
data/renovate.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "config:base"
4
+ ]
5
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process-path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Yagita
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-10 00:00:00.000000000 Z
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Process::Path is a small library to get the path of the currently running
14
14
  process.
@@ -18,6 +18,8 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - ".github/FUNDING.yml"
22
+ - ".github/workflows/ruby.yml"
21
23
  - ".gitignore"
22
24
  - ".rspec"
23
25
  - ".rubocop.yml"
@@ -26,22 +28,24 @@ files:
26
28
  - ".travis.yml"
27
29
  - CODE_OF_CONDUCT.md
28
30
  - Gemfile
29
- - Gemfile.lock
30
31
  - LICENSE.txt
31
32
  - README.md
32
33
  - Rakefile
33
34
  - bin/console
34
35
  - bin/setup
35
36
  - lib/process/path.rb
37
+ - lib/process/path/linux.rb
36
38
  - lib/process/path/os.rb
39
+ - lib/process/path/osx.rb
37
40
  - lib/process/path/version.rb
38
41
  - process-path.gemspec
42
+ - renovate.json
39
43
  homepage: https://github.com/yagihiro/process-path
40
44
  licenses:
41
45
  - MIT
42
46
  metadata:
43
47
  homepage_uri: https://github.com/yagihiro/process-path
44
- post_install_message:
48
+ post_install_message:
45
49
  rdoc_options: []
46
50
  require_paths:
47
51
  - lib
@@ -49,15 +53,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
53
  requirements:
50
54
  - - ">="
51
55
  - !ruby/object:Gem::Version
52
- version: 2.6.0
56
+ version: 2.7.0
53
57
  required_rubygems_version: !ruby/object:Gem::Requirement
54
58
  requirements:
55
59
  - - ">="
56
60
  - !ruby/object:Gem::Version
57
61
  version: '0'
58
62
  requirements: []
59
- rubygems_version: 3.1.2
60
- signing_key:
63
+ rubygems_version: 3.3.7
64
+ signing_key:
61
65
  specification_version: 4
62
66
  summary: Process::Path is a small library to get the path of the currently running
63
67
  process.
data/Gemfile.lock DELETED
@@ -1,69 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- process-path (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.1)
10
- coderay (1.1.3)
11
- diff-lcs (1.4.4)
12
- docile (1.3.2)
13
- json (2.3.1)
14
- method_source (1.0.0)
15
- parallel (1.19.2)
16
- parser (2.7.1.4)
17
- ast (~> 2.4.1)
18
- pry (0.13.1)
19
- coderay (~> 1.1)
20
- method_source (~> 1.0)
21
- rainbow (3.0.0)
22
- rake (13.0.1)
23
- regexp_parser (1.7.1)
24
- rexml (3.2.4)
25
- rspec (3.9.0)
26
- rspec-core (~> 3.9.0)
27
- rspec-expectations (~> 3.9.0)
28
- rspec-mocks (~> 3.9.0)
29
- rspec-core (3.9.2)
30
- rspec-support (~> 3.9.3)
31
- rspec-expectations (3.9.2)
32
- diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.9.0)
34
- rspec-mocks (3.9.1)
35
- diff-lcs (>= 1.2.0, < 2.0)
36
- rspec-support (~> 3.9.0)
37
- rspec-support (3.9.3)
38
- rubocop (0.89.0)
39
- parallel (~> 1.10)
40
- parser (>= 2.7.1.1)
41
- rainbow (>= 2.2.2, < 4.0)
42
- regexp_parser (>= 1.7)
43
- rexml
44
- rubocop-ast (>= 0.1.0, < 1.0)
45
- ruby-progressbar (~> 1.7)
46
- unicode-display_width (>= 1.4.0, < 2.0)
47
- rubocop-ast (0.3.0)
48
- parser (>= 2.7.1.4)
49
- ruby-progressbar (1.10.1)
50
- simplecov (0.17.1)
51
- docile (~> 1.1)
52
- json (>= 1.8, < 3)
53
- simplecov-html (~> 0.10.0)
54
- simplecov-html (0.10.2)
55
- unicode-display_width (1.7.0)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- process-path!
62
- pry
63
- rake
64
- rspec
65
- rubocop
66
- simplecov (~> 0.17.0)
67
-
68
- BUNDLED WITH
69
- 2.1.4