comfify 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/comfify +8 -3
- data/comfify.gemspec +4 -4
- data/features/comfify.feature +0 -12
- data/features/link.feature +26 -0
- data/features/step_definitions/comfify_steps.rb +4 -0
- data/lib/comfify/version.rb +1 -1
- data/spec/comfify_spec.rb +0 -14
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85a907db92bef82029dea13bd3f473f7334081cc
|
4
|
+
data.tar.gz: 5b812c420a1fcf4d302fe1185676d2454ec67e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad70cd0fb349947714ce1781dba07507ed52e6c87f541056f1f4f0dc3a06bb93b57a74c8780cb6afd0044c1609a681fce2f5566de2eac2df04263cb7f26f77d
|
7
|
+
data.tar.gz: cca2b59b2f243ef41cfe978ea2f6d91ce6eaef3b93d0e5b36d9d1079e50f249b96758e9bb2a777154d1fdc41fe05ab60171e493446320a7ca7f42fb45f146ff8
|
data/bin/comfify
CHANGED
@@ -44,13 +44,18 @@ arg_name 'directory'
|
|
44
44
|
command :link do |c|
|
45
45
|
c.action do |global_options,options,args|
|
46
46
|
if File.file?(args.first)
|
47
|
-
puts "Linking file #{args.first}"
|
48
|
-
File.symlink(args.first, File.expand_path("#{Dir.home}/#{args.first}")
|
47
|
+
puts "Linking file #{File.expand_path(args.first)}"
|
48
|
+
File.symlink(File.expand_path(args.first), File.expand_path("#{Dir.home}/#{args.first}"))
|
49
49
|
elsif File.directory?(args.first)
|
50
50
|
Dir.foreach(args.first) do |item|
|
51
51
|
unless item == "." || item == ".."
|
52
52
|
puts "Linking file #{item}"
|
53
|
-
File.
|
53
|
+
if (File.exist?(File.expand_path("#{Dir.home}/#{item}")))
|
54
|
+
puts " ** destination already exists, skipping **"
|
55
|
+
else
|
56
|
+
File.symlink(File.expand_path("#{args.first}/#{item}"),
|
57
|
+
File.expand_path("#{Dir.home}/#{item}"))
|
58
|
+
end
|
54
59
|
end
|
55
60
|
end
|
56
61
|
else
|
data/comfify.gemspec
CHANGED
@@ -3,11 +3,11 @@ require File.join([File.dirname(__FILE__),'lib','comfify','version.rb'])
|
|
3
3
|
spec = Gem::Specification.new do |s|
|
4
4
|
s.name = 'comfify'
|
5
5
|
s.version = Comfify::VERSION
|
6
|
-
s.author = '
|
7
|
-
s.email = '
|
8
|
-
s.homepage = '
|
6
|
+
s.author = 'Joel Byler'
|
7
|
+
s.email = 'joelbyler@gmail.com'
|
8
|
+
s.homepage = 'https://github.com/joelbyler/comfify'
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
|
-
s.summary = '
|
10
|
+
s.summary = 'Command Line Utility to assist in setting up dotfiles'
|
11
11
|
s.files = `git ls-files`.split("
|
12
12
|
")
|
13
13
|
s.require_paths << 'lib'
|
data/features/comfify.feature
CHANGED
@@ -6,15 +6,3 @@ Feature: My bootstrapped app kinda works
|
|
6
6
|
Scenario: App just runs
|
7
7
|
When I get help for "comfify"
|
8
8
|
Then the exit status should be 0
|
9
|
-
|
10
|
-
Scenario: Link a directory
|
11
|
-
Given a file named "foo/.foofiles/file1.txt" with:
|
12
|
-
"""
|
13
|
-
Lorem ipsum dolor
|
14
|
-
"""
|
15
|
-
When I link the "foo" directory with "comfify"
|
16
|
-
Then the exit status should be 0
|
17
|
-
And the output should contain:
|
18
|
-
"""
|
19
|
-
Linking file .foofiles
|
20
|
-
"""
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: Link contents of a directory to files in your home directory
|
2
|
+
|
3
|
+
In order to use files that were cloned from a dotfiles repository
|
4
|
+
I want to have a copy of files in a source directory in my home directory
|
5
|
+
So I don't have to have a complicated setup process for a new dev environment
|
6
|
+
|
7
|
+
Background: A directory exists
|
8
|
+
Given a file named "foo/.foofiles/file1.txt" with:
|
9
|
+
"""
|
10
|
+
Lorem ipsum dolor
|
11
|
+
"""
|
12
|
+
|
13
|
+
Scenario: Link contents of a directory
|
14
|
+
When I link the "foo" directory with "comfify"
|
15
|
+
Then the exit status should be 0
|
16
|
+
And the output should contain "Linking file .foofiles"
|
17
|
+
|
18
|
+
Scenario: Prevents accidental overwrite of existing folder
|
19
|
+
When I link the "foo" directory with "comfify"
|
20
|
+
When I link the "foo" directory with "comfify"
|
21
|
+
Then the exit status should be 0
|
22
|
+
And the output should contain "destination already exists, skipping"
|
23
|
+
|
24
|
+
Scenario: Linked directory exists
|
25
|
+
When I link the "foo" directory with "comfify"
|
26
|
+
Then a symlink exists for ".foofiles" in my home directory
|
@@ -11,3 +11,7 @@ When(/^I link the "([^"]*)" directory with "([^"]*)"$/) do |dir_name, app_name|
|
|
11
11
|
@app_name = app_name
|
12
12
|
step %(I run `#{app_name} link #{dir_name}`)
|
13
13
|
end
|
14
|
+
|
15
|
+
Then(/^a symlink exists for "([^"]*)" in my home directory$/) do |dir_name|
|
16
|
+
expect(File.symlink?(File.expand_path("#{Dir.home}/#{dir_name}"))).to eq(true)
|
17
|
+
end
|
data/lib/comfify/version.rb
CHANGED
data/spec/comfify_spec.rb
CHANGED
@@ -13,18 +13,4 @@ describe Comfify, :type => :aruba do
|
|
13
13
|
it 'has a version number' do
|
14
14
|
expect(Comfify::VERSION).not_to be nil
|
15
15
|
end
|
16
|
-
|
17
|
-
it 'creates a symlink' do
|
18
|
-
expect {
|
19
|
-
FileUtils::mkdir_p('foo/.foo')
|
20
|
-
}.to change {
|
21
|
-
Dir.exists?('foo/.foo')
|
22
|
-
}.from(false).to(true)
|
23
|
-
|
24
|
-
# expect {
|
25
|
-
# `bundle exec comfify link foo`
|
26
|
-
# }.to change {
|
27
|
-
# Dir.exists?("#{Dir.home}/.foo")
|
28
|
-
# }.from(false).to(true)
|
29
|
-
end
|
30
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Joel Byler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 2.13.4
|
111
111
|
description:
|
112
|
-
email:
|
112
|
+
email: joelbyler@gmail.com
|
113
113
|
executables:
|
114
114
|
- comfify
|
115
115
|
extensions: []
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- comfify.gemspec
|
134
134
|
- comfify.rdoc
|
135
135
|
- features/comfify.feature
|
136
|
+
- features/link.feature
|
136
137
|
- features/step_definitions/comfify_steps.rb
|
137
138
|
- features/support/env.rb
|
138
139
|
- features/support/hooks.rb
|
@@ -141,7 +142,7 @@ files:
|
|
141
142
|
- spec/comfify_spec.rb
|
142
143
|
- spec/spec_helper.rb
|
143
144
|
- spec/support/aruba.rb
|
144
|
-
homepage:
|
145
|
+
homepage: https://github.com/joelbyler/comfify
|
145
146
|
licenses: []
|
146
147
|
metadata: {}
|
147
148
|
post_install_message:
|
@@ -169,5 +170,5 @@ rubyforge_project:
|
|
169
170
|
rubygems_version: 2.4.8
|
170
171
|
signing_key:
|
171
172
|
specification_version: 4
|
172
|
-
summary:
|
173
|
+
summary: Command Line Utility to assist in setting up dotfiles
|
173
174
|
test_files: []
|