flexdot 3.0.0 → 3.1.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: 48d7de6cd3258b46931514ab34fa84153a7a76f63b425a081cb2f422142b40c4
4
- data.tar.gz: e4f4e78e06806b7cc5e0b916c43d1079c4c1bf05c1777996d969e909c8ae4d0b
3
+ metadata.gz: 5d1b112b651204f8ce82ddad718e2b6673e7c0d898704b7e43aea5328040c869
4
+ data.tar.gz: 917fb9ffe2100da70b42dc5f96666104bea4f603aa71026e2aaaa497f5e220e5
5
5
  SHA512:
6
- metadata.gz: c3a96c01c6878c0643e88240f48d5f82273c58d320beca92573fba885fef38aab776743e1cbaaa8a3a2af6ab29b8a8b9898a34b1ba3853d601ac9ecba47efca5
7
- data.tar.gz: 2b2deae37d254ba1139553b679da60fa1186fa175adcc4cdfc760902fd666aadaab957533d47d2927584d16086ca10aa3c5c0bb5dacdee425f581fba43f78808
6
+ metadata.gz: 9718bc11bcc0181d8803b91fc62f54d515cdb52b49aa8629239ffe841eac8f7edc867bcbaae547648c1ffbe3a0f2334628eabc3cd40c8c4e71b03c4e56c8a1a3
7
+ data.tar.gz: '08e880cd0f2e81ad725b2057dcfb50fac18a6c1fa93b72e41d6f453a1d33883b3fcb25d68252f187f6fbaa966640c2dfac2b044f52a677dc8f045f609bfa7d2b'
@@ -9,8 +9,3 @@ updates:
9
9
  directory: "/"
10
10
  schedule:
11
11
  interval: "daily"
12
-
13
- - package-ecosystem: "github-actions"
14
- directory: "/"
15
- schedule:
16
- interval: "daily"
@@ -13,7 +13,6 @@ jobs:
13
13
  strategy:
14
14
  matrix:
15
15
  ruby_version:
16
- - 2.5
17
16
  - 2.6
18
17
  - 2.7
19
18
  - 3.0
data/CHANGELOG.md CHANGED
@@ -1,68 +1 @@
1
- ## 3.0.0
2
-
3
- ### Breaking Changes
4
-
5
- Revert 'Add default_index option #2'. Please follow the instructions below to migrate:
6
-
7
- First, modify your Rakefile as follows:
8
-
9
- ```diff
10
- require 'flexdot'
11
-
12
- Flexdot.setup(
13
- + home_dir: '..'
14
- - home_dir: '..',
15
- - default_index: 'macOS'
16
- )
17
-
18
- + task default: 'install:macOS'
19
- ```
20
-
21
- Then, update flexdot:
22
-
23
- ```
24
- $ bundle update flexdot
25
- ```
26
-
27
- Now you can run the following command to install the default index dotfiles:
28
-
29
- ```
30
- $ rake
31
- ```
32
-
33
- ## 2.0.0
34
-
35
- ### Breaking Changes
36
-
37
- - Change the syntax of configuration in the `Rakefile`
38
-
39
- ### Enchancements
40
-
41
- - Add `default_index` option fixes #2
42
- - Option renaming and simplification by default value
43
-
44
- ### Migrating from v1.0.x
45
-
46
- First, you need to rewrite the `Rakefile` configuration to the v2.0.0 syntax.
47
-
48
- ```ruby
49
- # v1.0.x
50
- Flexdot.install_tasks(
51
- target_dir: '/home/username',
52
- base_dir: '.'
53
- )
54
- ```
55
-
56
- ```ruby
57
- # v2.0.0
58
- Flexdot.setup(
59
- home_dir: '/home/username',
60
- dotfiles_dir: '.'
61
- )
62
- ```
63
-
64
- Note that If the `dotfiles_dir` option is `'.'` (current directory) , you can omit it.
65
-
66
- Then, update flexdot to v2.0.0 and you're done.
67
-
68
- $ bundle update flexdot
1
+ Please see [the release page](https://github.com/hidakatsuya/flexdot/releases).
data/Gemfile CHANGED
@@ -2,5 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rake', '>= 12.0'
6
5
  gem 'minitest', '~> 5.0'
data/README.md CHANGED
@@ -9,7 +9,7 @@ A Flexible and Rake based dotfile manager.
9
9
 
10
10
  ### Prerequisite
11
11
 
12
- Ruby 2.5+
12
+ Ruby 2.6+
13
13
 
14
14
  ### Installing
15
15
 
data/flexdot.gemspec CHANGED
@@ -10,10 +10,12 @@ Gem::Specification.new do |spec|
10
10
  spec.description = 'Flexdot is a Flexible and Rake based dotfile manager'
11
11
  spec.homepage = 'https://github.com/hidakatsuya/flexdot'
12
12
  spec.license = 'MIT'
13
- spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
14
14
 
15
15
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
16
16
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test)/}) }
17
17
  end
