dotbox 1.0.0 → 1.0.1
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.
- data/Gemfile.lock +2 -2
- data/dotbox.gemspec +1 -0
- data/features/add.feature +25 -0
- data/lib/dotbox/cli.rb +6 -5
- data/lib/dotbox/version.rb +1 -1
- metadata +4 -3
data/Gemfile.lock
CHANGED
data/dotbox.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "https://github.com/yesmeck/dotbox"
|
11
11
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
12
|
s.version = Dotbox::VERSION::STRING
|
13
|
+
s.executables << 'dotbox'
|
13
14
|
|
14
15
|
s.add_dependency 'thor'
|
15
16
|
s.add_development_dependency 'aruba'
|
data/features/add.feature
CHANGED
@@ -27,3 +27,28 @@ Feature: add file to dropbox
|
|
27
27
|
And the link named "foo/bar" should be a link of "dropbox/Apps/Dotbox/foo/bar"
|
28
28
|
And the record file should contain "foo/bar" => "directory"
|
29
29
|
|
30
|
+
@announce
|
31
|
+
Scenario: add multi-files
|
32
|
+
Given an empty file named "foo/bar"
|
33
|
+
Given an empty file named "foo/baz"
|
34
|
+
When I run `dotbox add foo/bar foo/baz`
|
35
|
+
Then a file named "dropbox/Apps/Dotbox/foo/bar" should exist
|
36
|
+
And the link named "foo/bar" should be a link of "dropbox/Apps/Dotbox/foo/bar"
|
37
|
+
And the record file should contain "foo/bar" => "file"
|
38
|
+
And a file named "dropbox/Apps/Dotbox/foo/baz" should exist
|
39
|
+
And the link named "foo/baz" should be a link of "dropbox/Apps/Dotbox/foo/baz"
|
40
|
+
And the record file should contain "foo/baz" => "file"
|
41
|
+
|
42
|
+
@announce
|
43
|
+
Scenario: add file using pattern
|
44
|
+
Given an empty file named "foo/bar"
|
45
|
+
Given an empty file named "foo/baz"
|
46
|
+
When I run `dotbox add foo/*`
|
47
|
+
Then a file named "dropbox/Apps/Dotbox/foo/bar" should exist
|
48
|
+
And the link named "foo/bar" should be a link of "dropbox/Apps/Dotbox/foo/bar"
|
49
|
+
And the record file should contain "foo/bar" => "file"
|
50
|
+
And a file named "dropbox/Apps/Dotbox/foo/baz" should exist
|
51
|
+
And the link named "foo/baz" should be a link of "dropbox/Apps/Dotbox/foo/baz"
|
52
|
+
And the record file should contain "foo/baz" => "file"
|
53
|
+
|
54
|
+
|
data/lib/dotbox/cli.rb
CHANGED
@@ -17,13 +17,14 @@ module Dotbox
|
|
17
17
|
check_setup
|
18
18
|
@record = Record.new
|
19
19
|
pathes.each do |path|
|
20
|
-
path
|
21
|
-
|
22
|
-
|
20
|
+
if Dir[path].empty?
|
21
|
+
die "#{path} not exists."
|
22
|
+
end
|
23
|
+
Dir[path].each do |p|
|
24
|
+
p = ::File.expand_path(p)
|
25
|
+
file = File.new(p)
|
23
26
|
file.backup
|
24
27
|
@record.add file
|
25
|
-
else
|
26
|
-
say "#{path} not exists."
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
data/lib/dotbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -62,7 +62,8 @@ dependencies:
|
|
62
62
|
description: Backup your dotfiles to dropbox and restore them easily.
|
63
63
|
email:
|
64
64
|
- yesmeck@gmail.com
|
65
|
-
executables:
|
65
|
+
executables:
|
66
|
+
- dotbox
|
66
67
|
extensions: []
|
67
68
|
extra_rdoc_files: []
|
68
69
|
files:
|
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
108
|
version: '0'
|
108
109
|
requirements: []
|
109
110
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.8.
|
111
|
+
rubygems_version: 1.8.25
|
111
112
|
signing_key:
|
112
113
|
specification_version: 3
|
113
114
|
summary: Backup your dotfiles to dropbox and restore them easily.
|