git_install 0.2.1
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.
- data/README +0 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/lib/rubygems/commands/git_install_command.rb +76 -0
- data/lib/rubygems_plugin.rb +1 -0
- metadata +101 -0
data/README
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'jeweler'
|
2
|
+
Jeweler::Tasks.new do |s|
|
3
|
+
s.name = "git_install"
|
4
|
+
s.summary = "rubygems plugin to allow you to install an \"edge\" gem straight from its github repository"
|
5
|
+
s.email = "rogerdpack@gmail.com"
|
6
|
+
s.homepage = "http://github.com/rdp/git_install"
|
7
|
+
s.authors = ["Roger Pack"]
|
8
|
+
s.add_development_dependency 'rspec'
|
9
|
+
s.add_development_dependency 'sane'
|
10
|
+
s.add_dependency 'backports'
|
11
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.1
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'rubygems/command_manager'
|
2
|
+
|
3
|
+
class Gem::Commands::GitInstallCommand < Gem::Command
|
4
|
+
|
5
|
+
def description
|
6
|
+
"Allows you to install an \"edge\" gem straight from its github repository (like -g git://github.com/rdp/ruby_tutorials_core.git)"
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
super 'git_install', description
|
11
|
+
add_option('-g', '--git_location GIT_LOCATION', arguments) do |git_location|
|
12
|
+
options[:git_location] = git_location
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def arguments
|
17
|
+
"GIT_LOCATION like http://github.com/rdp/ruby_tutorials_core or git://github.com/rdp/ruby_tutorials_core.git"
|
18
|
+
end
|
19
|
+
|
20
|
+
def usage
|
21
|
+
"#{program_name} [GIT_LOCATION]"
|
22
|
+
end
|
23
|
+
|
24
|
+
def execute
|
25
|
+
require 'tempfile'
|
26
|
+
require 'backports'
|
27
|
+
require 'fileutils'
|
28
|
+
if loc = options[:git_location]
|
29
|
+
# options are
|
30
|
+
# http://github.com/githubsvnclone/rdoc.git
|
31
|
+
# git://github.com/githubsvnclone/rdoc.git
|
32
|
+
# git@github.com:rdp/install_from_git.git
|
33
|
+
# http://github.com/rdp/install_from_git [later]
|
34
|
+
if !loc.end_with?('.git')
|
35
|
+
say 'error: must end with .git to be a git repository'
|
36
|
+
else
|
37
|
+
say 'git installing from ' + loc
|
38
|
+
dir = Dir.mktmpdir
|
39
|
+
system("git clone #{loc} #{dir}")
|
40
|
+
Dir.chdir dir do
|
41
|
+
for command in ['', 'rake gemspec', 'rake gem', 'rake build', 'rake package'] do
|
42
|
+
system command
|
43
|
+
if install_gemspec
|
44
|
+
puts 'gem installed'
|
45
|
+
return
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
FileUtils.rm_rf dir # just in case
|
50
|
+
end
|
51
|
+
|
52
|
+
else
|
53
|
+
say 'git location is required'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def install_gemspec
|
60
|
+
if gemspec = Dir['*.gemspec'][0]
|
61
|
+
system("gem build #{gemspec}")
|
62
|
+
system("gem install *.gem")
|
63
|
+
true
|
64
|
+
else
|
65
|
+
if gem = Dir['pkg/*.gem'][0]
|
66
|
+
system("gem install #{gem}")
|
67
|
+
true
|
68
|
+
else
|
69
|
+
false
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
Gem::CommandManager.instance.register_command :git_install
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rubygems/commands/git_install_command'
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: git_install
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Roger Pack
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-03-29 00:00:00 -06:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rspec
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :development
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: sane
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
42
|
+
type: :development
|
43
|
+
version_requirements: *id002
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: backports
|
46
|
+
prerelease: false
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
type: :runtime
|
55
|
+
version_requirements: *id003
|
56
|
+
description:
|
57
|
+
email: rogerdpack@gmail.com
|
58
|
+
executables: []
|
59
|
+
|
60
|
+
extensions: []
|
61
|
+
|
62
|
+
extra_rdoc_files:
|
63
|
+
- README
|
64
|
+
files:
|
65
|
+
- README
|
66
|
+
- Rakefile
|
67
|
+
- VERSION
|
68
|
+
- lib/rubygems/commands/git_install_command.rb
|
69
|
+
- lib/rubygems_plugin.rb
|
70
|
+
has_rdoc: true
|
71
|
+
homepage: http://github.com/rdp/git_install
|
72
|
+
licenses: []
|
73
|
+
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options:
|
76
|
+
- --charset=UTF-8
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
93
|
+
requirements: []
|
94
|
+
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 1.3.6
|
97
|
+
signing_key:
|
98
|
+
specification_version: 3
|
99
|
+
summary: rubygems plugin to allow you to install an "edge" gem straight from its github repository
|
100
|
+
test_files: []
|
101
|
+
|