gemrepublica 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +66 -0
- data/Rakefile +2 -0
- data/bin/gemrepublica +58 -0
- data/gemrepublica.gemspec +26 -0
- data/lib/gemrepublica.rb +7 -0
- data/lib/gemrepublica/version.rb +3 -0
- metadata +110 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjBmMzIzNmVkNzQzZTM5NmY0NjgzYmU1YmJlN2I4Mzk3YWE1ZjNlNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NmE3OWIzZGVjMzc0NjJmNmYzMWZmNGJhZTQwZTYzMTdkOGUyM2NjNA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MmFiM2RmZTk3MzljODI0MzBhNmMxOWEyZDliN2VlY2M1NDJlZDgwZjNmNGYw
|
10
|
+
NDI3MTczNTlkYWI4NmQ0M2VmM2U0ZDkwOTNjMGE5OWMyNGI3OGY2YmM0NzFl
|
11
|
+
Njc2Y2E0NjY0OWQ3Mjc2MmMzYzUzODJmMWNhMjY1YTg5OGUzNGE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTY0YjM0M2NlMDM3ODZkZTkwYTI4ZmJkNzRhYWMyMTlhN2NlNTI0MjNjNjk5
|
14
|
+
NDVjNTJkMjQ5ODA1Y2QyNzBjZjU4YjU1NjM2NjMwODIxZGJhZDNmZDFmZjEx
|
15
|
+
YzViZGY0M2I2YzI0Mjc0MzU4OTFkNzcwM2U2MzRiZGJkODkwNTU=
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
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
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Felix Wolfsteller
|
2
|
+
|
3
|
+
MIT License
|
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:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# GemRepublica
|
2
|
+
|
3
|
+
Ruby gems are great. The community of developers is nice. Contributions are welcome and efforts well-received.
|
4
|
+
|
5
|
+
With gemrepublica it becomes even easier to clone the code of a given gem and start hacking.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install with:
|
10
|
+
|
11
|
+
$ gem install gemrepublica
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Currently, gemrepublica ships with a single executable,
|
16
|
+
|
17
|
+
gemrepublica
|
18
|
+
|
19
|
+
While `gemrepublica --help` will give you a basic help, you usually want to call it like
|
20
|
+
|
21
|
+
$ gemrepublica <gem name> <location for clone>
|
22
|
+
|
23
|
+
This will clone the gems source (if it can be found) to the given location.
|
24
|
+
|
25
|
+
For example
|
26
|
+
|
27
|
+
$ gemrepublica gemrepublica /home/fwolfst/dollies/
|
28
|
+
|
29
|
+
will create a git clone of this repository in `/home/fwolfst/dollies/gemrepublica`. It's as easy as that!
|
30
|
+
|
31
|
+
## Rationale
|
32
|
+
|
33
|
+
You want to get coding in zero seconds.
|
34
|
+
|
35
|
+
## Limitations
|
36
|
+
|
37
|
+
* Currently, `gemrepublica` only works if the source code link is specified by the maintainer on the rubygems.org homepage and if it points to a github repository.
|
38
|
+
|
39
|
+
* Currently, `gemrepublica` will only clone the HEAD of that github repository.
|
40
|
+
|
41
|
+
Unfortunately, the source code link on rubygems.org has to be specified via its interface. I proposed including it in the Gem-Specification, where I hope it will end one day - probably in the 'metadata' (see https://github.com/rubygems/rubygems/issues/1007).
|
42
|
+
|
43
|
+
I also proposed to consume this metadata key on the rubygems.org homepage (see https://github.com/rubygems/rubygems.org/issues/718).
|
44
|
+
|
45
|
+
## Naming
|
46
|
+
|
47
|
+
We are the people and own code! And create replica of gems easily.
|
48
|
+
|
49
|
+
## Roadmap
|
50
|
+
|
51
|
+
- fix TODOs indicated in code comments.
|
52
|
+
- allow specification of version, check out that tag if existing.
|
53
|
+
- consider switching to thor or rake.
|
54
|
+
- play well with git repositories that are not on github.
|
55
|
+
- allow easy branch creation.
|
56
|
+
- play well with other VCS like svn or mercurial/hg.
|
57
|
+
- implement --fork switch.
|
58
|
+
|
59
|
+
## Contributing
|
60
|
+
|
61
|
+
1. Mail me.
|
62
|
+
2. Fork it ( https://github.com/[my-github-username]/gemrepublica/fork )
|
63
|
+
3. Create your feature branch (`git checkout -b my-new-feature`)
|
64
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
65
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
66
|
+
6. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/gemrepublica
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'gemrepublica'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
program_name = File.basename __FILE__
|
8
|
+
|
9
|
+
optparse = OptionParser.new do |opts|
|
10
|
+
opts.banner = "Usage: #{program_name} <gem_name> <location_of_clone>"
|
11
|
+
end
|
12
|
+
|
13
|
+
optparse.parse!
|
14
|
+
|
15
|
+
# Check required positional arguments.
|
16
|
+
if ARGV.length != 2
|
17
|
+
STDERR.puts "Need to specify gem_name and location_of_clone."
|
18
|
+
STDERR.puts optparse.help
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
|
22
|
+
# Acquire gem info.
|
23
|
+
gem_info = Gems.info(ARGV[0])
|
24
|
+
if gem_info.nil? || gem_info.empty?
|
25
|
+
STDERR.puts "Could not find anything about '#{ARGV[0]}' at rubygems.org."
|
26
|
+
exit 2
|
27
|
+
end
|
28
|
+
|
29
|
+
if gem_info['source_code_uri'].nil? || gem_info['source_code_uri'].empty?
|
30
|
+
STDERR.puts "'#{ARGV[0]}' does not have a source_code_uri specified.."
|
31
|
+
exit 3
|
32
|
+
# TODO Now, we could give the user pointers, to
|
33
|
+
# 1) the project owners name
|
34
|
+
# 2) the projects bug tracker to file an issue
|
35
|
+
# 3) the project page
|
36
|
+
# Also, we could check if the project page looks like a github (or other
|
37
|
+
# repository) uri.
|
38
|
+
end
|
39
|
+
|
40
|
+
repo_adress = gem_info['source_code_uri']
|
41
|
+
if !(repo_adress =~ /github/)
|
42
|
+
STDERR.puts "#{repo_adress} seems not to be a github repository."
|
43
|
+
exit 4
|
44
|
+
end
|
45
|
+
|
46
|
+
# TODO Check if license is sensible, warn otherwise.
|
47
|
+
|
48
|
+
# TODO Create ARGV[1]
|
49
|
+
git_repo = Git::clone(repo_adress, gem_info['name'], :path => ARGV[1])
|
50
|
+
if git_repo.nil?
|
51
|
+
STDERR.puts "Cloning of github repository #{repo_adress} into #{ARGV[1]} failed."
|
52
|
+
exit 5
|
53
|
+
end
|
54
|
+
|
55
|
+
puts "Successfully cloned #{repo_adress} into #{ARGV[1]}."
|
56
|
+
|
57
|
+
# Be nice, explicitely exit with success.
|
58
|
+
exit 0
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gemrepublica/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gemrepublica"
|
8
|
+
spec.version = GemRepublica::VERSION
|
9
|
+
spec.authors = ["Felix Wolfsteller"]
|
10
|
+
spec.email = ["felix.wolfsteller@gmail.com"]
|
11
|
+
spec.summary = %q{Shortcut to clone a gems code}
|
12
|
+
spec.description = %q{GemRepublica lets you clone a gems github repository}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'gems', "~> 0.8"
|
22
|
+
spec.add_dependency 'git', "~> 1.2"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
25
|
+
spec.add_development_dependency "rake"
|
26
|
+
end
|
data/lib/gemrepublica.rb
ADDED
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gemrepublica
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Felix Wolfsteller
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: gems
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: git
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: GemRepublica lets you clone a gems github repository
|
70
|
+
email:
|
71
|
+
- felix.wolfsteller@gmail.com
|
72
|
+
executables:
|
73
|
+
- gemrepublica
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/gemrepublica
|
83
|
+
- gemrepublica.gemspec
|
84
|
+
- lib/gemrepublica.rb
|
85
|
+
- lib/gemrepublica/version.rb
|
86
|
+
homepage: ''
|
87
|
+
licenses:
|
88
|
+
- MIT
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.2.2
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: Shortcut to clone a gems code
|
110
|
+
test_files: []
|