pathname 0.3.0 → 0.4.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: 9a656bfd312a6e64a60dbe0587adb442864e7e243112dfd2de00818faa81ddd8
4
- data.tar.gz: 4bb517d92a8f16923bb2c2e0b3e6cd6336f7b384e69d6a8f93f5fb9c9db4be6e
3
+ metadata.gz: b7667d4cec31df28ffcfe85b035246a5efc867339ff3cc3c53712b3c61529534
4
+ data.tar.gz: 12cfe37fad1b656250d6b777ceedd9f5ef7f7ff96a1a1bf70db29a3fdd458eda
5
5
  SHA512:
6
- metadata.gz: 257242ff8d0cad1b3510f8baa055b53c613d62b8be2975e559824f202cf2500ef700ca714223c0978b03befac7c5daae9eaa3847c6c8b12e50952504ca966f90
7
- data.tar.gz: 13061a06efa6cbfd3b08799e0974691f1e3d52df1210031d080d2bdb2bfd24081b9c241a21f7115ee859d78d1da8a57cfbf4cd26d68b4eb1446a3886019f3017
6
+ metadata.gz: a7cdeaf870f2eef4c8cb394fbe16d2c9aa36f950787da7f2bde6e65b4294b16a01ed28341df955f8fb1f0caa0ede2fdc585242470611ee164a4caca6312701dc
7
+ data.tar.gz: 3ca9f67a7d1cc76df2b89e578b297ae860dd388293f400534b2ea45bbedb06e48ba49995ece6d99384f93d2f86389b125073363a76f48ddf32b63c7d789b04b2
@@ -0,0 +1,66 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository == 'ruby/pathname'
14
+ runs-on: ubuntu-latest
15
+
16
+ environment:
17
+ name: rubygems.org
18
+ url: https://rubygems.org/gems/pathname
19
+
20
+ permissions:
21
+ contents: write
22
+ id-token: write
23
+
24
+ steps:
25
+ - name: Harden Runner
26
+ uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
27
+ with:
28
+ egress-policy: audit
29
+
30
+ - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
31
+
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
34
+ with:
35
+ bundler-cache: true
36
+ ruby-version: ruby
37
+
38
+ - name: Set remote URL
39
+ run: |
40
+ # Attribute commits to the last committer on HEAD
41
+ git config --global user.email "$(git log -1 --pretty=format:'%ae')"
42
+ git config --global user.name "$(git log -1 --pretty=format:'%an')"
43
+ git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY"
44
+ shell: bash
45
+
46
+ - name: Configure trusted publishing credentials
47
+ uses: rubygems/configure-rubygems-credentials@v1.0.0
48
+
49
+ - name: Install dependencies
50
+ run: gem install rake-compiler
51
+ shell: bash
52
+
53
+ - name: Run release rake task
54
+ run: rake release
55
+ shell: bash
56
+
57
+ - name: Wait for release to propagate
58
+ run: gem exec rubygems-await pkg/*.gem
59
+ shell: bash
60
+
61
+ - name: Create GitHub release
62
+ run: |
63
+ tag_name="$(git describe --tags --abbrev=0)"
64
+ gh release create "${tag_name}" --verify-tag --generate-notes
65
+ env:
66
+ GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
@@ -4,10 +4,10 @@ Redistribution and use in source and binary forms, with or without
4
4
  modification, are permitted provided that the following conditions
5
5
  are met:
6
6
  1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
7
+ notice, this list of conditions and the following disclaimer.
8
8
  2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
11
 
12
12
  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
13
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
data/COPYING ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a. place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b. use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c. give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d. make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a. distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b. accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c. give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d. make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
@@ -1,4 +1,3 @@
1
1
  # frozen_string_literal: false
2
2
  require 'mkmf'
3
- have_func("rb_file_s_birthtime")
4
3
  create_makefile('pathname')
@@ -479,7 +479,6 @@ path_atime(VALUE self)
479
479
  return rb_funcall(rb_cFile, id_atime, 1, get_strpath(self));
480
480
  }
481
481
 
482
- #if defined(HAVE_RB_FILE_S_BIRTHTIME)
483
482
  /*
484
483
  * call-seq:
485
484
  * pathname.birthtime -> time
@@ -494,10 +493,6 @@ path_birthtime(VALUE self)
494
493
  {
495
494
  return rb_funcall(rb_cFile, id_birthtime, 1, get_strpath(self));
496
495
  }
497
- #else
498
- /* check at compilation time for `respond_to?` */
499
- # define path_birthtime rb_f_notimplement
500
- #endif
501
496
 
