flexdot 2.0.0 → 3.0.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: abd911eda16fc28b419271e8e75d96f33314f2cc73cc850180966c16cb7fca4f
4
- data.tar.gz: d3f84e097a314f4fc83772e5cc63874f2c3e0adf9658967b56269b52f3a284d2
3
+ metadata.gz: 48d7de6cd3258b46931514ab34fa84153a7a76f63b425a081cb2f422142b40c4
4
+ data.tar.gz: e4f4e78e06806b7cc5e0b916c43d1079c4c1bf05c1777996d969e909c8ae4d0b
5
5
  SHA512:
6
- metadata.gz: 844806f825d04329fc3fd63a893925e928075afc08c9d6bfcf262bb1b4dac0429edd0525cd68b7744e82dd08deccd10bc41f33e628bb72bb59a94448604b9505
7
- data.tar.gz: 0dbbd2c56ab172c289206fc8e480be8deef399e2f153213046a83e61497010e8652ce67844f88fade41b29c41a8e8be842e4b8ff3f693d4722e26d6937bd55cd
6
+ metadata.gz: c3a96c01c6878c0643e88240f48d5f82273c58d320beca92573fba885fef38aab776743e1cbaaa8a3a2af6ab29b8a8b9898a34b1ba3853d601ac9ecba47efca5
7
+ data.tar.gz: 2b2deae37d254ba1139553b679da60fa1186fa175adcc4cdfc760902fd666aadaab957533d47d2927584d16086ca10aa3c5c0bb5dacdee425f581fba43f78808
@@ -0,0 +1,16 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "daily"
12
+
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "daily"
@@ -7,20 +7,28 @@ jobs:
7
7
  test:
8
8
  name: Test on ruby ${{ matrix.ruby_version }}
9
9
  runs-on: ubuntu-latest
10
+ # Run this build only on either pull request or push.
11
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
12
+
10
13
  strategy:
11
14
  matrix:
12
15
  ruby_version:
13
- - 2.5.x
14
- - 2.6.x
15
- - 2.7.x
16
+ - 2.5
17
+ - 2.6
18
+ - 2.7
19
+ - 3.0
16
20
  steps:
17
- - uses: actions/checkout@v1
21
+ - uses: actions/checkout@v2
22
+
18
23
  - name: Set up Ruby ${{ matrix.ruby_version }}
19
- uses: actions/setup-ruby@v1
24
+ uses: ruby/setup-ruby@v1
20
25
  with:
21
26
  ruby-version: ${{ matrix.ruby_version }}
22
- - name: Build and test with Rake
27
+
28
+ - name: Install dependencies
23
29
  run: |
24
30
  gem install bundler
25
31
  bundle install --jobs 4 --retry 3
26
- bundle exec rake test
32
+
33
+ - name: Run tests
34
+ run: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,29 +1,68 @@
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
+
1
33
  ## 2.0.0
2
34
 
3
35
  ### Breaking Changes
4
36
 
5
- v1.0.x
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.
6
47
 
7
48
  ```ruby
8
- # Rakefile
49
+ # v1.0.x
9
50
  Flexdot.install_tasks(
10
51
  target_dir: '/home/username',
11
52
  base_dir: '.'
12
53
  )
13
54
  ```
14
55
 
15
- v2.0.0
16
-
17
56
  ```ruby
57
+ # v2.0.0
18
58
  Flexdot.setup(
19
59
  home_dir: '/home/username',
20
60
  dotfiles_dir: '.'
21
61
  )
22
62
  ```
23
63
 
24
- ### Enchancements
64
+ Note that If the `dotfiles_dir` option is `'.'` (current directory) , you can omit it.
25
65
 
26
- - Add default_index option fixes #2
27
- - Option renaming and simplification by default value
66
+ Then, update flexdot to v2.0.0 and you're done.
28
67
 
29
- Please refer to README.md for details.
68
+ $ bundle update flexdot
data/Gemfile CHANGED
@@ -4,4 +4,3 @@ gemspec
4
4
 
5
5
  gem 'rake', '>= 12.0'
6
6
  gem 'minitest', '~> 5.0'
7
- gem 'rr', '>= 1.2.1'
data/README.md CHANGED
@@ -47,17 +47,17 @@ Flexdot.setup(
47
47
  # (optional)
48
48
  # The dotfile directory path.
49
49
  # Default '.'.
50
- dotfiles_dir: '.',
51
-
52
- # (optional)
53
- # The `rake install` command will be available to install the dotfile for the specified index file.
54
- # Default nil.
55
- #
56
- # Note that the `rake install` command is always available if you have a single index file.
57
- default_index: 'name_of_an_index_file'
50
+ dotfiles_dir: '.'
58
51
  )
