gem-git-install 1.0.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 +7 -0
- data/.gitignore +9 -0
- data/README.md +19 -0
- data/gem-git-install.gemspec +19 -0
- data/lib/rubygems/commands/gitinstall_command.rb +47 -0
- data/lib/rubygems_plugin.rb +3 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 301bb898627a0370fc69f43db27c681f99ada077
|
4
|
+
data.tar.gz: b20336f6be2693bce16248419e5aeb458f50e8bf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f9bc4b84ea8e5fa7bb7c400fa3c5758163aa2f2a4609b79e4cfa7f436d7774da59da34200c1adcef5c8125203d175170cb099de30bb4606b61b4fb8c33975bc8
|
7
|
+
data.tar.gz: e9d0a854920b2f0457873c2ce9a786f6af513da75578ce69d0d304058bc744cea84ec504f3b719107b615c7affb29e9e86d868cee1b8fc4cc7e09554b566ff97
|
data/.gitignore
ADDED
data/README.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Gem::Git::Install
|
2
|
+
|
3
|
+
This is a simple rubygems plugin that allows you to install a gem from any git repo
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install gem-git-install
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
$ gem gitinstall your_git_repo
|
12
|
+
|
13
|
+
## Contributing
|
14
|
+
|
15
|
+
1. Fork it ( https://github.com/[my-github-username]/gem-git-install/fork )
|
16
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
17
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
18
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
19
|
+
5. Create a new Pull Request
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "gem-git-install"
|
6
|
+
spec.version = "1.0.0"
|
7
|
+
spec.authors = ["Cristian Bica"]
|
8
|
+
spec.email = ["cristian.bica@gmail.com"]
|
9
|
+
|
10
|
+
spec.summary = %q{Install gem from a git repo}
|
11
|
+
spec.description = %q{Install gem from a git repository. This gem clones the given repo, build the gem and installs it.}
|
12
|
+
spec.homepage = "https://github.com/cristianbica/gem-git-install"
|
13
|
+
|
14
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
+
spec.require_paths = ["lib"]
|
16
|
+
|
17
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
18
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
19
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems/command'
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
class Gem::Commands::GitinstallCommand < Gem::Command
|
5
|
+
def initialize
|
6
|
+
super 'gitinstall', "Install gem from a git repo"
|
7
|
+
add_option '--force', 'skip validation of the gemspec' do |value, options|
|
8
|
+
options[:force] = true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def execute
|
13
|
+
url = get_one_gem_name
|
14
|
+
Dir.mktmpdir "gemgitinstall" do |dir|
|
15
|
+
clone_repo(url, dir)
|
16
|
+
build_gem(dir)
|
17
|
+
install_gem(dir)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def clone_repo(url, dir)
|
22
|
+
run "git clone #{url} #{dir}"
|
23
|
+
end
|
24
|
+
|
25
|
+
def build_gem(dir)
|
26
|
+
force = options[:force] ? " --force" : ""
|
27
|
+
run "cd #{dir} && rm -rf *.gem"
|
28
|
+
run "cd #{dir} && gem build *.gemspec#{force}"
|
29
|
+
end
|
30
|
+
|
31
|
+
def install_gem(dir)
|
32
|
+
run "cd #{dir} && gem install *.gem"
|
33
|
+
end
|
34
|
+
|
35
|
+
def run(cmd)
|
36
|
+
puts "Executing: #{cmd}"
|
37
|
+
system cmd
|
38
|
+
end
|
39
|
+
|
40
|
+
def arguments # :nodoc:
|
41
|
+
"GEMNAME name of gem to install"
|
42
|
+
end
|
43
|
+
|
44
|
+
def usage # :nodoc:
|
45
|
+
"#{program_name} GEMNAME"
|
46
|
+
end
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gem-git-install
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cristian Bica
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Install gem from a git repository. This gem clones the given repo, build
|
42
|
+
the gem and installs it.
|
43
|
+
email:
|
44
|
+
- cristian.bica@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- README.md
|
51
|
+
- gem-git-install.gemspec
|
52
|
+
- lib/rubygems/commands/gitinstall_command.rb
|
53
|
+
- lib/rubygems_plugin.rb
|
54
|
+
homepage: https://github.com/cristianbica/gem-git-install
|
55
|
+
licenses: []
|
56
|
+
metadata: {}
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 2.4.5
|
74
|
+
signing_key:
|
75
|
+
specification_version: 4
|
76
|
+
summary: Install gem from a git repo
|
77
|
+
test_files: []
|
78
|
+
has_rdoc:
|