dotman-bin 1.0.0 → 1.0.5

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: 0e297c042d8398cb7b9602acae6f11a8caebab8687319e365326580ec1caaa50
4
- data.tar.gz: c73c57f74294fe4e63e5ab5904f68e8e5ba79016d896ed9432a1ae77bfbca37a
3
+ metadata.gz: b6c7ff44792f4270a86feb267f67d9b9292124f5b2d4db7bf52747735bb66ad4
4
+ data.tar.gz: 30f465727b9f987ace5cb42919a22ac7d553a5ae7d00ccd5626faeb8d3fdcbad
5
5
  SHA512:
6
- metadata.gz: 45e98e9c493425fa1369eeaf3a67e6e322e97bb9a0c99c2de94a1435fcced7da42f4fb4eda4ad180915cf8ba96ad3cbdcaff42f05534731625012281cc24f878
7
- data.tar.gz: a7e54d5d57993014b7065192565acd16e499c67cce3e8ebf96b3bb106ab00ee0c0b62e7a7778c6ce6aa4971421a05071a378ebcc2b2775d49b805f2bb72389c4
6
+ metadata.gz: b4d49bc909b0711a2dbf6df95e5e6c9ef524ddb1e889b851f25ef1f029817831c218a2549b89f1ad695a8bb570135b702c74335e9ce30c88e027f54c103a1b6f
7
+ data.tar.gz: d7b4e6db489e6721c803bed242a478b563ad60fa79ee50a5c70cc694df41c23f9892e40099dcf3817d40d24766b1eae7ac7d10550744dbd82644cabd84da0170
data/bin/dotman CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require_relative '../lib/dotman'
4
3
  include Dotman
5
4
 
@@ -17,8 +16,8 @@ class Main
17
16
  end
18
17
 
19
18
  env = {
20
- base: File.expand_path(opts['--base']),
21
- home: File.expand_path(opts['--home'])
19
+ base: opts['--base'],
20
+ home: opts['--home']
22
21
  }
23
22
 
24
23
  puts Dotfile.to_script(env)
@@ -26,19 +25,19 @@ class Main
26
25
  end
27
26
 
28
27
  docs = <<~EOF
29
- Usage:
28
+ #{'Usage:'.bold}
30
29
  dotman [options] build
31
30
 
32
- Options:
33
- --base=BASE Dir from where symlinks should be sourced [default: ~/.dotfiles/files]
34
- --home=HOME Dir where symlinks should be placed [default: ~]
31
+ #{'Options:'.bold}
32
+ --base=BASE Dir from where symlinks should be sourced [default: $HOME/.dotfiles/files]
33
+ --home=HOME Dir where symlinks should be placed [default: $HOME]
34
+ -v, --version Show version
35
+ -h, --help Show this help
35
36
  EOF
36
37
 
37
38
  begin
38
- opts = Docopt::docopt(docs)
39
+ Main.run(Docopt::docopt(docs, version: VERSION))
39
40
  rescue Docopt::Exit => e
40
41
  puts e.message
41
42
  exit 1
42
43
  end
43
-
44
- Main.run(opts)
@@ -1,13 +1,15 @@
1
- Dir.chdir __dir__ do
2
- require 'bundler/setup'
3
- require 'require_all'
4
- require 'colorize'
5
- require 'docopt'
1
+ require 'require_all'
2
+ require 'colorize'
3
+ require 'docopt'
6
4
 
7
- require 'shellwords'
8
- require 'ostruct'
9
- require 'socket'
5
+ require 'shellwords'
6
+ require 'ostruct'
7
+ require 'socket'
8
+
9
+ module Dotman
10
+ def self.root_dir
11
+ File.expand_path('../..', __FILE__)
12
+ end
10
13
  end
11
14
 
12
- module Dotman; end
13
15
  require_rel 'dotman'
@@ -25,10 +25,17 @@ module Dotman::Action
25
25
  end
26
26
 
27
27
  def create_link
28
- Shell.block([
28
+ block = [
29
29
  Shell.command('ln -s "$BASE_DIR/%s" "$HOME_DIR/%s"' % pair),
30
30
  Shell.echo(:yellow, 'Link $BASE_DIR/%s → $HOME_DIR/%s created' % pair),
31
- ])
31
+ ]
32
+
33
+ dirname = File.dirname(pair[1])
34
+ if dirname != '.'
35
+ block.prepend Shell.command('mkdir --parents $HOME_DIR/%s' % dirname)
36
+ end
37
+
38
+ Shell.block(block)
32
39
  end
33
40
 
34
41
  def link_is_set_up
@@ -23,7 +23,7 @@ module Dotman
23
23
  end
24
24
 
25
25
  def satisfies_args(args)
26
- Shell.satisfies_args(@host_aliases, args)
26
+ Shell.satisfies_args(@host_aliases, **args)
27
27
  end
28
28
 
29
29
  def actions
@@ -1,3 +1,3 @@
1
1
  module Dotman
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotman-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - crdx
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-19 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: require_all
@@ -94,8 +94,8 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '12.3'
97
- description:
98
- email:
97
+ description:
98
+ email:
99
99
  executables:
100
100
  - dotman
101
101
  extensions: []
@@ -119,7 +119,7 @@ homepage: https://github.com/crdx/dotman
119
119
  licenses:
120
120
  - MIT
121
121
  metadata: {}
122
- post_install_message:
122
+ post_install_message:
123
123
  rdoc_options: []
124
124
  require_paths:
125
125
  - lib
@@ -134,8 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.0.6
138
- signing_key:
137
+ rubygems_version: 3.1.4
138
+ signing_key:
139
139
  specification_version: 4
140
- summary: Run many commands dotman with a colourful overview
140
+ summary: Manage dotfiles
141
141
  test_files: []