dotman 0.0.3.3 → 0.0.3.4
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 +4 -4
- data/.travis.yml +7 -0
- data/README.md +6 -3
- data/bin/dot +4 -9
- data/lib/dotman.rb +2 -0
- data/lib/dotman/collect.rb +2 -2
- data/lib/dotman/dotfile_collection.rb +10 -4
- data/lib/dotman/git.rb +1 -1
- data/lib/dotman/notification.rb +35 -0
- data/lib/dotman/version.rb +1 -1
- data/spec/dotman/collect_spec.rb +8 -3
- data/spec/integration/dotfile_collection_integration_spec.rb +29 -1
- data/spec/integration/user_integration_spec.rb +1 -1
- data/spec/spec_helper.rb +23 -2
- metadata +4 -60
- data/spec/data/Timbinous_dotfiles/.bashrc +0 -121
- data/spec/data/Timbinous_dotfiles/.gitignore +0 -5
- data/spec/data/Timbinous_dotfiles/.tmux.conf +0 -15
- data/spec/data/Timbinous_dotfiles/.vim/autoload/pathogen.vim +0 -245
- data/spec/data/Timbinous_dotfiles/.vim/bundle/.gitkeep +0 -0
- data/spec/data/Timbinous_dotfiles/.vim/colors/Black.vim +0 -16
- data/spec/data/Timbinous_dotfiles/.vim/colors/Dark.vim +0 -63
- data/spec/data/Timbinous_dotfiles/.vim/colors/autumnleaf.vim +0 -154
- data/spec/data/Timbinous_dotfiles/.vim/colors/c.vim +0 -32
- data/spec/data/Timbinous_dotfiles/.vim/colors/darkzen.vim +0 -25
- data/spec/data/Timbinous_dotfiles/.vim/colors/grb.vim +0 -13
- data/spec/data/Timbinous_dotfiles/.vim/colors/grb.vim~ +0 -13
- data/spec/data/Timbinous_dotfiles/.vim/colors/grb2.vim +0 -59
- data/spec/data/Timbinous_dotfiles/.vim/colors/grb256.vim +0 -32
- data/spec/data/Timbinous_dotfiles/.vim/colors/grb3.vim +0 -23
- data/spec/data/Timbinous_dotfiles/.vim/colors/grb4.vim +0 -17
- data/spec/data/Timbinous_dotfiles/.vim/colors/grblight.vim +0 -15
- data/spec/data/Timbinous_dotfiles/.vim/colors/grblight.vim~ +0 -14
- data/spec/data/Timbinous_dotfiles/.vim/colors/ir_black.vim +0 -212
- data/spec/data/Timbinous_dotfiles/.vim/colors/moria.vim +0 -227
- data/spec/data/Timbinous_dotfiles/.vim/colors/pyte.vim +0 -92
- data/spec/data/Timbinous_dotfiles/.vim/colors/redstring.vim +0 -26
- data/spec/data/Timbinous_dotfiles/.vim/colors/xterm16.vim +0 -811
- data/spec/data/Timbinous_dotfiles/.vim/spell/en.utf-8.add +0 -5
- data/spec/data/Timbinous_dotfiles/.vim/spell/en.utf-8.add.spl +0 -0
- data/spec/data/Timbinous_dotfiles/.vimrc +0 -70
- data/spec/data/Timbinous_dotfiles/.zshrc +0 -62
- data/spec/data/Timbinous_dotfiles/symlinkify +0 -58
- data/spec/data/Timbinous_dotfiles/tim.zsh-theme +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdba5f26889fa15fafb597bdaa574365e4312b63
|
4
|
+
data.tar.gz: 7f19a42240c7ad4d216e91e61a19e4a1c2e53bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cd7340dd7dfa9bccdbdb9ec818eef671b79b40551aca2b39be326a4edef705b1743f27fe5227085fd0c46c255816e02718da1da80f0773e6da45c55c6d55f3f
|
7
|
+
data.tar.gz: 2325f45fa7f4b1b8489bbc43dfcfe166534c3b721d56625186fd4857d7c0af94b442145843145f7e0ba6b08b7f91636f00f1fd9a6ec43a572059c66c79febcc7
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
# Dotman
|
2
|
-
|
1
|
+
# Dotman [](http://travis-ci.org/Timbinous/dotman?branch=master)
|
3
2
|
This gem allows you to switch between different dotfiles on the same user account.
|
4
3
|
|
5
4
|
## Requirements
|
6
5
|
|
7
|
-
ruby 1.9
|
6
|
+
ruby 1.9, 2.0
|
8
7
|
|
9
8
|
## Installation
|
10
9
|
|
@@ -46,6 +45,10 @@ To revert dotfiles back to original state:
|
|
46
45
|
|
47
46
|
dot use default
|
48
47
|
|
48
|
+
To delete dotfiles collection:
|
49
|
+
|
50
|
+
dot delete <alias>
|
51
|
+
|
49
52
|
To create a new dotfiles directory with all current dotfiles located in the HOME directory:
|
50
53
|
|
51
54
|
dot collect
|
data/bin/dot
CHANGED
@@ -13,7 +13,9 @@ when 'use'
|
|
13
13
|
when 'collect'
|
14
14
|
Dotman::Collect.new.create_dotman
|
15
15
|
when 'list'
|
16
|
-
Dotman::
|
16
|
+
Dotman::Notification.display_all_aliases
|
17
|
+
when 'delete'
|
18
|
+
Dotman::DotfileCollection.delete(ARGV[1])
|
17
19
|
when 'alias'
|
18
20
|
if ARGV[1] == 'rename'
|
19
21
|
Dotman::DotfileCollection.change_alias(ARGV[2], ARGV[3])
|
@@ -21,12 +23,5 @@ when 'alias'
|
|
21
23
|
Dotman::DotfileCollection.show_all_aliases
|
22
24
|
end
|
23
25
|
else
|
24
|
-
|
25
|
-
dot clone <git_repository> <alias> : clone the dotfiles repo\n
|
26
|
-
dot use <alias> : use the dotfiles\n
|
27
|
-
dot list : lists all downloaded dotfile aliases\n
|
28
|
-
dot use default : switch to the default dot files\n
|
29
|
-
dot collect : collects all dot files within a directory called dotfiles\n
|
30
|
-
dot alias rename <old alias> <new alias> : changes alias from old to new\n
|
31
|
-
dot alias list : same as dot list"
|
26
|
+
Dotman::Notification.show_help
|
32
27
|
end
|
data/lib/dotman.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'yaml'
|
2
3
|
require "dotman/version"
|
3
4
|
require "dotman/base"
|
4
5
|
Dotman::Base.ensure_dotman_folder_exists
|
@@ -8,3 +9,4 @@ require "dotman/git"
|
|
8
9
|
require "dotman/dotfile_collection"
|
9
10
|
require "dotman/user"
|
10
11
|
require "dotman/collect"
|
12
|
+
require "dotman/notification"
|
data/lib/dotman/collect.rb
CHANGED
@@ -9,7 +9,7 @@ module Dotman
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def collect_dotfiles
|
12
|
-
|
12
|
+
Dotman::Notification.collecting
|
13
13
|
Dir.entries("#{ENV['HOME']}").each do |file|
|
14
14
|
if file =~ /^.{1}[a-zA-Z1-9]+\z/
|
15
15
|
copy_over_dot file
|
@@ -19,8 +19,8 @@ module Dotman
|
|
19
19
|
|
20
20
|
def copy_over_dot file
|
21
21
|
if !File.directory?("#{ENV['HOME']}/#{file}")
|
22
|
-
puts "copying #{file} to dotfiles"
|
23
22
|
FileUtils.copy "#{ENV['HOME']}/#{file}", "#{ENV['HOME']}/dotfiles"
|
23
|
+
Dotman::Notification.copying_to_dotfiles(file)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -10,6 +10,16 @@ DOTFILES_PATH = "#{ENV['HOME']}/.dotman/dotfiles.yml"
|
|
10
10
|
|
11
11
|
attr_accessor :yaml
|
12
12
|
|
13
|
+
def self.delete(alias_name)
|
14
|
+
if dotfiles_yaml[alias_name] && dotfiles_yaml[alias_name]['folder_name']
|
15
|
+
FileUtils.rm_rf(File.join(Dotman::Base.dotman_folder, dotfiles_yaml[alias_name]['folder_name']))
|
16
|
+
dotfiles_yaml.delete(alias_name)
|
17
|
+
save_dotfile_yaml
|
18
|
+
else
|
19
|
+
Dotman::Notification.dotfile_collection_not_found(alias_name)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
def self.dotfiles_yaml
|
14
24
|
@dotfiles_yaml ||= File.exist?(DOTFILES_PATH) ? YAML::load_file(DOTFILES_PATH) : Hash.new
|
15
25
|
end
|
@@ -32,10 +42,6 @@ DOTFILES_PATH = "#{ENV['HOME']}/.dotman/dotfiles.yml"
|
|
32
42
|
dotfiles_yaml.collect {|dfy| dfy.first }
|
33
43
|
end
|
34
44
|
|
35
|
-
def self.show_all_aliases
|
36
|
-
STDOUT.puts all_aliases.join("\n")
|
37
|
-
end
|
38
|
-
|
39
45
|
def self.change_alias(old_alias, new_alias)
|
40
46
|
dotfiles_yaml[new_alias] = dotfiles_yaml[old_alias]
|
41
47
|
dotfiles_yaml.delete(old_alias)
|
data/lib/dotman/git.rb
CHANGED
@@ -16,7 +16,7 @@ module Dotman
|
|
16
16
|
def self.clone_repository(git_location, alias_name = nil)
|
17
17
|
dotfile_location = "#{ENV['HOME']}/.dotman/#{folder_name(git_location)}"
|
18
18
|
if (File.directory?(dotfile_location))
|
19
|
-
|
19
|
+
Dotman::Notification.already_cloned
|
20
20
|
else
|
21
21
|
system "git clone #{git_location} #{dotfile_location}"
|
22
22
|
Dotman::DotfileCollection.new_configuration(folder_name(git_location), alias_name)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Dotman
|
2
|
+
class Notification
|
3
|
+
def self.show_help
|
4
|
+
STDOUT.puts "USAGE:
|
5
|
+
dot clone <git_repository> <alias> : clone the dotfiles repo
|
6
|
+
dot use <alias> : use the dotfiles
|
7
|
+
dot list : lists all downloaded dotfile aliases
|
8
|
+
dot use default : switch to the default dot files
|
9
|
+
dot delete <alias> : delete dotfile collection
|
10
|
+
dot collect : collects all dot files within a directory called dotfiles
|
11
|
+
dot alias rename <old alias> <new alias> : changes alias from old to new
|
12
|
+
dot alias list : same as dot list"
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.already_cloned
|
16
|
+
STDOUT.puts "Dotfiles were already cloned"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.collecting
|
20
|
+
STDOUT.puts "collecting..."
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.copying_to_dotfiles(file)
|
24
|
+
STDOUT.puts "copied #{file} to dotfiles"
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.display_all_aliases
|
28
|
+
STDOUT.puts Dotman::DotfileCollection.all_aliases.join("\n")
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.dotfile_collection_not_found(alias_name)
|
32
|
+
STDOUT.puts "Dotfile collection not found for #{alias_name}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/dotman/version.rb
CHANGED
data/spec/dotman/collect_spec.rb
CHANGED
@@ -4,6 +4,11 @@ describe Dotman::Collect do
|
|
4
4
|
|
5
5
|
let(:collect) { Dotman::Collect.new }
|
6
6
|
|
7
|
+
before :each do
|
8
|
+
Dotman::Notification.stub(:collecting)
|
9
|
+
Dotman::Notification.stub(:copying_to_dotfiles)
|
10
|
+
end
|
11
|
+
|
7
12
|
context '#create_dotman' do
|
8
13
|
|
9
14
|
it 'should check for dotfiles directory and not create if exists' do
|
@@ -12,7 +17,7 @@ describe Dotman::Collect do
|
|
12
17
|
collect.create_dotman
|
13
18
|
end
|
14
19
|
|
15
|
-
|
20
|
+
it 'should check for dotfiles directory and create if does not exist' do
|
16
21
|
File.stub(:directory?).and_return(false)
|
17
22
|
FileUtils.should_receive(:mkdir)
|
18
23
|
collect.create_dotman
|
@@ -36,7 +41,7 @@ describe Dotman::Collect do
|
|
36
41
|
|
37
42
|
it 'should print collecting for script status' do
|
38
43
|
collect.stub(:copy_over_dot)
|
39
|
-
|
44
|
+
Dotman::Notification.should_receive(:collecting)
|
40
45
|
collect.collect_dotfiles
|
41
46
|
end
|
42
47
|
end
|
@@ -49,7 +54,7 @@ describe Dotman::Collect do
|
|
49
54
|
end
|
50
55
|
|
51
56
|
it 'should print out file being copied for user' do
|
52
|
-
|
57
|
+
Dotman::Notification.should_receive(:copying_to_dotfiles).with("#{File.join(ENV['HOME'], '.dotman')}")
|
53
58
|
FileUtils.stub(:copy)
|
54
59
|
collect.copy_over_dot(File.join(ENV['HOME'], '.dotman'))
|
55
60
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
describe Dotman::DotfileCollection do
|
3
3
|
before :each do
|
4
|
+
Dotman::Base.ensure_dotman_folder_exists
|
4
5
|
Dotman::Git.clone_repository('git@github.com:Timbinous/dotfiles.git', 'tim')
|
6
|
+
Dotman::Notification.stub(:already_cloned)
|
5
7
|
end
|
6
8
|
|
7
9
|
describe ".find_by_alias" do
|
@@ -12,6 +14,32 @@ describe Dotman::DotfileCollection do
|
|
12
14
|
|
13
15
|
it "returns the dotfile collection" do
|
14
16
|
Dotman::DotfileCollection.find_by_alias(alias_name).should be_an_instance_of(Dotman::DotfileCollection)
|
17
|
+
File.directory?(File.join(Dotman::Base.dotman_folder, 'Timbinous_dotfiles')).should be_true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe ".delete" do
|
23
|
+
before :each do
|
24
|
+
Dotman::Git.clone_repository('git@github.com:Timbinous/dotfiles.git', 'tim')
|
25
|
+
end
|
26
|
+
|
27
|
+
context "when dotfile exists" do
|
28
|
+
it "deletes the dotfile folder" do
|
29
|
+
Dotman::DotfileCollection.delete('tim')
|
30
|
+
File.directory?(File.join(Dotman::Base.dotman_folder, 'Timbinous_dotfiles')).should be_false
|
31
|
+
end
|
32
|
+
|
33
|
+
it "removes the alias from the yaml file" do
|
34
|
+
Dotman::DotfileCollection.delete('tim')
|
35
|
+
YAML::load_file(Dotman::DOTFILES_PATH).should_not include('tim')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context "when dotfile doesn't exist" do
|
40
|
+
it "warns you that the alias was not found to delete" do
|
41
|
+
Dotman::Notification.should_receive(:dotfile_collection_not_found).with('bob')
|
42
|
+
Dotman::DotfileCollection.delete('bob')
|
15
43
|
end
|
16
44
|
end
|
17
45
|
end
|
@@ -28,7 +56,7 @@ describe Dotman::DotfileCollection do
|
|
28
56
|
context "when aliases exist in the collection" do
|
29
57
|
it "shows all the aliases" do
|
30
58
|
STDOUT.should_receive(:puts).with("default\ntim")
|
31
|
-
Dotman::
|
59
|
+
Dotman::Notification.display_all_aliases
|
32
60
|
end
|
33
61
|
end
|
34
62
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,19 +1,40 @@
|
|
1
1
|
ENV['HOME'] = File.expand_path('../data/home', __FILE__)
|
2
|
-
require '
|
2
|
+
require 'fakefs/spec_helpers'
|
3
3
|
require_relative "../lib/dotman"
|
4
4
|
|
5
|
+
def create_home_directory
|
6
|
+
FileUtils.mkdir_p(ENV['HOME']) unless File.directory?(ENV['HOME'])
|
7
|
+
end
|
8
|
+
|
9
|
+
def create_timbinous_dotfiles
|
10
|
+
timbinous_path = File.join(ENV['HOME'], '../', 'Timbinous_dotfiles')
|
11
|
+
FileUtils.mkdir_p(timbinous_path) unless File.directory?(timbinous_path)
|
12
|
+
FileUtils.mkdir_p(timbinous_path, '.vim')
|
13
|
+
FileUtils.touch(File.join(timbinous_path, '.bashrc'))
|
14
|
+
FileUtils.touch(File.join(timbinous_path, '.tmux.conf'))
|
15
|
+
FileUtils.touch(File.join(timbinous_path, '.vimrc'))
|
16
|
+
FileUtils.touch(File.join(timbinous_path, '.zshrc'))
|
17
|
+
FileUtils.touch(File.join(timbinous_path, '.tim.zsh-theme'))
|
18
|
+
end
|
19
|
+
|
5
20
|
RSpec.configure do |config|
|
6
21
|
|
22
|
+
config.include FakeFS::SpecHelpers
|
23
|
+
|
7
24
|
config.before(:each) do
|
25
|
+
create_home_directory
|
26
|
+
create_timbinous_dotfiles
|
8
27
|
Dotman::Git.stub(:system) do |arg|
|
9
|
-
if arg == "git clone git@github.com:Timbinous/dotfiles.git
|
28
|
+
if arg == "git clone git@github.com:Timbinous/dotfiles.git #{ENV['HOME']}/.dotman/Timbinous_dotfiles"
|
10
29
|
FileUtils.cp_r(File.expand_path('../data/Timbinous_dotfiles', __FILE__), File.join(ENV['HOME'], '.dotman'))
|
11
30
|
end
|
12
31
|
end
|
13
32
|
end
|
14
33
|
|
34
|
+
|
15
35
|
config.after(:each) do
|
16
36
|
FileUtils.rm_rf(File.join(ENV['HOME'], '.dotman')) if File.directory? (File.join(ENV['HOME'], '.dotman'))
|
37
|
+
FileUtils.rm_rf(File.join(ENV['HOME'], 'dotfiles')) if File.directory? (File.join(ENV['HOME'], 'dotfiles'))
|
17
38
|
FileUtils.rm(File.join(ENV['HOME'], '.bashrc')) if File.symlink? (File.join(ENV['HOME'], '.bashrc'))
|
18
39
|
FileUtils.rm(File.join(ENV['HOME'], '.gitignore')) if File.symlink? (File.join(ENV['HOME'], '.gitignore'))
|
19
40
|
FileUtils.rm(File.join(ENV['HOME'], '.tmux.conf')) if File.symlink? (File.join(ENV['HOME'], '.tmux.conf'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3.
|
4
|
+
version: 0.0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- .gitignore
|
78
78
|
- .rvmrc
|
79
|
+
- .travis.yml
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.md
|
@@ -87,37 +88,9 @@ files:
|
|
87
88
|
- lib/dotman/collect.rb
|
88
89
|
- lib/dotman/dotfile_collection.rb
|
89
90
|
- lib/dotman/git.rb
|
91
|
+
- lib/dotman/notification.rb
|
90
92
|
- lib/dotman/user.rb
|
91
93
|
- lib/dotman/version.rb
|
92
|
-
- spec/data/Timbinous_dotfiles/.bashrc
|
93
|
-
- spec/data/Timbinous_dotfiles/.gitignore
|
94
|
-
- spec/data/Timbinous_dotfiles/.tmux.conf
|
95
|
-
- spec/data/Timbinous_dotfiles/.vim/autoload/pathogen.vim
|
96
|
-
- spec/data/Timbinous_dotfiles/.vim/bundle/.gitkeep
|
97
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/Black.vim
|
98
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/Dark.vim
|
99
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/autumnleaf.vim
|
100
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/c.vim
|
101
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/darkzen.vim
|
102
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb.vim
|
103
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb.vim~
|
104
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb2.vim
|
105
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb256.vim
|
106
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb3.vim
|
107
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb4.vim
|
108
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grblight.vim
|
109
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grblight.vim~
|
110
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/ir_black.vim
|
111
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/moria.vim
|
112
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/pyte.vim
|
113
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/redstring.vim
|
114
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/xterm16.vim
|
115
|
-
- spec/data/Timbinous_dotfiles/.vim/spell/en.utf-8.add
|
116
|
-
- spec/data/Timbinous_dotfiles/.vim/spell/en.utf-8.add.spl
|
117
|
-
- spec/data/Timbinous_dotfiles/.vimrc
|
118
|
-
- spec/data/Timbinous_dotfiles/.zshrc
|
119
|
-
- spec/data/Timbinous_dotfiles/symlinkify
|
120
|
-
- spec/data/Timbinous_dotfiles/tim.zsh-theme
|
121
94
|
- spec/data/home/.gitkeep
|
122
95
|
- spec/dotman/base_spec.rb
|
123
96
|
- spec/dotman/collect_spec.rb
|
@@ -155,35 +128,6 @@ specification_version: 4
|
|
155
128
|
summary: Use this utility to manage your dotfiles and others who may use the same
|
156
129
|
login user as yourself
|
157
130
|
test_files:
|
158
|
-
- spec/data/Timbinous_dotfiles/.bashrc
|
159
|
-
- spec/data/Timbinous_dotfiles/.gitignore
|
160
|
-
- spec/data/Timbinous_dotfiles/.tmux.conf
|
161
|
-
- spec/data/Timbinous_dotfiles/.vim/autoload/pathogen.vim
|
162
|
-
- spec/data/Timbinous_dotfiles/.vim/bundle/.gitkeep
|
163
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/Black.vim
|
164
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/Dark.vim
|
165
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/autumnleaf.vim
|
166
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/c.vim
|
167
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/darkzen.vim
|
168
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb.vim
|
169
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb.vim~
|
170
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb2.vim
|
171
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb256.vim
|
172
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb3.vim
|
173
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grb4.vim
|
174
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grblight.vim
|
175
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/grblight.vim~
|
176
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/ir_black.vim
|
177
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/moria.vim
|
178
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/pyte.vim
|
179
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/redstring.vim
|
180
|
-
- spec/data/Timbinous_dotfiles/.vim/colors/xterm16.vim
|
181
|
-
- spec/data/Timbinous_dotfiles/.vim/spell/en.utf-8.add
|
182
|
-
- spec/data/Timbinous_dotfiles/.vim/spell/en.utf-8.add.spl
|
183
|
-
- spec/data/Timbinous_dotfiles/.vimrc
|
184
|
-
- spec/data/Timbinous_dotfiles/.zshrc
|
185
|
-
- spec/data/Timbinous_dotfiles/symlinkify
|
186
|
-
- spec/data/Timbinous_dotfiles/tim.zsh-theme
|
187
131
|
- spec/data/home/.gitkeep
|
188
132
|
- spec/dotman/base_spec.rb
|
189
133
|
- spec/dotman/collect_spec.rb
|
@@ -1,121 +0,0 @@
|
|
1
|
-
# ~/.bashrc: executed by bash(1) for non-login shells.
|
2
|
-
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
3
|
-
# for examples
|
4
|
-
|
5
|
-
# If not running interactively, don't do anything
|
6
|
-
[ -z "$PS1" ] && return
|
7
|
-
|
8
|
-
# don't put duplicate lines in the history. See bash(1) for more options
|
9
|
-
# ... or force ignoredups and ignorespace
|
10
|
-
HISTCONTROL=ignoredups:ignorespace
|
11
|
-
|
12
|
-
# append to the history file, don't overwrite it
|
13
|
-
shopt -s histappend
|
14
|
-
|
15
|
-
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
16
|
-
HISTSIZE=1000
|
17
|
-
HISTFILESIZE=2000
|
18
|
-
|
19
|
-
# check the window size after each command and, if necessary,
|
20
|
-
# update the values of LINES and COLUMNS.
|
21
|
-
shopt -s checkwinsize
|
22
|
-
|
23
|
-
# make less more friendly for non-text input files, see lesspipe(1)
|
24
|
-
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
25
|
-
|
26
|
-
# set variable identifying the chroot you work in (used in the prompt below)
|
27
|
-
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
|
28
|
-
debian_chroot=$(cat /etc/debian_chroot)
|
29
|
-
fi
|
30
|
-
|
31
|
-
# set a fancy prompt (non-color, unless we know we "want" color)
|
32
|
-
case "$TERM" in
|
33
|
-
xterm-color) color_prompt=yes;;
|
34
|
-
esac
|
35
|
-
|
36
|
-
# uncomment for a colored prompt, if the terminal has the capability; turned
|
37
|
-
# off by default to not distract the user: the focus in a terminal window
|
38
|
-
# should be on the output of commands, not on the prompt
|
39
|
-
#force_color_prompt=yes
|
40
|
-
|
41
|
-
if [ -n "$force_color_prompt" ]; then
|
42
|
-
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
43
|
-
# We have color support; assume it's compliant with Ecma-48
|
44
|
-
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
45
|
-
# a case would tend to support setf rather than setaf.)
|
46
|
-
color_prompt=yes
|
47
|
-
else
|
48
|
-
color_prompt=
|
49
|
-
fi
|
50
|
-
fi
|
51
|
-
|
52
|
-
if [ "$color_prompt" = yes ]; then
|
53
|
-
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
54
|
-
else
|
55
|
-
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
56
|
-
fi
|
57
|
-
unset color_prompt force_color_prompt
|
58
|
-
|
59
|
-
# If this is an xterm set the title to user@host:dir
|
60
|
-
case "$TERM" in
|
61
|
-
xterm*|rxvt*)
|
62
|
-
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
63
|
-
;;
|
64
|
-
*)
|
65
|
-
;;
|
66
|
-
esac
|
67
|
-
|
68
|
-
# enable color support of ls and also add handy aliases
|
69
|
-
if [ -x /usr/bin/dircolors ]; then
|
70
|
-
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
71
|
-
alias ls='ls --color=auto'
|
72
|
-
#alias dir='dir --color=auto'
|
73
|
-
#alias vdir='vdir --color=auto'
|
74
|
-
|
75
|
-
alias grep='grep --color=auto'
|
76
|
-
alias fgrep='fgrep --color=auto'
|
77
|
-
alias egrep='egrep --color=auto'
|
78
|
-
fi
|
79
|
-
|
80
|
-
# some more ls aliases
|
81
|
-
alias ll='ls -alF'
|
82
|
-
alias la='ls -A'
|
83
|
-
alias l='ls -CF'
|
84
|
-
|
85
|
-
# Add an "alert" alias for long running commands. Use like so:
|
86
|
-
# sleep 10; alert
|
87
|
-
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
88
|
-
|
89
|
-
# Alias definitions.
|
90
|
-
# You may want to put all your additions into a separate file like
|
91
|
-
# ~/.bash_aliases, instead of adding them here directly.
|
92
|
-
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
93
|
-
|
94
|
-
if [ -f ~/.bash_aliases ]; then
|
95
|
-
. ~/.bash_aliases
|
96
|
-
fi
|
97
|
-
|
98
|
-
# enable programmable completion features (you don't need to enable
|
99
|
-
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
100
|
-
# sources /etc/bash.bashrc).
|
101
|
-
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
102
|
-
. /etc/bash_completion
|
103
|
-
fi
|
104
|
-
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
|
105
|
-
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
|
106
|
-
|
107
|
-
function tmux-start {
|
108
|
-
tmux -S /tmux/$1 new-session -s $1 -d
|
109
|
-
chmod 777 /tmux/$1
|
110
|
-
tmux -S /tmux/$1 attach -t $1
|
111
|
-
}
|
112
|
-
|
113
|
-
function tmux-join {
|
114
|
-
tmux -S /tmux/$1 new-session -t $1
|
115
|
-
}
|
116
|
-
|
117
|
-
function tmux-list {
|
118
|
-
ps -o ruser,command -ax | grep '[n]ew-session -s' | ruby -ne '$_ =~ /^(\w+).*-s (\w+)/; puts "#{$1} started #{$2}"'
|
119
|
-
}
|
120
|
-
|
121
|
-
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
|