18
18
  spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'rake', '>= 12.0'
19
21
  end
data/lib/flexdot.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rake'
4
+
3
5
  require_relative 'flexdot/version'
4
6
  require_relative 'flexdot/tasks'
5
7
 
@@ -7,6 +7,8 @@ module Flexdot
7
7
  class Backup
8
8
  BASE_DIR = 'backup'
9
9
 
10
+ class AlreadyFinishedError < StandardError; end
11
+
10
12
  class << self
11
13
  def clear_all
12
14
  base_dir.glob('*').each(&:rmtree)
@@ -19,12 +21,19 @@ module Flexdot
19
21
 
20
22
  def initialize
21
23
  backup_dir.mkpath unless backup_dir.exist?
24
+ @finished = false
22
25
  end
23
26
 
24
27
  def call(file)
28
+ raise AlreadyFinishedError if @finished
25
29
  FileUtils.mv(file, backup_dir)
26
30
  end
27
31
 
32
+ def finish!
33
+ backup_dir.delete if backup_dir.empty?
34
+ @finished = true
35
+ end
36
+
28
37
  private
29
38
 
30
39
  def backup_dir
@@ -21,6 +21,8 @@ module Flexdot
21
21
  index.each do |dotfile_path:, home_file_path:|
22
22
  install_link(dotfile_path, home_file_path)
23
23
  end
24
+
25
+ backup.finish!
24
26
  end
25
27
 
26
28
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flexdot
4
- VERSION = '3.0.0'
4
+ VERSION = '3.1.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexdot
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuya Hidaka
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-11 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-07-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '12.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '12.0'
13
27
  description: Flexdot is a Flexible and Rake based dotfile manager
14
28
  email:
15
29
  - hidakatsuya@gmail.com
@@ -17,7 +31,6 @@ executables: []
17
31
  extensions: []
18
32
  extra_rdoc_files: []
19
33
  files:
20
- - ".github/FUNDING.yml"
21
34
  - ".github/dependabot.yml"
22
35
  - ".github/workflows/test.yml"
23
36
  - ".gitignore"
@@ -39,7 +52,7 @@ homepage: https://github.com/hidakatsuya/flexdot
39
52
  licenses:
40
53
  - MIT
41
54
  metadata: {}
42
- post_install_message:
55
+ post_install_message:
43
56
  rdoc_options: []
44
57
  require_paths:
45
58
  - lib
@@ -47,15 +60,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
47
60
  requirements:
48
61
  - - ">="
49
62
  - !ruby/object:Gem::Version
50
- version: 2.5.0
63
+ version: 2.6.0
51
64
  required_rubygems_version: !ruby/object:Gem::Requirement
52
65
  requirements:
53
66
  - - ">="
54
67
  - !ruby/object:Gem::Version
55
68
  version: '0'
56
69
  requirements: []
57
- rubygems_version: 3.1.4
58
- signing_key:
70
+ rubygems_version: 3.2.22
71
+ signing_key:
59
72
  specification_version: 4
60
73
  summary: A Flexible and Rake based dotfile manager
61
74
  test_files: []
data/.github/FUNDING.yml DELETED
@@ -1,3 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: [hidakatsuya]