specific_install 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/lib/rubygems/commands/specific_install_command.rb +86 -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 = "specific_install"
|
4
|
+
s.summary = "rubygems plugin that allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL"
|
5
|
+
s.email = "rogerdpack@gmail.com"
|
6
|
+
s.homepage = "http://github.com/rdp/specific_installs"
|
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,86 @@
|
|
1
|
+
require 'rubygems/command_manager'
|
2
|
+
|
3
|
+
class Gem::Commands::SpecificInstallCommand < Gem::Command
|
4
|
+
|
5
|
+
def description
|
6
|
+
"Allows you to install an \"edge\" gem straight from its github repository or from a web site"
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
super 'specific_install', description
|
11
|
+
add_option('-l', '--location LOCATION', arguments) do |location|
|
12
|
+
options[:location] = location
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def arguments
|
17
|
+
"LOCATION like http://github.com/rdp/ruby_tutorials_core or git://github.com/rdp/ruby_tutorials_core.git or http://host/gem_name.gem"
|
18
|
+
end
|
19
|
+
|
20
|
+
def usage
|
21
|
+
"#{program_name} [LOCATION]"
|
22
|
+
end
|
23
|
+
|
24
|
+
def execute
|
25
|
+
require 'tempfile'
|
26
|
+
require 'backports'
|
27
|
+
require 'fileutils'
|
28
|
+
if loc = options[: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
|
+
# http://host/gem_name.gem
|
35
|
+
dir = Dir.mktmpdir
|
36
|
+
if loc.start_with?('http://') && loc.end_with?('.gem')
|
37
|
+
Dir.chdir dir do
|
38
|
+
say "downloading #{loc}"
|
39
|
+
system("wget #{loc}")
|
40
|
+
if install_gemspec
|
41
|
+
puts "successfully installed"
|
42
|
+
else
|
43
|
+
puts "failed"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
elsif !loc.end_with?('.git')
|
47
|
+
say 'error: must end with .git to be a git repository'
|
48
|
+
else
|
49
|
+
say 'git installing from ' + loc
|
50
|
+
system("git clone #{loc} #{dir}")
|
51
|
+
Dir.chdir dir do
|
52
|
+
for command in ['', 'rake gemspec', 'rake gem', 'rake build', 'rake package'] do
|
53
|
+
system command
|
54
|
+
if install_gemspec
|
55
|
+
puts 'successfully installed'
|
56
|
+
return
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
FileUtils.rm_rf dir # just in case [?]
|
62
|
+
else
|
63
|
+
say 'location is required'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def install_gemspec
|
70
|
+
if gemspec = Dir['*.gemspec'][0]
|
71
|
+
system("gem build #{gemspec}")
|
72
|
+
system("gem install *.gem")
|
73
|
+
true
|
74
|
+
else
|
75
|
+
if gem = Dir['**/*.gem'][0]
|
76
|
+
system("gem install #{gem}")
|
77
|
+
true
|
78
|
+
else
|
79
|
+
false
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
Gem::CommandManager.instance.register_command :specific_install
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rubygems/commands/specific_install_command'
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: specific_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/specific_install_command.rb
|
69
|
+
- lib/rubygems_plugin.rb
|
70
|
+
has_rdoc: true
|
71
|
+
homepage: http://github.com/rdp/specific_installs
|
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 that allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL
|
100
|
+
test_files: []
|
101
|
+
|