dotter_dotfiles 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: b3256b80787b7b02945fff1db5d2fd45a0e3b8c1
4
- data.tar.gz: 8d04cbd1f070d83d568f7a80ec053fd5511ec8f8
3
+ metadata.gz: 8b17a9d1fd382da38a1e6c000f02952ff8c0f02e
4
+ data.tar.gz: 0ba2a8fb0d1fd3721c52941c16c43e3adf7a3768
5
5
  SHA512:
6
- metadata.gz: 9ce81490651bfc0e09bd428afdc61568f0576ddc9b502b0a294a0230ee258c56054bd43da60c20f19de60907759d9cd7b0e9cb50d3b50c43ad8587c877c866ba
7
- data.tar.gz: 500df8b98f9558054e4218c449158046fb38667d42c79a772a46d6947e2585ee036b242ea3950b265d8650481994cb72b3f0c01a0da07d604fb3948bd7a9b238
6
+ metadata.gz: e24cfb4e6218b046fcbf743bd28b0ea8dbe054b8939ac017542cd17bafde68b3c41f993a649a70edeed2d9dad505ced80ac1e95525f3cd19a5fca04e7dfbd768
7
+ data.tar.gz: 3af834b6a0aca7e304e50d911fd22673e8667b31db516e57aa49f56e706af498060b7480ada038959c94407b937d9449ddca4141062592f9e87af06dc144d555
data/ChangeLog.md CHANGED
@@ -1,4 +1,9 @@
1
- ### 0.1.0 / 2015-10-13
1
+ ### 0.2.0 / 2015-11-10
2
+ * Implemented the update_all command
3
+ * Minor internal refactoring
4
+ * When running the 'init' command, the Dotfile is automatically created.
5
+ * Directories are now created as-needed when importing.
2
6
 
7
+ ### 0.1.0 / 2015-10-31
3
8
  * Initial release:
4
9
 
data/README.md CHANGED
@@ -1,13 +1,21 @@
1
1
  # Dotter, a dotfiles manager using stow & git
2
2
 
