borrower 0.8.1 → 0.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 1e59a3d71ae928166deab39de254c1c97c50fa39
4
- data.tar.gz: dca29734a77bdfd629acc06c8ef78175efed8815
5
- SHA512:
6
- metadata.gz: 9bd3974ccaa76fc8f215d1bb178f7c8ae417d70d76ea28a1a028ab61e898784879195b2a65f363e5057d2e38adab2d209358bb70ea5354cf540bb4ffad799618
7
- data.tar.gz: 8c23d76ef0b35907cf5f74d592a2b975cae079c6b9113b0ca6220a0a0c4c46cb71c4188a5de4364246ed6ae23f4b30d4734095a323b08ff8147c09e69d8de361
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8f8bceda79901ff30f3b857412b1033162d07c7d
4
+ data.tar.gz: a6c2210b52495d2103c9e766c797206e8a3a8607
5
+ SHA512:
6
+ metadata.gz: 4b0373e9e5c3e7a8c317f21d88735e9eda396f9d3509f58525f5119fc79933f90e9979e1e79e165302dff8106322c2f9cd9b1d3e44afdddec807ff4ada66dc68
7
+ data.tar.gz: 903ee7f689e8bb207aee48f1ca2b53a90d1d552bdf0aeb4fba18dc1307a4bd0ce31f3d1030fd08a837dc8b707a8ae1b865e55e14217b499e9bef20bd1a6a459d
@@ -35,11 +35,23 @@ module Borrower
35
35
  path = check_for_file_in_manifest_directories(file) || false
36
36
  return path if path
37
37
 
38
+ path = check_for_file_with_expanded_path(file) || false
39
+ return path if path
40
+
38
41
  raise "Could not file #{file}"
39
42
  end
40
43
 
41
44
  private
42
45
 
46
+ def check_for_file_with_expanded_path file
47
+ path = File.expand_path(file)
48
+ if File.exists? path
49
+ return path
50
+ else
51
+ return false
52
+ end
53
+ end
54
+
43
55
  def check_for_file_in_manifest_files file
44
56
  files.fetch(file) { false }
45
57
  end
@@ -1,3 +1,3 @@
1
1
  module Borrower
2
- VERSION = "0.8.1"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -16,6 +16,7 @@ describe Borrower::Manifest do
16
16
  let(:remote_file) { "https://gist.github.com/stevenosloan/5578606/raw/97ab1305184bdeac33472f9f1fcc1c9e278a1bb3/dummy.txt" }
17
17
  let(:base_dir) { File.join( TMP ) }
18
18
  let(:files_dir) { File.join( TMP, 'files' ) }
19
+ let(:expanded_file) { "~/.bashrc" }
19
20
 
20
21
  context "with no manifest file" do
21
22
 
@@ -47,6 +48,10 @@ describe Borrower::Manifest do
47
48
  Borrower.find("foo.txt").should == File.join( TMP, "files/foo.txt" )
48
49
  end
49
50
 
51
+ it "expands path to find files" do
52
+ expect( Borrower.find(expanded_file) ).to eq File.expand_path(expanded_file)
53
+ end
54
+
50
55
  it "raises error if no file is found" do
51
56
  expect { Borrower.find("doesnt_exist.txt") }.to raise_error
52
57
  end
metadata CHANGED
@@ -1,36 +1,37 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: borrower
3
- version: !ruby/object:Gem::Version
4
- version: 0.8.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Steven Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2014-01-23 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+ date: 2014-11-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
15
14
  name: net-ssh
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 2.6.5
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.6'
22
20
  type: :runtime
23
- version_requirements: *id001
24
- description: " For borrowing little snippets of the web, or files, or really any snippet of string. "
25
- email:
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.6'
27
+ description: " For borrowing little snippets of the web, or files, or really any snippet
28
+ of string. "
29
+ email:
26
30
  - stevenosloan@gmail.com
27
31
  executables: []
28
-
29
32
  extensions: []
30
-
31
33
  extra_rdoc_files: []
32
-
33
- files:
34
+ files:
34
35
  - lib/borrower.rb
35
36
  - lib/borrower/content.rb
36
37
  - lib/borrower/manifest.rb
@@ -47,36 +48,36 @@ files:
47
48
  - spec/support/fake_stdin.rb
48
49
  - spec/support/given.rb
49
50
  homepage: http://github.com/stevenosloan/borrower
50
- licenses:
51
+ licenses:
51
52
  - MIT
52
53
  metadata: {}
53
-
54
54
  post_install_message:
55
55
  rdoc_options: []
56
-
57
- require_paths:
56
+ require_paths:
58
57
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
60
- requirements:
61
- - &id002
62
- - ">="
63
- - !ruby/object:Gem::Version
64
- version: "0"
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
- requirements:
67
- - *id002
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
68
  requirements: []
69
-
70
69
  rubyforge_project:
71
- rubygems_version: 2.2.0
70
+ rubygems_version: 2.2.2
72
71
  signing_key:
73
72
  specification_version: 4
74
- summary: For borrowing little snippets of the web, or files, or really any snippet of string.
75
- test_files:
76
- - spec/borrower_spec.rb
77
- - spec/spec_helper.rb
73
+ summary: For borrowing little snippets of the web, or files, or really any snippet
74
+ of string.
75
+ test_files:
78
76
  - spec/borrower/manifest_spec.rb
79
77
  - spec/borrower/merge_spec.rb
80
78
  - spec/borrower/public_api_spec.rb
79
+ - spec/borrower_spec.rb
80
+ - spec/spec_helper.rb
81
81
  - spec/support/fake_stdin.rb
82
82
  - spec/support/given.rb
83
+ has_rdoc: