dotbox 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- backbox (1.0.0)
4
+ dotbox (1.0.0)
5
5
  thor
6
6
 
7
7
  GEM
@@ -39,5 +39,5 @@ PLATFORMS
39
39
 
40
40
  DEPENDENCIES
41
41
  aruba
42
- backbox!
42
+ dotbox!
43
43
  rspec
@@ -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'
@@ -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
+
@@ -17,13 +17,14 @@ module Dotbox
17
17
  check_setup
18
18
  @record = Record.new
19
19
  pathes.each do |path|
20
- path = ::File.expand_path(path)
21
- if ::File.exists?(path)
22
- file = File.new(path)
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
@@ -2,7 +2,7 @@ module Dotbox
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- PATCH = 0
5
+ PATCH = 1
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.');
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.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.23
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.