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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d22584a76b85c83b8d1d50e0b805335347f205f7ac7da1ea31dd538a5b459fd
4
- data.tar.gz: 4054a4f0bf0daa95cc3e23937d5acb9726606cf7974159146cd21787a186549b
3
+ metadata.gz: 3b04750013e1faf98db463c2c346a5f43ed63f3dca9053a881082b02ac4c6e2a
4
+ data.tar.gz: 1c3162ad5c735483ac4fbac02b588e111e55f92698682807dad68bf12503906a
5
5
  SHA512:
6
- metadata.gz: d7881004a31c1106fb0a42b11015169fe1deac588aa1609ab3dd13c28c945f83cea7b722fb43250de665d862ec27f8f76071f88eac3b1567b2ea95a201cb8a4d
7
- data.tar.gz: 3d2c8d0f875b00e889d0020a5023443b686529548bf1b28ca5007085bd88d4581affc6ad1a2d5319f861dfc768cef8e486f45959204478f05670121a239db124
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=master)][inchpages]
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](http://dry-rb.org/gems/dry-files)
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 >= `2.5`
25
- * jruby >= `9.2`
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
- lib = File.expand_path('lib', __dir__)
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 'dry/files/version'
7
+ require "dry/files/version"
7
8
 
8
9
  Gem::Specification.new do |spec|
9
- spec.name = 'dry-files'
10
+ spec.name = "dry-files"
10
11
  spec.authors = ["Luca Guidi"]
11
12
  spec.email = ["me@lucaguidi.com"]
12
- spec.license = 'MIT'
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 = 'https://dry-rb.org/gems/dry-files'
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 = 'bin'
20
+ spec.bindir = "bin"
20
21
  spec.executables = []
21
- spec.require_paths = ['lib']
22
+ spec.require_paths = ["lib"]
22
23
 
23
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
24
- spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-files/blob/master/CHANGELOG.md'
25
- spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-files'
26
- spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-files/issues'
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.5.0"
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"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  class Files
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
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.end_with?(NEW_LINE)
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.1.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: 2021-05-04 00:00:00.000000000 Z
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.5.0
91
+ version: 2.7.0
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="