dotstrap 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd3686fadc94d86089ff7e8f40bdfa7db43af085
4
- data.tar.gz: 3560bdacbc4e53321dd17cb4f7cbfbcbe96aa32e
3
+ metadata.gz: d0ccd6c31b5b1e94988783114e9913c1a407354f
4
+ data.tar.gz: 6b7703c9ac39592e8f334160e8d523d387c248de
5
5
  SHA512:
6
- metadata.gz: a7028c7cd87665264456a2bab5e467ee7ddbda601299927971d452078fd37cd9866b4308a13bd0f2084fdfed4ced05075e7851fa7f4c47f2088fa491296e202c
7
- data.tar.gz: 14b3269d4a36cd5525a1ea3ff23bcfd5e1171a097f9cdfa1bc459b2636d424c2d0ba46a2201469ee8e33e1b7565465f87e1095201b956d9b5ba67e44d6379602
6
+ metadata.gz: 6b9890ddd3308ea41aceab5b77c08de8a29df6b0e597c4ac37a6dab8e9c1515401391c5e9e1af866c25939fba15edd8bafcdb7251ba37c1d443c156028e45f67
7
+ data.tar.gz: 0621d62ce0124555940e435aa5bf59f1e0f0665ab6d39e5107a8508478d39cafd5a77580266147fc38dd21b103dc6b041d14b29e1ccc1f5bb9eeed3b59c6d736
data/Rakefile CHANGED
@@ -22,7 +22,7 @@ Jeweler::Tasks.new do |gem|
22
22
  # gem.email = Dotstrap::EMAIL
23
23
  gem.authors = Dotstrap::AUTHOR
24
24
  gem.require_paths = ['lib']
25
- gem.executables = ['ds']
25
+ gem.executables = [Dotstrap::EXE_NAME]
26
26
  gem.required_ruby_version = '>=1.9.2'
