gitcopy 0.1.2 → 0.1.3

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
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b6abbdaba30dcb8b8623b4c629fe2f3fc2393bd
4
- data.tar.gz: e637e80bea67126d528bcca08ee1abf86806e394
3
+ metadata.gz: 67781e9abdd624f4e3d2ff71836383408eff6b88
4
+ data.tar.gz: 06ea2a6fcbccee30d421e8addfaf38ee045bba69
5
5
  SHA512:
6
- metadata.gz: 9f7abca156612a2cafc8dcb9c179829919befaaffa1e1bbf47a8519f21f69d6ef0193c7a0f0754d68b87c01bfe18ad43af1e2dba48db35e89cff08cf16228da1
7
- data.tar.gz: 2f04e48520258e85e439c03517c28c8119d2325422ce172ad01beb56f7f11f9ead0d2f73dbace70c5d9aa867b9d6b4df62c5200e144fb8404baa6ee59bad1ae5
6
+ metadata.gz: 0d7455300ea73626458f35589e158550bf4c767500cfd88a9c8fa467d4b2688616793d16cd4fc86a89b3e8c12445f9fd218b104b221e92f321b49760c6b4cf19
7
+ data.tar.gz: 4814e8b4737a8fd6a25436ffd41cbba084117c9b69f0061b79753072bfe233a399b54f90c21c4f028461287927e4b15399dd172280966dafda88215d543626bb
data/README.md CHANGED
@@ -22,14 +22,16 @@ Or install it yourself as:
22
22
 
23
23
  Use from the command line by running:
24
24
 
25
- $ gitcopy GITHUB_REPO_URL
25
+ $ gitcopy GITHUB_REPO_URL DESTINATION_PATH
26
26
 
27
27
  Or from another ruby file by calling:
28
28
 
29
29
  ```ruby
30
- GitCopy::copyRepo(GITHUB_REPO_URL)
30
+ GitCopy::copyRepo(GITHUB_REPO_URL, DESTINATION_PATH)
31
31
  ```
32
32
 
33
+ Note that if no `DESTINATION_PATH` is set, it will default to the current directory.
34
+
33
35
  ## Development
34
36
 
35
37
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/bin/gitcopy CHANGED
@@ -3,4 +3,6 @@
3
3
  require 'gitcopy'
4
4
 
5
5
  repoPath = ARGV[0]
6
- GitCopy::copyRepo(repoPath)
6
+ destPath = ARGV[1]
7
+
8
+ GitCopy::copyRepo(repoPath, destPath)
@@ -1,3 +1,3 @@
1
1
  module Gitcopy
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/gitcopy.rb CHANGED
@@ -3,11 +3,16 @@ require "git"
3
3
  class GitCopy
4
4
  @tempDir = './temp'
5
5
 
6
- def self.copyRepo(repoPath)
6
+ def self.copyRepo(repoPath, destPath = ".")
7
+ if destPath == "" || destPath == nil
8
+ destPath = "."
9
+ end
10
+
7
11
  ensureValidRepo(repoPath)
8
12
  `git clone #{repoPath} #{@tempDir}`
9
13
  `rm -rf #{@tempDir}/.git`
10
- `mv #{@tempDir}/* .`
14
+ `mkdir -p #{destPath}`
15
+ `mv #{@tempDir}/* #{destPath}`
11
16
  `rm -rf #{@tempDir}`
12
17
  end
13
18
 
@@ -17,9 +22,7 @@ class GitCopy
17
22
  end
18
23
 
19
24
  repoProtocol = GitProperties.repoProtocol(repoPath)
20
- repoName = GitProperties.repoName(repoPath)
21
25
  repoExtension = GitProperties.repoExtension(repoPath)
22
- repoDirname = GitProperties.repoDirName(repoPath)
23
26
 
24
27
  if repoProtocol != "http" || repoExtension != ".git"
25
28
  fatalError("Please provide a valid github repo")
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitcopy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Seijas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-28 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.10'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  description: Download the contents of a github repo without cloning it.
@@ -60,8 +60,8 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .DS_Store
64
- - .gitignore
63
+ - ".DS_Store"
64
+ - ".gitignore"
65
65
  - CODE_OF_CONDUCT.md
66
66
  - Gemfile
67
67
  - LICENSE.txt
@@ -84,17 +84,17 @@ require_paths:
84
84
  - lib
85
85
  required_ruby_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.0.14
97
+ rubygems_version: 2.6.12
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Download the contents of a github repo without cloning it.