comfify 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +2 -1
- data/Rakefile +7 -6
- data/bin/comfify +21 -9
- data/comfify-0.1.0.gem +0 -0
- data/comfify.gemspec +4 -1
- data/features/comfify.feature +12 -0
- data/features/step_definitions/comfify_steps.rb +8 -1
- data/features/support/env.rb +1 -0
- data/features/support/hooks.rb +5 -0
- data/lib/comfify/version.rb +1 -1
- data/spec/comfify_spec.rb +22 -3
- data/spec/spec_helper.rb +17 -0
- data/spec/support/aruba.rb +1 -0
- metadata +48 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b0e3b23b5610e03192a5af8e4ba9414cbe859ca
|
4
|
+
data.tar.gz: 7c7039796799edde8a3ac3e141b366a2dd5b07d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3de7e9cfa260032198728f7aa8b01880f74df12c428584d36d73b540d18c06079d30dd804175bba1e49eb00709d3b71420a432f837052ba98367ad2d39946652
|
7
|
+
data.tar.gz: e39bda769414b4ab461e0fbe38a76172fcb7535b37e46d1aea875eab0e710688bd90bd3ac5888f6c961f7dbaee877263fd4d25feaa1b47ffe4c2b425acc096ef
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Comfify
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/joelbyler/comfify.svg)](https://travis-ci.org/joelbyler/comfify)
|
4
|
+
|
3
5
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/comfify`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
6
|
|
5
7
|
TODO: Delete this and the text above, and describe your gem
|
@@ -38,4 +40,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
38
40
|
## License
|
39
41
|
|
40
42
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/Rakefile
CHANGED
@@ -4,6 +4,8 @@ require 'rubygems/package_task'
|
|
4
4
|
require 'rdoc/task'
|
5
5
|
require 'cucumber'
|
6
6
|
require 'cucumber/rake/task'
|
7
|
+
require "bundler/gem_tasks"
|
8
|
+
|
7
9
|
Rake::RDocTask.new do |rd|
|
8
10
|
rd.main = "README.rdoc"
|
9
11
|
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
@@ -35,10 +37,9 @@ end
|
|
35
37
|
task :cucumber => :features
|
36
38
|
task 'cucumber:wip' => 'features:wip'
|
37
39
|
task :wip => 'features:wip'
|
38
|
-
require 'rake/testtask'
|
39
|
-
Rake::TestTask.new do |t|
|
40
|
-
t.libs << "test"
|
41
|
-
t.test_files = FileList['test/*_test.rb']
|
42
|
-
end
|
43
40
|
|
44
|
-
|
41
|
+
require "rspec/core/rake_task"
|
42
|
+
|
43
|
+
RSpec::Core::RakeTask.new(:spec)
|
44
|
+
|
45
|
+
task :default => [:spec,:features]
|
data/bin/comfify
CHANGED
@@ -11,21 +11,13 @@ end
|
|
11
11
|
|
12
12
|
include GLI::App
|
13
13
|
|
14
|
-
program_desc '
|
14
|
+
program_desc 'a tool to help keep dotfiles in sync with other systems'
|
15
15
|
|
16
16
|
version Comfify::VERSION
|
17
17
|
|
18
18
|
subcommand_option_handling :normal
|
19
19
|
arguments :strict
|
20
20
|
|
21
|
-
desc 'Describe some switch here'
|
22
|
-
switch [:s,:switch]
|
23
|
-
|
24
|
-
desc 'Describe some flag here'
|
25
|
-
default_value 'the default'
|
26
|
-
arg_name 'The name of the argument'
|
27
|
-
flag [:f,:flagname]
|
28
|
-
|
29
21
|
pre do |global,command,options,args|
|
30
22
|
# Pre logic here
|
31
23
|
# Return true to proceed; false to abort and not call the
|
@@ -47,4 +39,24 @@ on_error do |exception|
|
|
47
39
|
true
|
48
40
|
end
|
49
41
|
|
42
|
+
desc 'create a new link for a directory to your home directory'
|
43
|
+
arg_name 'directory'
|
44
|
+
command :link do |c|
|
45
|
+
c.action do |global_options,options,args|
|
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)
|
49
|
+
elsif File.directory?(args.first)
|
50
|
+
Dir.foreach(args.first) do |item|
|
51
|
+
unless item == "." || item == ".."
|
52
|
+
puts "Linking file #{item}"
|
53
|
+
File.symlink("#{args.first}/#{item}", File.expand_path("#{Dir.home}/#{item}"))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
else
|
57
|
+
puts "Unable to locate the directory to link"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
50
62
|
exit run(ARGV)
|
data/comfify-0.1.0.gem
ADDED
Binary file
|
data/comfify.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ensure we require the local version and not one we might have installed already
|
2
2
|
require File.join([File.dirname(__FILE__),'lib','comfify','version.rb'])
|
3
|
-
spec = Gem::Specification.new do |s|
|
3
|
+
spec = Gem::Specification.new do |s|
|
4
4
|
s.name = 'comfify'
|
5
5
|
s.version = Comfify::VERSION
|
6
6
|
s.author = 'Your Name Here'
|
@@ -18,6 +18,9 @@ spec = Gem::Specification.new do |s|
|
|
18
18
|
s.executables << 'comfify'
|
19
19
|
s.add_development_dependency('rake')
|
20
20
|
s.add_development_dependency('rdoc')
|
21
|
+
s.add_development_dependency('rspec')
|
21
22
|
s.add_development_dependency('aruba')
|
23
|
+
s.add_development_dependency('fakefs')
|
24
|
+
s.add_development_dependency('pry')
|
22
25
|
s.add_runtime_dependency('gli','2.13.4')
|
23
26
|
end
|
data/features/comfify.feature
CHANGED
@@ -6,3 +6,15 @@ 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
|
+
"""
|
@@ -3,4 +3,11 @@ When /^I get help for "([^"]*)"$/ do |app_name|
|
|
3
3
|
step %(I run `#{app_name} help`)
|
4
4
|
end
|
5
5
|
|
6
|
-
|
6
|
+
Given(/^I have a directory "([^"]*)" that I want to link$/) do |dir_name|
|
7
|
+
FileUtils::mkdir_p("#{dir_name}/.somefilefoo")
|
8
|
+
end
|
9
|
+
|
10
|
+
When(/^I link the "([^"]*)" directory with "([^"]*)"$/) do |dir_name, app_name|
|
11
|
+
@app_name = app_name
|
12
|
+
step %(I run `#{app_name} link #{dir_name}`)
|
13
|
+
end
|
data/features/support/env.rb
CHANGED
data/lib/comfify/version.rb
CHANGED
data/spec/comfify_spec.rb
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
describe Comfify, :type => :aruba do
|
5
|
+
include FakeFS::SpecHelpers
|
6
|
+
before(:each) do
|
7
|
+
puts 'running before'
|
8
|
+
begin
|
9
|
+
FileUtils.rm_rf("#{Dir.home}/.foo")
|
10
|
+
end
|
11
|
+
end
|
2
12
|
|
3
|
-
describe Comfify do
|
4
13
|
it 'has a version number' do
|
5
14
|
expect(Comfify::VERSION).not_to be nil
|
6
15
|
end
|
7
16
|
|
8
|
-
it '
|
9
|
-
expect
|
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)
|
10
29
|
end
|
11
30
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,2 +1,19 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'fakefs/spec_helpers'
|
3
|
+
require 'aruba/rspec'
|
4
|
+
|
1
5
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
6
|
require 'comfify'
|
7
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
8
|
+
|
9
|
+
if RUBY_VERSION < '1.9.3'
|
10
|
+
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
11
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
12
|
+
else
|
13
|
+
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
|
14
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
|
15
|
+
end
|
16
|
+
|
17
|
+
RSpec.configure do |config|
|
18
|
+
config.include FakeFS::SpecHelpers, fakefs: true
|
19
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'aruba/rspec'
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Your Name Here
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: aruba
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,34 @@ dependencies:
|
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fakefs
|
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'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: gli
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,15 +129,18 @@ files:
|
|
87
129
|
- bin/comfify
|
88
130
|
- bin/console
|
89
131
|
- bin/setup
|
132
|
+
- comfify-0.1.0.gem
|
90
133
|
- comfify.gemspec
|
91
134
|
- comfify.rdoc
|
92
135
|
- features/comfify.feature
|
93
136
|
- features/step_definitions/comfify_steps.rb
|
94
137
|
- features/support/env.rb
|
138
|
+
- features/support/hooks.rb
|
95
139
|
- lib/comfify.rb
|
96
140
|
- lib/comfify/version.rb
|
97
141
|
- spec/comfify_spec.rb
|
98
142
|
- spec/spec_helper.rb
|
143
|
+
- spec/support/aruba.rb
|
99
144
|
homepage: http://your.website.com
|
100
145
|
licenses: []
|
101
146
|
metadata: {}
|
@@ -121,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
166
|
version: '0'
|
122
167
|
requirements: []
|
123
168
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.4.
|
169
|
+
rubygems_version: 2.4.8
|
125
170
|
signing_key:
|
126
171
|
specification_version: 4
|
127
172
|
summary: A description of your project
|