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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 181c099a71a4666961a12dfd1c559b07474aeef6
4
- data.tar.gz: ba1d71e33a3c878c7aef476b0d32e827e60c0c95
3
+ metadata.gz: aa4fc1ed69c865b1a15d21b89b6723947f585218
4
+ data.tar.gz: 96d195f4a130cda6c95a34dfc78873ba886369b1
5
5
  SHA512:
6
- metadata.gz: f03d43703e429f2578aedca31c5f1c35690cc088364e7977eb1442c8deceab7e5155575deb66b4bde74f616108474510b9f2488da20962212632603303bd197a
7
- data.tar.gz: b67c9620dda2bac8bb686dcd83e794b63bdc0d37a28cd7071fe74907b74276ee991e9748d198909e43ddf64735543c00d81dc2d52bcaf438418054adb6f8243e
6
+ metadata.gz: 3e98b8d7a391a1e683ebf6446f4ccc6ca55980b8d204cf278d1ceb8637e410b4727e510a0d75133f41200bdb66b1bba5e4bf51ce8e338e9fda248260af5c4952
7
+ data.tar.gz: 4ae9cd2602e377e3b68898caa3e98c0f0ebfab5b37b74d73e65b43e83cecf3506a02653577181ede88e7919c9bc0f1b76289cf8b8310cf152405e9b797c4520c
data/.gitignore CHANGED
@@ -1,22 +1,9 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
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/
@@ -1,22 +1,21 @@
1
- Copyright (c) 2014 kaihar4
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) 2015 kaihar4
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
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
- included in all copies or substantial portions of the Software.
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
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'gpr'
5
+
6
+ require 'irb'
7
+ IRB.start
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install --path vendor/bundle
File without changes
@@ -1,4 +1,5 @@
1
- $LOAD_PATH << File.expand_path('../lib', __FILE__)
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.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
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.add_dependency 'thor'
20
- spec.add_dependency 'safe_colorize'
20
+ spec.add_runtime_dependency 'thor'
21
+ spec.add_runtime_dependency 'safe_colorize'
21
22
 
22
- spec.add_development_dependency 'bundler', '~> 1.6'
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
@@ -4,4 +4,5 @@ module Gpr
4
4
  @@commands = []
5
5
  end
6
6
 
7
+ require 'gpr/invalid_repository_error'
7
8
  require 'gpr/main'
@@ -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 { |_c, index| index.odd? }
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
@@ -0,0 +1,4 @@
1
+ module Gpr
2
+ class InvalidRepositoryError < StandardError
3
+ end
4
+ end
@@ -20,7 +20,7 @@ module Gpr
20
20
  end
21
21
 
22
22
  def self.load_commands
23
- @@commands.map { |command| command.new(self) }
23
+ @@commands.map {|command| command.new(self) }
24
24
  end
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Gpr
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaihar4
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
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.6'
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.6'
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/gpr
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.4.5
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: []