kyrbeis 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/kyrbeis +11 -4
  3. metadata +7 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f156b76a549c83b897a8431b1c83f6294c71073f9cb1367ae01defdb6eced4b
4
- data.tar.gz: 281be40ad0a73ce393826894df38ca1d88ba3487e7c24e4441cec9699a3eef2f
3
+ metadata.gz: 57b1c6c1c18244cd715761aab7288a6af1a3ea06e1ff6295c0492deaec95c4ac
4
+ data.tar.gz: ceaf478905a10e6ffd60155dae13281711cf9fb5a1fa217264a44cea72986ad0
5
5
  SHA512:
6
- metadata.gz: 4a592073348cd3afbcfb0e405ff0c82c8c33079429a94c4bcb4ee42abd66c62a9a030328cfe55462f6daecacbbc6c396087744f4f92d23c137f84cdccc571c3c
7
- data.tar.gz: 6d9ff21a543e615efd430590ad646c9b7cb5845b9aa2f1733ba36d221b8c0e1042c6c9045afe11686fe50385f00a0a11c545866ce1d14660e94f83cf2901a5c5
6
+ metadata.gz: 8516120091add7a651d57dd2afc39d00b91fd9ec20bb0ba11f4ab9bbcf2203e792aeeb5e97f7ce5287a31b2c92f5fe82a4aa62a16166605624fa6e456fe09225
7
+ data.tar.gz: 48a516232e48c4198e4aa6b90d9972044ea665d131ed4a461022b8030fbfae28d66bee8bd9011e26331fdc7a0c5ff335c55f7fbcdd3c1647d9166cc7d4016936
data/bin/kyrbeis CHANGED
@@ -1,18 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'fileutils'
3
+ require 'erb'
3
4
  repo="#{ENV['HOME']}/dotfiles"
4
5
  Dir.chdir(repo) do
5
6
  Dir.glob("**/*").select { |f| File.file? f }.each do |path|
6
7
  dotted_path = path.gsub "__", "."
7
- destination = File.join(ENV['HOME'], dotted_path)
8
- if File.exists? destination
8
+ erb = path.end_with?(".erb")
9
+ destination = File.join(ENV['HOME'], dotted_path).gsub(/\.erb$/, "")
10
+ if not erb and File.exist? destination
9
11
  if not File.symlink? destination
10
12
  puts "WARNING #{destination} already exists and is not a symlink"
11
13
  end
12
14
  else
13
15
  FileUtils.mkdir_p File.join(File.dirname(destination))
14
- File.symlink File.join(repo, path), destination
15
- puts "INFO linked #{destination}"
16
+ if erb
17
+ File.write destination, ERB.new(File.read(path)).result(binding)
18
+ puts "INFO wrote #{destination} from ERB"
19
+ else
20
+ File.symlink File.join(repo, path), destination
21
+ puts "INFO linked #{destination}"
22
+ end
16
23
  end
17
24
  end
18
25
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kyrbeis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Abdesselam
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-04 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Allows to manage your dotfiles in a centralized fashion
14
- email:
14
+ email:
15
15
  executables:
16
16
  - kyrbeis
17
17
  extensions: []
@@ -22,7 +22,7 @@ homepage: http://rubygems.org/gems/kyrbeis
22
22
  licenses:
23
23
  - MIT
24
24
  metadata: {}
25
- post_install_message:
25
+ post_install_message:
26
26
  rdoc_options: []
27
27
  require_paths:
28
28
  - lib
@@ -37,9 +37,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  requirements: []
40
- rubyforge_project:
41
- rubygems_version: 2.7.6.2
42
- signing_key:
40
+ rubygems_version: 3.4.19
41
+ signing_key:
43
42
  specification_version: 4
44
43
  summary: dotfiles management
45
44
  test_files: []