from_git 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +17 -0
- data/LICENSE +22 -0
- data/README.md +17 -0
- data/Rakefile +1 -0
- data/from_git.gemspec +21 -0
- data/lib/rubygems/commands/from_git_command.rb +67 -0
- data/lib/rubygems_plugin.rb +1 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5e1d3f040e0632e0743ef8036a6f16820b9eb1ad
|
4
|
+
data.tar.gz: 975b56c738bd434cde525995ed9b082fec719b95
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 288e371d6a072abe278f345329cd50daaf2b696f03d2dc1145a57d461b00020900afd2d5eb141a4a6f298bc69c205b5285c6848f9569397fc4006c1f2b9c032f
|
7
|
+
data.tar.gz: c4e442f95b105e9d460134fc2f7ae4026e55a9ceba008b7dccaeca984fec154899a3ce0e1948c902a33e5db4f3314c257446c3fbc05b1cdcd6d736b66666fffa
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Boris Staal
|
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,17 @@
|
|
1
|
+
# FromGit
|
2
|
+
|
3
|
+
FromGit is a tiny and straightforward rubygems plugin allowing you to install gem from git repositories.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
gem install from_git
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
```bash
|
14
|
+
gem from_git [git repo url] -b [branch to use]
|
15
|
+
```
|
16
|
+
|
17
|
+
And that's pretty much it.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/from_git.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
|
4
|
+
s.name = "from_git"
|
5
|
+
s.description = %q{Allows you to install gem from git repository"}
|
6
|
+
s.summary = s.description
|
7
|
+
s.authors = ["Boris Staal"]
|
8
|
+
s.email = "boris@staal.io"
|
9
|
+
s.homepage = "http://github.com/inossidabile/from_git"
|
10
|
+
s.version = "0.1.0"
|
11
|
+
s.license = "MIT"
|
12
|
+
|
13
|
+
s.files = `git ls-files`.split($/)
|
14
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
|
18
|
+
s.add_dependency "colored"
|
19
|
+
s.add_development_dependency "bundler", "~> 1.3"
|
20
|
+
s.add_development_dependency "rake"
|
21
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'rubygems/command_manager'
|
2
|
+
|
3
|
+
class Gem::Commands::FromGitCommand < Gem::Command
|
4
|
+
|
5
|
+
def description
|
6
|
+
"Allows you to install gem from git repository"
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
super 'from_git', description
|
11
|
+
|
12
|
+
add_option('-b', '--branch LOCATION', arguments) do |branch|
|
13
|
+
options[:branch] = branch
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def arguments
|
19
|
+
"PATH https://github.com/user/repo.git"
|
20
|
+
"BRANCH Git branch to use"
|
21
|
+
end
|
22
|
+
|
23
|
+
def usage
|
24
|
+
"#{program_name} [LOCATION] -b [BRANCH]"
|
25
|
+
end
|
26
|
+
|
27
|
+
def execute
|
28
|
+
require 'fileutils'
|
29
|
+
require 'tempfile'
|
30
|
+
require 'colored'
|
31
|
+
|
32
|
+
destination = Dir.mktmpdir
|
33
|
+
|
34
|
+
begin
|
35
|
+
error "No repository specified" unless options[:args].length > 0
|
36
|
+
|
37
|
+
run "git clone #{options[:args][0]} #{destination}", "Error cloning repository"
|
38
|
+
|
39
|
+
Dir.chdir destination do
|
40
|
+
if options[:branch]
|
41
|
+
run "git checkout #{options[:branch]}", "Error checkouting branch"
|
42
|
+
end
|
43
|
+
|
44
|
+
run "gem build *.gemspec", "Error building gem"
|
45
|
+
run "gem install *.gem", "Error installing gem"
|
46
|
+
end
|
47
|
+
|
48
|
+
puts "Done".green
|
49
|
+
exit 0
|
50
|
+
ensure
|
51
|
+
FileUtils.rm_rf destination
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def run(command, error_message)
|
58
|
+
system(command) || error(error_message)
|
59
|
+
end
|
60
|
+
|
61
|
+
def error(string)
|
62
|
+
puts string.red
|
63
|
+
exit 1
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
Gem::CommandManager.instance.register_command :from_git
|
@@ -0,0 +1 @@
|
|
1
|
+
require "rubygems/commands/from_git_command"
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: from_git
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Boris Staal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colored
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Allows you to install gem from git repository"
|
56
|
+
email: boris@staal.io
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- .gitignore
|
62
|
+
- Gemfile
|
63
|
+
- Gemfile.lock
|
64
|
+
- LICENSE
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- from_git.gemspec
|
68
|
+
- lib/rubygems/commands/from_git_command.rb
|
69
|
+
- lib/rubygems_plugin.rb
|
70
|
+
homepage: http://github.com/inossidabile/from_git
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.0.6
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Allows you to install gem from git repository"
|
94
|
+
test_files: []
|