gpr 0.3.0 → 0.4.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 +4 -4
- data/.gitignore +9 -22
- data/LICENSE.txt +17 -18
- data/README.md +33 -2
- data/Rakefile +0 -36
- data/bin/console +7 -0
- data/bin/setup +5 -0
- data/{bin → exe}/gpr +0 -0
- data/gpr.gemspec +10 -9
- data/lib/gpr.rb +1 -0
- data/lib/gpr/commands/get.rb +3 -1
- data/lib/gpr/invalid_repository_error.rb +4 -0
- data/lib/gpr/main.rb +1 -1
- data/lib/gpr/version.rb +1 -1
- metadata +16 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa4fc1ed69c865b1a15d21b89b6723947f585218
|
4
|
+
data.tar.gz: 96d195f4a130cda6c95a34dfc78873ba886369b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e98b8d7a391a1e683ebf6446f4ccc6ca55980b8d204cf278d1ceb8637e410b4727e510a0d75133f41200bdb66b1bba5e4bf51ce8e338e9fda248260af5c4952
|
7
|
+
data.tar.gz: 4ae9cd2602e377e3b68898caa3e98c0f0ebfab5b37b74d73e65b43e83cecf3506a02653577181ede88e7919c9bc0f1b76289cf8b8310cf152405e9b797c4520c
|
data/.gitignore
CHANGED
@@ -1,22 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2015 kaihar4
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the following conditions:
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
12
11
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
15
14
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF
|
22
|
-
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Gpr
|
2
2
|
|
3
|
-
Gitkeeper.
|
3
|
+
Gitkeeper - Pluggable Repository Manager.
|
4
4
|
|
5
5
|
## Description
|
6
6
|
|
@@ -10,14 +10,31 @@ Behave like a `go get` of Golang.
|
|
10
10
|
|
11
11
|
For example, all repositories are cloned to `$HOME/.gpr/<host>/<user>/<repository>`.
|
12
12
|
|
13
|
-
It is possible to centrally manage of the all repositories.
|
13
|
+
It is possible to centrally manage of the all repositories, and extend the function using [plugins](https://github.com/search?utf8=✓&q=user%3Akaihar4+gpr%5C&type=Repositories&ref=searchresults).
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
17
|
+
Install as minimal.
|
18
|
+
|
17
19
|
```sh
|
18
20
|
$ gem install gpr
|
19
21
|
```
|
20
22
|
|
23
|
+
Or, extend the function using [plugins](https://github.com/search?utf8=✓&q=user%3Akaihar4+gpr%5C&type=Repositories&ref=searchresults).
|
24
|
+
|
25
|
+
```sh
|
26
|
+
$ cd /usr/local/bin
|
27
|
+
$ bundle init
|
28
|
+
$ vi Gemfile
|
29
|
+
source 'https://rubygems.org'
|
30
|
+
|
31
|
+
gem 'gpr'
|
32
|
+
gem 'gpr-select'
|
33
|
+
gem 'gpr-search'
|
34
|
+
gem 'gpr-status'
|
35
|
+
$ bundle install --path vendor/bundle --binstubs ./
|
36
|
+
```
|
37
|
+
|
21
38
|
## Requirements
|
22
39
|
|
23
40
|
* Ruby 2.1.0 or higher
|
@@ -56,3 +73,17 @@ Show all registered repositories
|
|
56
73
|
```sh
|
57
74
|
$ export GPR_ROOT=$HOME/develop
|
58
75
|
```
|
76
|
+
|
77
|
+
## Development
|
78
|
+
|
79
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
80
|
+
|
81
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
82
|
+
|
83
|
+
## Contributing
|
84
|
+
|
85
|
+
1. Fork it ( https://github.com/kaihar4/gpr/fork )
|
86
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
87
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
88
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
89
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,37 +1 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
-
|
3
|
-
namespace :zsh do
|
4
|
-
COMPLETION_PATH = "source #{File.dirname(__FILE__)}/zsh/gpr.zsh"
|
5
|
-
|
6
|
-
desc 'Install the zsh completion'
|
7
|
-
task :install do
|
8
|
-
if ENV['SHELL'].include?('zsh')
|
9
|
-
File.open("#{ENV['HOME']}/.zshrc", 'a+') do |file|
|
10
|
-
file.flock(File::LOCK_EX)
|
11
|
-
|
12
|
-
body = file.read
|
13
|
-
unless body.include?(COMPLETION_PATH)
|
14
|
-
file.puts COMPLETION_PATH
|
15
|
-
puts "Done.\nPlease execute 'source ~/.zshrc'."
|
16
|
-
end
|
17
|
-
end
|
18
|
-
else
|
19
|
-
puts 'Please change default shell to zsh.'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
desc 'Clean the zsh completion'
|
24
|
-
task :clean do
|
25
|
-
File.open("#{ENV['HOME']}/.zshrc", 'r+') do |file|
|
26
|
-
file.flock(File::LOCK_EX)
|
27
|
-
|
28
|
-
body = file.read
|
29
|
-
if body.include?(COMPLETION_PATH)
|
30
|
-
file.rewind
|
31
|
-
file.write(body.gsub(/#{COMPLETION_PATH}\n/, ''))
|
32
|
-
file.truncate(file.tell)
|
33
|
-
puts "Done.\nPlease execute 'source ~/.zshrc'."
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/{bin → exe}/gpr
RENAMED
File without changes
|
data/gpr.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
2
3
|
require 'gpr/version'
|
3
4
|
|
4
5
|
Gem::Specification.new do |spec|
|
@@ -6,19 +7,19 @@ Gem::Specification.new do |spec|
|
|
6
7
|
spec.version = Gpr::VERSION
|
7
8
|
spec.authors = ['kaihar4']
|
8
9
|
spec.email = ['kaihar4@gmail.com']
|
9
|
-
spec.summary = 'Gitkeeper
|
10
|
+
spec.summary = 'Gitkeeper - Pluggable Repository Manager'
|
10
11
|
spec.description = spec.summary
|
11
12
|
spec.homepage = 'https://github.com/kaihar4/gpr'
|
12
13
|
spec.license = 'MIT'
|
13
14
|
|
14
|
-
spec.files = `git ls-files -z`.split("\x0")
|
15
|
-
spec.
|
16
|
-
spec.
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.bindir = 'exe'
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
|
17
18
|
spec.require_paths = ['lib']
|
18
19
|
|
19
|
-
spec.
|
20
|
-
spec.
|
20
|
+
spec.add_runtime_dependency 'thor'
|
21
|
+
spec.add_runtime_dependency 'safe_colorize'
|
21
22
|
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
23
|
-
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
25
|
end
|
data/lib/gpr.rb
CHANGED
data/lib/gpr/commands/get.rb
CHANGED
@@ -10,7 +10,7 @@ module Gpr
|
|
10
10
|
desc 'get', 'Get a repository'
|
11
11
|
def get(param)
|
12
12
|
host, user, repository =
|
13
|
-
param.match(/.+(\/\/|@)(.+)\.git$/)[2].split(/(:|\/)/).delete_if.with_index {
|
13
|
+
param.match(/.+(\/\/|@)(.+)\.git$/)[2].split(/(:|\/)/).delete_if.with_index {|_c, index| index.odd? }
|
14
14
|
path = "#{::Gpr::APP_PATH}/#{host}/#{user}/#{repository}"
|
15
15
|
|
16
16
|
if Dir.exist?(path)
|
@@ -19,6 +19,8 @@ module Gpr
|
|
19
19
|
end
|
20
20
|
|
21
21
|
`git clone #{param} #{path}`
|
22
|
+
rescue NoMethodError
|
23
|
+
raise InvalidRepositoryError, "invalid repository format `#{param}`"
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/lib/gpr/main.rb
CHANGED
data/lib/gpr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaihar4
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -44,29 +44,29 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.9'
|
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
|
-
version: '1.
|
54
|
+
version: '1.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '10.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
description: Gitkeeper
|
68
|
+
version: '10.0'
|
69
|
+
description: Gitkeeper - Pluggable Repository Manager
|
70
70
|
email:
|
71
71
|
- kaihar4@gmail.com
|
72
72
|
executables:
|
@@ -79,7 +79,9 @@ files:
|
|
79
79
|
- LICENSE.txt
|
80
80
|
- README.md
|
81
81
|
- Rakefile
|
82
|
-
- bin/
|
82
|
+
- bin/console
|
83
|
+
- bin/setup
|
84
|
+
- exe/gpr
|
83
85
|
- gpr.gemspec
|
84
86
|
- lib/gpr.rb
|
85
87
|
- lib/gpr/action.rb
|
@@ -87,6 +89,7 @@ files:
|
|
87
89
|
- lib/gpr/commands/get.rb
|
88
90
|
- lib/gpr/commands/list.rb
|
89
91
|
- lib/gpr/commands/version.rb
|
92
|
+
- lib/gpr/invalid_repository_error.rb
|
90
93
|
- lib/gpr/main.rb
|
91
94
|
- lib/gpr/version.rb
|
92
95
|
homepage: https://github.com/kaihar4/gpr
|
@@ -109,8 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
112
|
version: '0'
|
110
113
|
requirements: []
|
111
114
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.5.1
|
113
116
|
signing_key:
|
114
117
|
specification_version: 4
|
115
|
-
summary: Gitkeeper
|
118
|
+
summary: Gitkeeper - Pluggable Repository Manager
|
116
119
|
test_files: []
|