dry-files 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +5 -4
- data/dry-files.gemspec +15 -13
- data/lib/dry/files/version.rb +1 -1
- data/lib/dry/files.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b04750013e1faf98db463c2c346a5f43ed63f3dca9053a881082b02ac4c6e2a
|
4
|
+
data.tar.gz: 1c3162ad5c735483ac4fbac02b588e111e55f92698682807dad68bf12503906a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8a0a61aba226cc8f1f7dc01fb06a8c21e8c2405c131cae4e45689e551996fe2d72deae4b99b0e9e677aad294bdef1eca53183a75386344a89c136afd243784d
|
7
|
+
data.tar.gz: d363a392c4427fe3b6b84349f5addcb839e7881bdcab9dcd7e6d32124632883ca490187d8e654b84ef0162a675cc25d2b928e9448504ef94132ad5076dc77110
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 0.2.0 2022-07-10
|
4
|
+
|
5
|
+
|
6
|
+
### Added
|
7
|
+
|
8
|
+
- Dry::Files#append to create intermediate directory and touch destination file (via #8) (@jodosha)
|
9
|
+
|
10
|
+
|
11
|
+
[Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-files/compare/v0.1.0...v0.2.0)
|
12
|
+
|
3
13
|
## 0.1.0 2021-05-04
|
4
14
|
|
5
15
|
Initial release
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
<!--- this file is synced from dry-rb/template-gem project -->
|
1
2
|
[gem]: https://rubygems.org/gems/dry-files
|
2
3
|
[actions]: https://github.com/dry-rb/dry-files/actions
|
3
4
|
[codacy]: https://www.codacy.com/gh/dry-rb/dry-files
|
@@ -10,19 +11,19 @@
|
|
10
11
|
[![CI Status](https://github.com/dry-rb/dry-files/workflows/ci/badge.svg)][actions]
|
11
12
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/71200ee8d70b412c9e21c20b8b3b3688)][codacy]
|
12
13
|
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/71200ee8d70b412c9e21c20b8b3b3688)][codacy]
|
13
|
-
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-files.svg?branch=
|
14
|
+
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-files.svg?branch=main)][inchpages]
|
14
15
|
|
15
16
|
## Links
|
16
17
|
|
17
|
-
* [User documentation](
|
18
|
+
* [User documentation](https://dry-rb.org/gems/dry-files)
|
18
19
|
* [API documentation](http://rubydoc.info/gems/dry-files)
|
19
20
|
|
20
21
|
## Supported Ruby versions
|
21
22
|
|
22
23
|
This library officially supports the following Ruby versions:
|
23
24
|
|
24
|
-
* MRI
|
25
|
-
* jruby
|
25
|
+
* MRI `>= 2.7.0`
|
26
|
+
* jruby `>= 9.3` (postponed until 2.7 is supported)
|
26
27
|
|
27
28
|
## License
|
28
29
|
|
data/dry-files.gemspec
CHANGED
@@ -1,33 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# this file is managed by dry-rb/devtools project
|
3
2
|
|
4
|
-
|
3
|
+
# this file is synced from dry-rb/template-gem project
|
4
|
+
|
5
|
+
lib = File.expand_path("lib", __dir__)
|
5
6
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
-
require
|
7
|
+
require "dry/files/version"
|
7
8
|
|
8
9
|
Gem::Specification.new do |spec|
|
9
|
-
spec.name =
|
10
|
+
spec.name = "dry-files"
|
10
11
|
spec.authors = ["Luca Guidi"]
|
11
12
|
spec.email = ["me@lucaguidi.com"]
|
12
|
-
spec.license =
|
13
|
+
spec.license = "MIT"
|
13
14
|
spec.version = Dry::Files::VERSION.dup
|
14
15
|
|
15
16
|
spec.summary = "file utilities"
|
16
17
|
spec.description = spec.summary
|
17
|
-
spec.homepage =
|
18
|
+
spec.homepage = "https://dry-rb.org/gems/dry-files"
|
18
19
|
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-files.gemspec", "lib/**/*"]
|
19
|
-
spec.bindir =
|
20
|
+
spec.bindir = "bin"
|
20
21
|
spec.executables = []
|
21
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ["lib"]
|
22
23
|
|
23
|
-
spec.metadata[
|
24
|
-
spec.metadata[
|
25
|
-
spec.metadata[
|
26
|
-
spec.metadata[
|
24
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
25
|
+
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-files/blob/master/CHANGELOG.md"
|
26
|
+
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-files"
|
27
|
+
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-files/issues"
|
27
28
|
|
28
|
-
spec.required_ruby_version = ">= 2.
|
29
|
+
spec.required_ruby_version = ">= 2.7.0"
|
29
30
|
|
30
31
|
# to update dependencies edit project.yml
|
32
|
+
|
31
33
|
spec.add_development_dependency "rake", "~> 13.0"
|
32
34
|
spec.add_development_dependency "rspec", "~> 3.10"
|
33
35
|
spec.add_development_dependency "rubocop", "~> 1.12"
|
data/lib/dry/files/version.rb
CHANGED
data/lib/dry/files.rb
CHANGED
@@ -307,6 +307,7 @@ module Dry
|
|
307
307
|
# @api public
|
308
308
|
def append(path, contents)
|
309
309
|
mkdir_p(path)
|
310
|
+
touch(path)
|
310
311
|
|
311
312
|
content = adapter.readlines(path)
|
312
313
|
content << newline unless newline?(content.last)
|
@@ -788,7 +789,7 @@ module Dry
|
|
788
789
|
# @since 0.1.0
|
789
790
|
# @api private
|
790
791
|
def newline?(content)
|
791
|
-
content
|
792
|
+
content&.end_with?(NEW_LINE)
|
792
793
|
end
|
793
794
|
|
794
795
|
# @since 0.1.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements:
|
89
89
|
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 2.
|
91
|
+
version: 2.7.0
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|