502
497
  /*
503
498
  * call-seq:
data/lib/pathname.rb CHANGED
@@ -14,7 +14,7 @@ require 'pathname.so'
14
14
 
15
15
  class Pathname
16
16
 
17
- VERSION = "0.3.0"
17
+ VERSION = "0.4.0"
18
18
 
19
19
  # :stopdoc:
20
20
 
@@ -572,7 +572,7 @@ class Pathname # * Find *
572
572
  return to_enum(__method__, ignore_error: ignore_error) unless block_given?
573
573
  require 'find'
574
574
  if @path == '.'
575
- Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
575
+ Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f.delete_prefix('./')) }
576
576
  else
577
577
  Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f) }
578
578
  end
@@ -580,16 +580,15 @@ class Pathname # * Find *
580
580
  end
581
581
 
582
582
 
583
- autoload(:FileUtils, 'fileutils')
584
-
585
583
  class Pathname # * FileUtils *
586
584
  # Creates a full path, including any intermediate directories that don't yet
587
585
  # exist.
588
586
  #
589
587
  # See FileUtils.mkpath and FileUtils.mkdir_p
590
588
  def mkpath(mode: nil)
589
+ require 'fileutils'
591
590
  FileUtils.mkpath(@path, mode: mode)
592
- nil
591
+ self
593
592
  end
594
593
 
595
594
  # Recursively deletes a directory, including all directories beneath it.
@@ -600,7 +599,23 @@ class Pathname # * FileUtils *
600
599
  # File::Path provides "mkpath" and "rmtree".
601
600
  require 'fileutils'
602
601
  FileUtils.rm_rf(@path, noop: noop, verbose: verbose, secure: secure)
603
- nil
602
+ self
604
603
  end
605
604
  end
606
605
 
606
+ class Pathname # * tmpdir *
607
+ # Creates a tmp directory and wraps the returned path in a Pathname object.
608
+ #
609
+ # See Dir.mktmpdir
610
+ def self.mktmpdir
611
+ require 'tmpdir' unless defined?(Dir.mktmpdir)
612
+ if block_given?
613
+ Dir.mktmpdir do |dir|
614
+ dir = self.new(dir)
615
+ yield dir
616
+ end
617
+ else
618
+ self.new(Dir.mktmpdir)
619
+ end
620
+ end
621
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pathname
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanaka Akira
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Representation of the name of a file or directory on the filesystem
14
14
  email:
@@ -20,10 +20,12 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - ".git-blame-ignore-revs"
22
22
  - ".github/dependabot.yml"
23
+ - ".github/workflows/push_gem.yml"
23
24
  - ".github/workflows/test.yml"
24
25
  - ".gitignore"
26
+ - BSDL
27
+ - COPYING
25
28
  - Gemfile
26
- - LICENSE.txt
27
29
  - README.md
28
30
  - Rakefile
29
31
  - bin/console
@@ -39,7 +41,7 @@ licenses:
39
41
  metadata:
40
42
  homepage_uri: https://github.com/ruby/pathname
41
43
  source_code_uri: https://github.com/ruby/pathname
42
- post_install_message:
44
+ post_install_message:
43
45
  rdoc_options: []
44
46
  require_paths:
45
47
  - lib
@@ -54,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
56
  - !ruby/object:Gem::Version
55
57
  version: '0'
56
58
  requirements: []
57
- rubygems_version: 3.5.0.dev
58
- signing_key:
59
+ rubygems_version: 3.5.11
60
+ signing_key:
59
61
  specification_version: 4
60
62
  summary: Representation of the name of a file or directory on the filesystem
61
63
  test_files: []