3
+ [![Dependency Status](http://img.shields.io/gemnasium/samis/dotter.svg)](https://gemnasium.com/samis/dotter)
4
+ [![Code Climate](http://img.shields.io/codeclimate/github/samis/dotter.svg)](https://codeclimate.com/github/samis/dotter)
5
+ [![Gem Version](http://img.shields.io/gem/v/dotter_dotfiles.svg)](https://rubygems.org/gems/dotter_dotfiles)
6
+ ![](http://ruby-gem-downloads-badge.herokuapp.com/dotter_dotfiles)
7
+ [![License](http://img.shields.io/:license-mit-blue.svg)](http://samis.mit-license.org)
8
+ [![Badges](http://img.shields.io/:badges-5/5-ff6799.svg)](https://github.com/badges/badgerbadgerbadger)
9
+
10
+
3
11
  As the title explained, dotter is a tool to manage your dotfiles. It is written in ruby and uses the tools stow and git in order to manage your dotfiles effectively.
4
12
  It wraps around both tools in order to achieve easy and effective management of dotfiles. Stow handles the symlinking of them while Git tracks the history.
5
13
  It is very new, unfinished software that likely has multiple bugs. However, due to the specific tools used there is not too much risk with using it.
6
14
 
7
- It is not yet published to rubygems but you can install the required dependencies via bundler.
15
+ Due to the name 'dotter' already being used, the gem is available under the name 'dotter_dotfiles'. Install it with `gem install dotter_dotfiles`
8
16
 
9
17
  To see all available commands, use `dotter help`. Not all commands are currently implemented.
10
-
18
+ This project tries to follow [Semantic Versioning](http://semver.org/) but no guarantees are made in this regard.
11
19
  ## TODO
12
20
  1. Refactor and clean up the code.
13
21
  2. Implement all unimplemented commands.
data/dotter.gemspec CHANGED
@@ -33,6 +33,7 @@ Gem::Specification.new do |gem|
33
33
  gem.add_development_dependency 'rake', '~> 10.0'
34
34
  gem.add_development_dependency 'rdoc', '~> 4.0'
35
35
  gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
36
+ gem.add_development_dependency 'pry'
36
37
  gem.add_runtime_dependency 'thor'
37
38
  gem.add_runtime_dependency 'git'
38
39
  gem.add_runtime_dependency 'inifile'
data/lib/dotter/cli.rb CHANGED
@@ -24,18 +24,13 @@ class CLI < Thor
24
24
  puts "Creating an initial package for dotter."
25
25
  FileUtils.mkpath('dotter/.dotter/gitrepos')
26
26
  FileUtils.mkpath('dotter/.dotter/indexes/')
27
+ # If we don't do this now, we'll get a nasty exception if we ever access the configuration.
28
+ FIleUtils.touch('dotter/.dotter/Dotfile')
27
29
  end
28
30
  desc "list", "List all packages present in ~/dotfiles"
29
31
  def list
30
32
  puts "List of packages in ~/dotfiles"
31
- directory_name = dotfiles_path
32
- directory = Pathname.new(directory_name)
33
- directories = directory.children.select { |c| c.directory? }
34
- package_names = []
35
- directories.each do |directory|
36
- package_names.push(directory.basename)
37
- end
38
- package_names.each do |package|
33
+ all_package_names.each do |package|
39
34
  puts package
40
35
  end
41
36
  end
@@ -114,12 +109,22 @@ class CLI < Thor
114
109
  desc "update_all", "Updates all stowed packages."
115
110
  def update_all()
116
111
  puts "Updating all stowed packages"
112
+ all_packages = []
113
+ all_package_names.each do |package|
114
+ all_packages.push(Package.new(package.to_s))
115
+ end
116
+ stowed_packages = all_packages.select { |package| package.stowed? }
117
+ stowed_packages.each do |package|
118
+ puts "Updating #{package}"
119
+ package.update
120
+ end
117
121
  end
118
122
  desc "import PATH PACKAGE", "Imports a file or directory into the specified package"
119
123
  def import(path, package)
120
- puts "Importing #{path} into package {package}"
124
+ puts "Importing #{path} into package #{package}"
121
125
  filepath = Pathname.new(File.expand_path(path))
122
126
  packagepath = package_path(package)
127
+ if not Dir.exist?(packagepath.to_s) then FileUtils.mkpath(packagepath.to_s) end
123
128
  homepath = Pathname.new(File.expand_path('~'))
124
129
  relative_filepath = filepath.relative_path_from(homepath)
125
130
  complete_path = packagepath + relative_filepath
@@ -21,5 +21,14 @@
21
21
  def index_path(package)
22
22
  @@dotter_path + '.dotter/indexes/' + package
23
23
  end
24
+ def all_package_names
25
+ directory = Pathname.new(@@dotfiles_path)
26
+ directories = directory.children.select { |c| c.directory? }
27
+ package_names = []
28
+ directories.each do |directory|
29
+ package_names.push(directory.basename)
30
+ end
31
+ package_names
32
+ end
24
33
  end
25
34
  end
@@ -1,4 +1,4 @@
1
1
  module Dotter
2
2
  # dotter version
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
@@ -0,0 +1,23 @@
1
+ # Generated by gem2arch (https://github.com/anatol/gem2arch)
2
+ # Maintainer: Samuel Hodgkins <samuel.hodgkins@sky.com>
3
+
4
+ _gemname=dotter_dotfiles
5
+ pkgname=dotter
6
+ pkgver=0.1.0
7
+ pkgrel=1
8
+ pkgdesc='A dotfiles managaer'
9
+ arch=(any)
10
+ url='https://rubygems.org/gems/dotter_dotfiles'
11
+ license=(MIT)
12
+ depends=(ruby ruby-thor ruby-git ruby-inifile)
13
+ options=(!emptydirs)
14
+ source=(https://rubygems.org/downloads/$_gemname-$pkgver.gem)
15
+ noextract=($_gemname-$pkgver.gem)
16
+ sha1sums=('73bc455477700b91fb917d98a8d1a40b2980fad2')
17
+
18
+ package() {
19
+ local _gemdir="$(ruby -e'puts Gem.default_dir')"
20
+ gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" $_gemname-$pkgver.gem
21
+ rm "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem"
22
+ install -D -m644 "$pkgdir/$_gemdir/gems/$_gemname-$pkgver/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
23
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotter_dotfiles
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
  - Samuel Hodgkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-31 00:00:00.000000000 Z
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: thor
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -133,6 +147,7 @@ files:
133
147
  - lib/dotter/publicgitrepo.rb
134
148
  - lib/dotter/utilities.rb
135
149
  - lib/dotter/version.rb
150
+ - packaging/PKGBUILD
136
151
  homepage: https://rubygems.org/gems/dotter_dotfiles
137
152
  licenses:
138
153
  - MIT