59
52
  ```
60
53
 
54
+ It is recommended that you add the Rakefile to `gitignore`:
55
+
56
+ ```
57
+ # .gitignore
58
+ Rakefile
59
+ ```
60
+
61
61
  Finally, run `rake -T` in the `$HOME/dotfiles` and make sure that the output is as follows:
62
62
 
63
63
  $ rake -T
@@ -124,9 +124,12 @@ $HOME/dotfiles
124
124
  require 'flexdot'
125
125
 
126
126
  Flexdot.setup(
127
- home_dir: '..',
128
- default_index: 'macOS'
127
+ home_dir: '..'
129
128
  )
129
+
130
+ # You can execute `install:macOS` when you run `rake` command
131
+ # with no arguments by defining it as follows:
132
+ task default: 'install:macOS'
130
133
  ```
131
134
 
132
135
  ### Available Commands
@@ -135,7 +138,6 @@ When you run the `rake -T` command in that directory structure, you should have
135
138
 
136
139
  $ rake -T
137
140
  rake clear_backups # Clear all backups
138
- rake install # Install dotfiles for macOS
139
141
  rake install:macOS # Install dotfiles for macOS
140
142
  rake install:ubuntu # Install dotfiles for ubuntu
141
143
 
@@ -211,11 +213,11 @@ ubuntu:
211
213
  stop.sh: .xkeysnail
212
214
  ```
213
215
 
214
- ### Installing dotfiles
216
+ ### Installing dotfiles for macOS
215
217
 
216
- $ rake install
218
+ $ rake
217
219
 
218
- Or
220
+ Or,
219
221
 
220
222
  $ rake install:macOS
221
223
 
data/lib/flexdot.rb CHANGED
@@ -4,7 +4,7 @@ require_relative 'flexdot/version'
4
4
  require_relative 'flexdot/tasks'
5
5
 
6
6
  module Flexdot
7
- def self.setup(home_dir:, dotfiles_dir: '.', default_index: nil)
8
- Tasks.new(dotfiles_dir, home_dir, default_index).install
7
+ def self.setup(home_dir:, dotfiles_dir: '.')
8
+ Tasks.new(dotfiles_dir, home_dir).install
9
9
  end
10
10
  end
data/lib/flexdot/tasks.rb CHANGED
@@ -10,8 +10,7 @@ module Flexdot
10
10
 
11
11
  Index = Struct.new(:filename, :name, keyword_init: true)
12
12
 
13
- def initialize(dotfiles_dir, home_dir, default_index_name = nil)
14
- @default_index_name = default_index_name
13
+ def initialize(dotfiles_dir, home_dir)
15
14
  @dotfiles_dir = Pathname.new(dotfiles_dir).expand_path
16
15
  @home_dir = Pathname.new(home_dir).expand_path
17
16
  end
@@ -35,31 +34,12 @@ module Flexdot
35
34
  end
36
35
  end
37
36
  end
38
-
39
- if default_index
40
- desc "Install dotfiles for #{default_index.name}"
41
- task :install do
42
- Rake::Task["install:#{default_index.name}"].invoke
43
- end
44
- end
45
37
  end
46
38
 
47
39
  private
48
40
 
49
41
  attr_reader :dotfiles_dir, :home_dir
50
42
 
51
- def default_index
52
- @default_index ||=
53
- if @default_index_name
54
- ifnone = -> { raise "#{@default_index_name} index is not found" }
55
- indexes.find(ifnone) { |index| index.name == @default_index_name }
56
- elsif indexes.size == 1
57
- indexes.first
58
- else
59
- nil
60
- end
61
- end
62
-
63
43
  def indexes
64
44
  @indexes ||= Pathname.new(dotfiles_dir).glob('*.yml').map do |index_file|
65
45
  Index.new(name: index_file.basename('.*').to_s, filename: index_file)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flexdot
4
- VERSION = '2.0.0'
4
+ VERSION = '3.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexdot
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuya Hidaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-28 00:00:00.000000000 Z
11
+ date: 2021-04-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Flexdot is a Flexible and Rake based dotfile manager
14
14
  email:
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".github/FUNDING.yml"
21
+ - ".github/dependabot.yml"
21
22
  - ".github/workflows/test.yml"
22
23
  - ".gitignore"
23
24
  - CHANGELOG.md
@@ -53,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
54
  - !ruby/object:Gem::Version
54
55
  version: '0'
55
56
  requirements: []
56
- rubygems_version: 3.1.2
57
+ rubygems_version: 3.1.4
57
58
  signing_key:
58
59
  specification_version: 4
59
60
  summary: A Flexible and Rake based dotfile manager