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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b0e3b23b5610e03192a5af8e4ba9414cbe859ca
4
- data.tar.gz: 7c7039796799edde8a3ac3e141b366a2dd5b07d1
3
+ metadata.gz: 85a907db92bef82029dea13bd3f473f7334081cc
4
+ data.tar.gz: 5b812c420a1fcf4d302fe1185676d2454ec67e0c
5
5
  SHA512:
6
- metadata.gz: 3de7e9cfa260032198728f7aa8b01880f74df12c428584d36d73b540d18c06079d30dd804175bba1e49eb00709d3b71420a432f837052ba98367ad2d39946652
7
- data.tar.gz: e39bda769414b4ab461e0fbe38a76172fcb7535b37e46d1aea875eab0e710688bd90bd3ac5888f6c961f7dbaee877263fd4d25feaa1b47ffe4c2b425acc096ef
6
+ metadata.gz: 8ad70cd0fb349947714ce1781dba07507ed52e6c87f541056f1f4f0dc3a06bb93b57a74c8780cb6afd0044c1609a681fce2f5566de2eac2df04263cb7f26f77d
7
+ data.tar.gz: cca2b59b2f243ef41cfe978ea2f6d91ce6eaef3b93d0e5b36d9d1079e50f249b96758e9bb2a777154d1fdc41fe05ab60171e493446320a7ca7f42fb45f146ff8
@@ -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}"), :force => true)
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.symlink("#{args.first}/#{item}", File.expand_path("#{Dir.home}/#{item}"))
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
@@ -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 = 'Your Name Here'
7
- s.email = 'your@email.address.com'
8
- s.homepage = 'http://your.website.com'
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 = 'A description of your project'
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'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Comfify
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Your Name Here
7
+ - Joel Byler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-21 00:00:00.000000000 Z
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: your@email.address.com
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: http://your.website.com
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: A description of your project
173
+ summary: Command Line Utility to assist in setting up dotfiles
173
174
  test_files: []