specific_install 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +61 -0
- data/Rakefile +1 -11
- data/lib/rubygems/commands/specific_install_command.rb +133 -91
- data/lib/rubygems_plugin.rb +2 -1
- data/lib/specific_install/version.rb +3 -0
- data/specific_install.gemspec +28 -0
- metadata +101 -77
- data/README +0 -0
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 200b37d6e388e2fe9109554f0192664a9ebd6191
|
4
|
+
data.tar.gz: 1d26d7850c6a5e408cdafa17c3c9fb89797ffcca
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e7c82457045c1a5dc7d48b068a3d6e48dfa71b942fc5debbe8e720fe91ca1a2d5ab88e897d2e38c9c428254f599ae14913119f5f8c87c9231259d9147de9681
|
7
|
+
data.tar.gz: d6c83b266ca609012667703e5e7a6173899f04842d1d7500ff97714b7b8d25653dd892b51d720c69f29c5127ba144d97cce9ab1bd908865da01a2183ff13ef7d
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2010-2013 Roger Pack
|
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,61 @@
|
|
1
|
+
# Gem::SpecificInstall
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
gem 'specific_install'
|
8
|
+
|
9
|
+
And then execute:
|
10
|
+
|
11
|
+
$ bundle
|
12
|
+
|
13
|
+
Or install it yourself as:
|
14
|
+
|
15
|
+
$ gem install specific_install
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
A Rubygem plugin that allows you to install an "edge" gem straight from its github repository,
|
20
|
+
or install one from an arbitrary url web:
|
21
|
+
|
22
|
+
ex:
|
23
|
+
|
24
|
+
`
|
25
|
+
$ gem specific_install -l http://github.com/githubsvnclone/rdoc.git
|
26
|
+
`
|
27
|
+
|
28
|
+
### Additional Options
|
29
|
+
|
30
|
+
-l --location URL of resource
|
31
|
+
Formats of URL/Resource
|
32
|
+
* Full URL to HTTP Repo `https://github.com/rdp/specific_install.git`
|
33
|
+
* Full URL to Git Repo `git@github.com:rdp/specific_install.git`
|
34
|
+
* URL of Pre-Built Gem `http://example.com/specific_install.gem`
|
35
|
+
* Github Repo shortcode `rdp/specific_install`
|
36
|
+
|
37
|
+
-b --branch BRANCH to use for Gem creation
|
38
|
+
Branch option does a `git checkout BRANCH` before `gem build GEM`
|
39
|
+
Example:
|
40
|
+
`git specific_install -l rdp/specific_install -b pre-release`
|
41
|
+
Note: This feature is new and may not fail gracefully.
|
42
|
+
|
43
|
+
|
44
|
+
`git_install` is aliased to the behavior of `specific_install`
|
45
|
+
This alias is shorter and is more intention revealing of the gem's behavior.
|
46
|
+
## Internal Behavior
|
47
|
+
|
48
|
+
It runs `git clone`, and `rake install,` install the gem, then deletes the temp directory]
|
49
|
+
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
1. Fork it
|
54
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
55
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
56
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
57
|
+
5. Create new Pull Request
|
58
|
+
|
59
|
+
Enjoy!
|
60
|
+
|
61
|
+
Copyright 2010-2013 Roger Pack - `http://github.com/rdp/specific_installs`
|
data/Rakefile
CHANGED
@@ -1,11 +1 @@
|
|
1
|
-
require
|
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
|
1
|
+
require "bundler/gem_tasks"
|
@@ -1,91 +1,133 @@
|
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
|
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
|
+
|
12
|
+
add_option('-l', '--location LOCATION', arguments) do |location|
|
13
|
+
options[:location] = location
|
14
|
+
end
|
15
|
+
|
16
|
+
add_option('-b', '--branch LOCATION', arguments) do |branch|
|
17
|
+
options[:branch] = branch
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
def arguments
|
23
|
+
"LOCATION like http://github.com/rdp/ruby_tutorials_core or git://github.com/rdp/ruby_tutorials_core.git or http://host/gem_name.gem"
|
24
|
+
"BRANCH (optional) like beta, or new-feature"
|
25
|
+
end
|
26
|
+
|
27
|
+
def usage
|
28
|
+
"#{program_name} [LOCATION] [BRANCH]"
|
29
|
+
end
|
30
|
+
|
31
|
+
def execute
|
32
|
+
require 'tempfile'
|
33
|
+
require 'backports'
|
34
|
+
require 'fileutils'
|
35
|
+
require 'open-uri'
|
36
|
+
unless options[:location]
|
37
|
+
puts "No location received. Use `gem specific_install -l http://example.com/rdp/specific_install`"
|
38
|
+
exit 1
|
39
|
+
end
|
40
|
+
# options are
|
41
|
+
# http://github.com/githubsvnclone/rdoc.git
|
42
|
+
# git://github.com/githubsvnclone/rdoc.git
|
43
|
+
# git@github.com:rdp/install_from_git.git
|
44
|
+
# http://github.com/rdp/install_from_git [later]
|
45
|
+
# http://host/gem_name.gem
|
46
|
+
# rdp/specific_install
|
47
|
+
dir = Dir.mktmpdir
|
48
|
+
begin
|
49
|
+
loc = options[:location]
|
50
|
+
case loc
|
51
|
+
when /^http(.*)\.gem$/
|
52
|
+
Dir.chdir dir do
|
53
|
+
say "downloading #{loc}"
|
54
|
+
gem_name = loc.split("/").last
|
55
|
+
download(loc, gem_name)
|
56
|
+
|
57
|
+
if install_gemspec
|
58
|
+
success_message
|
59
|
+
else
|
60
|
+
puts "failed"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
when /\.git$/
|
64
|
+
say 'git installing from ' + loc
|
65
|
+
|
66
|
+
system("git clone #{loc} #{dir}")
|
67
|
+
install_from_git(dir)
|
68
|
+
when %r(.*/.*)
|
69
|
+
puts "Installing from git@github.com:#{loc}.git"
|
70
|
+
|
71
|
+
system("git clone git@github.com:#{loc}.git #{dir}")
|
72
|
+
install_from_git(dir)
|
73
|
+
else
|
74
|
+
puts 'Error: must end with .git to be a git repository' +
|
75
|
+
'or be in shorthand form: rdp/specific_install'
|
76
|
+
end
|
77
|
+
ensure
|
78
|
+
FileUtils.rm_rf dir
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
def download( full_url, output_name )
|
86
|
+
File.open(output_name, "wb") do |output_file|
|
87
|
+
output_file.write(open(full_url).read)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def install_from_git(dir)
|
92
|
+
Dir.chdir dir do
|
93
|
+
['', 'rake gemspec', 'rake gem', 'rake build', 'rake package'].each do |command|
|
94
|
+
system command
|
95
|
+
if install_gemspec
|
96
|
+
success_message
|
97
|
+
exit 0
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def success_message
|
104
|
+
puts 'Successfully installed'
|
105
|
+
end
|
106
|
+
|
107
|
+
def install_gemspec
|
108
|
+
if gemspec = Dir['*.gemspec'][0]
|
109
|
+
change_to_branch(options[:branch]) if options[:branch]
|
110
|
+
system("gem build #{gemspec}")
|
111
|
+
system("gem install *.gem")
|
112
|
+
true
|
113
|
+
else
|
114
|
+
if gem = Dir['**/*.gem'][0]
|
115
|
+
system("gem install #{gem}")
|
116
|
+
true
|
117
|
+
else
|
118
|
+
false
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def change_to_branch(branch)
|
124
|
+
system("git checkout #{branch}")
|
125
|
+
system("git branch")
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
class Gem::Commands::GitInstallCommand < Gem::Commands::SpecificInstallCommand
|
130
|
+
end
|
131
|
+
|
132
|
+
Gem::CommandManager.instance.register_command :specific_install
|
133
|
+
Gem::CommandManager.instance.register_command :git_install
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
require
|
1
|
+
require "specific_install/version"
|
2
|
+
require "rubygems/commands/specific_install_command"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'specific_install/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
|
8
|
+
s.name = "specific_install"
|
9
|
+
s.description = %q{rubygems plugin that allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL}
|
10
|
+
s.summary = "rubygems plugin that allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL"
|
11
|
+
s.email = "rogerdpack@gmail.com"
|
12
|
+
s.homepage = "http://github.com/rdp/specific_installs"
|
13
|
+
s.authors = ["Roger Pack"]
|
14
|
+
s.version = SpecificInstall::VERSION
|
15
|
+
s.homepage = "https://github.com/rdp/specific_install"
|
16
|
+
s.license = "MIT"
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split($/)
|
19
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
|
23
|
+
s.add_dependency 'backports'
|
24
|
+
s.add_development_dependency 'rspec'
|
25
|
+
s.add_development_dependency 'sane'
|
26
|
+
s.add_development_dependency "bundler", "~> 1.3"
|
27
|
+
s.add_development_dependency "rake"
|
28
|
+
end
|
metadata
CHANGED
@@ -1,101 +1,125 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: specific_install
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 3
|
9
|
-
version: 0.2.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.4
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Roger Pack
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: backports
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
22
21
|
prerelease: false
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
|
29
|
-
|
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: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
30
34
|
type: :development
|
31
|
-
|
32
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
33
42
|
name: sane
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
34
49
|
prerelease: false
|
35
|
-
|
36
|
-
requirements:
|
37
|
-
- -
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
|
40
|
-
|
41
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
42
62
|
type: :development
|
43
|
-
version_requirements: *id002
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: backports
|
46
63
|
prerelease: false
|
47
|
-
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: rubygems plugin that allows you you to install a gem from from its github
|
84
|
+
repository (like 'edge'), or from an arbitrary URL
|
57
85
|
email: rogerdpack@gmail.com
|
58
86
|
executables: []
|
59
|
-
|
60
87
|
extensions: []
|
61
|
-
|
62
|
-
|
63
|
-
-
|
64
|
-
|
65
|
-
-
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE.txt
|
93
|
+
- README.md
|
66
94
|
- Rakefile
|
67
|
-
- VERSION
|
68
95
|
- lib/rubygems/commands/specific_install_command.rb
|
69
96
|
- lib/rubygems_plugin.rb
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
97
|
+
- lib/specific_install/version.rb
|
98
|
+
- specific_install.gemspec
|
99
|
+
homepage: https://github.com/rdp/specific_install
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata: {}
|
74
103
|
post_install_message:
|
75
|
-
rdoc_options:
|
76
|
-
|
77
|
-
require_paths:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
78
106
|
- lib
|
79
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- -
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
segments:
|
91
|
-
- 0
|
92
|
-
version: "0"
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
93
117
|
requirements: []
|
94
|
-
|
95
118
|
rubyforge_project:
|
96
|
-
rubygems_version:
|
119
|
+
rubygems_version: 2.0.3
|
97
120
|
signing_key:
|
98
|
-
specification_version:
|
99
|
-
summary: rubygems plugin that allows you you to install a gem from from its github
|
121
|
+
specification_version: 4
|
122
|
+
summary: rubygems plugin that allows you you to install a gem from from its github
|
123
|
+
repository (like 'edge'), or from an arbitrary URL
|
100
124
|
test_files: []
|
101
|
-
|
125
|
+
has_rdoc:
|
data/README
DELETED
File without changes
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.3
|