27
27
  gem.metadata = { 'source_code' => Dotstrap::SOURCE_URL,
28
28
  'documentation' => Dotstrap::DOC_URL
@@ -24,7 +24,9 @@ $LOG.formatter = proc do |severity, datetime, progname, msg|
24
24
  end
25
25
 
26
26
  def __repo_format_desc; <<-DESC
27
- REPO is a GitHub repository slug in the form: `username/repository`
27
+ REPO is either:
28
+ \x5 - a GitHub repository clone URL
29
+ \x5 - a GitHub repository slug in the form: `username/repository`
28
30
 
29
31
  If REPO is a file: read a newline seperated list of repositories
30
32
  (in the form specified above)
@@ -71,7 +73,7 @@ module Dotstrap
71
73
  \x5 $ ds install ~/.config/repos.txt
72
74
  LONGDESC
73
75
  def install(repo, *args)
74
- args << repo # so thor will complain when you call `install` with no args
76
+ args << repo # so thor will not complain when you call `install` with no args
75
77
  repos = []
76
78
  args.each do |repo|
77
79
  if File.exist?(repo)
data/dotstrap.gemspec CHANGED
@@ -2,19 +2,19 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: dotstrap 0.1.2 ruby lib
5
+ # stub: dotstrap 0.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "dotstrap"
9
- s.version = "0.1.2"
9
+ s.version = "0.2.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.metadata = { "documentation" => "http://www.rubydoc.info/github/mkwmms/dotstrap/master/Dotstrap", "source_code" => "http://github.com/mkwmms/dotstrap" } if s.respond_to? :metadata=
13
13
  s.require_paths = ["lib"]
14
14
  s.authors = ["William Myers"]
15
- s.date = "2015-11-16"
15
+ s.date = "2015-12-13"
16
16
  s.description = "bootstrap your shell dotfiles in parallel from GitHub repos"
17
- s.executables = ["ds"]
17
+ s.executables = ["dotstrap"]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE.txt",
20
20
  "README.md"
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  "LICENSE.txt",
28
28
  "README.md",
29
29
  "Rakefile",
30
- "bin/ds",
30
+ "bin/dotstrap",
31
31
  "dotstrap.gemspec",
32
32
  "lib/dotstrap.rb",
33
33
  "lib/dotstrap/git.rb",
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
39
39
  s.homepage = "http://github.com/mkwmms/dotstrap"
40
40
  s.licenses = ["MIT"]
41
41
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
42
- s.rubygems_version = "2.4.8"
42
+ s.rubygems_version = "2.4.5.1"
43
43
  s.summary = "bootstrap your shell dotfiles in parallel from GitHub repos"
44
44
 
45
45
  if s.respond_to? :specification_version then
data/lib/dotstrap/git.rb CHANGED
@@ -4,18 +4,14 @@ require 'logger'
4
4
  module Dotstrap
5
5
  # TODO: split this into Git < Downloader class
6
6
  class Dotstrap::Git
7
- attr_accessor :url, :repo,
8
- :repo_path, :repo_name,
9
- :github_user, :github_project
7
+ attr_accessor :url, :repo, :repo_path, :repo_owner, :repo_name
10
8
 
11
9
  def initialize(repo, dest_dir = Dotstrap.config_home)
12
- @repo = repo
10
+ @repo = determine_repo_slug(repo)
13
11
  # TODO: allow an option to specify to download with SSH or HTTPs from Git
14
- @url = "https://github.com/#{@repo}"
15
- partition = @repo.partition("/")
16
- @github_user = partition[0]
17
- @github_project = @repo_name = partition[2]
18
- @repo_path = File.join(dest_dir, "#{@github_user}-#{@repo_name}")
12
+ @url = determine_url(@repo)
13
+ @repo_owner, @repo_name = split_repo_slug(@repo)
14
+ @repo_path = File.join(dest_dir, "#{@repo_owner}-#{@repo_name}")
19
15
  # @repo_path = File.join(dest_dir, @github_user, @repo_name)
20
16
  end
21
17
 
@@ -41,6 +37,22 @@ module Dotstrap
41
37
 
42
38
  private
43
39
 
40
+ def determine_repo_slug(repo)
41
+ return repo unless repo.start_with?("http", "git@")
42
+ repo = repo.gsub(/(https?:\/\/github.com\/)|(git@github.com:)/,"")
43
+ repo = repo.gsub(/.git/,"")
44
+ end
45
+
46
+ def determine_url(repo)
47
+ return repo if repo.start_with?("http", "git@")
48
+ "https://github.com/#{repo}"
49
+ end
50
+
51
+ def split_repo_slug(repo, sep = "/")
52
+ partition = repo.partition(sep)
53
+ return partition[0], partition[2]
54
+ end
55
+
44
56
  def git_verbosity
45
57
  if $LOG.debug?
46
58
  '--verbose'
data/lib/dotstrap.rb CHANGED
@@ -7,8 +7,8 @@ require_relative 'dotstrap/shell'
7
7
 
8
8
  module Dotstrap
9
9
  NAME = 'dotstrap'
10
- EXE_NAME = 'ds'
11
- VERSION = '0.1.2'
10
+ EXE_NAME = 'dotstrap'
11
+ VERSION = '0.2.0'
12
12
  AUTHOR = 'William Myers'
13
13
  HOMEPAGE = 'http://github.com/mkwmms/dotstrap'
14
14
  SOURCE_URL = 'http://github.com/mkwmms/dotstrap'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Myers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2015-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -153,7 +153,7 @@ dependencies:
153
153
  description: bootstrap your shell dotfiles in parallel from GitHub repos
154
154
  email:
155
155
  executables:
156
- - ds
156
+ - dotstrap
157
157
  extensions: []
158
158
  extra_rdoc_files:
159
159
  - LICENSE.txt
@@ -166,7 +166,7 @@ files:
166
166
  - LICENSE.txt
167
167
  - README.md
168
168
  - Rakefile
169
- - bin/ds
169
+ - bin/dotstrap
170
170
  - dotstrap.gemspec
171
171
  - lib/dotstrap.rb
172
172
  - lib/dotstrap/git.rb
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  requirements: []
198
198
  rubyforge_project:
199
- rubygems_version: 2.4.8
199
+ rubygems_version: 2.4.5.1
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: bootstrap your shell dotfiles in parallel from GitHub repos