obtain 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/bin/obtain +31 -0
- data/lib/obtain.rb +8 -0
- data/lib/obtain/gem.rb +3 -0
- data/lib/obtain/gem_command.rb +32 -0
- data/lib/obtain/gem_spec_fetcher.rb +24 -0
- data/lib/obtain/version.rb +3 -0
- metadata +86 -0
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/obtain
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rubygems/gem_runner'
|
5
|
+
require 'rubygems/exceptions'
|
6
|
+
require 'obtain'
|
7
|
+
|
8
|
+
required_version = Gem::Requirement.new ">= 1.8.7"
|
9
|
+
|
10
|
+
unless required_version.satisfied_by? Gem.ruby_version then
|
11
|
+
abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
|
12
|
+
end
|
13
|
+
|
14
|
+
args = ARGV.clone || []
|
15
|
+
|
16
|
+
args.unshift("install") unless ["install", "uninstall", "clean" ].include? args.first
|
17
|
+
|
18
|
+
if args.first == "install"
|
19
|
+
args << "--source"
|
20
|
+
args << "http://dev.equitymetrix.com"
|
21
|
+
args << "--no-rdoc"
|
22
|
+
args << "--no-ri"
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
begin
|
27
|
+
Gem::GemRunner.new.run args
|
28
|
+
rescue Gem::SystemExitException => e
|
29
|
+
exit e.exit_code
|
30
|
+
end
|
31
|
+
|
data/lib/obtain.rb
ADDED
data/lib/obtain/gem.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
class Gem::Command
|
2
|
+
|
3
|
+
self.send :remove_const, :HELP
|
4
|
+
|
5
|
+
HELP = <<-HELP
|
6
|
+
RubyGems is a sophisticated package manager for Ruby. This is a
|
7
|
+
basic help message containing pointers to more information.
|
8
|
+
|
9
|
+
Usage:
|
10
|
+
obtain -h/--help
|
11
|
+
obtain -v/--version
|
12
|
+
obtain command [arguments...] [options...]
|
13
|
+
|
14
|
+
Examples:
|
15
|
+
obtain install rake
|
16
|
+
obtain list --local
|
17
|
+
obtain build package.gemspec
|
18
|
+
obtain help install
|
19
|
+
|
20
|
+
Further help:
|
21
|
+
obtain help commands list all 'gem' commands
|
22
|
+
obtain help examples show some examples of usage
|
23
|
+
obtain help platforms show information about platforms
|
24
|
+
obtain help <COMMAND> show help on COMMAND
|
25
|
+
(e.g. 'gem help install')
|
26
|
+
obtain server present a web page at
|
27
|
+
http://localhost:8808/
|
28
|
+
with info about installed gems
|
29
|
+
Further information:
|
30
|
+
http://rubygems.rubyforge.org
|
31
|
+
HELP
|
32
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class Gem::SpecFetcher
|
2
|
+
|
3
|
+
alias _find_matching_with_errors find_matching_with_errors
|
4
|
+
|
5
|
+
def find_matching_with_errors(*args)
|
6
|
+
|
7
|
+
specs_and_sources, errors = _find_matching_with_errors(*args)
|
8
|
+
|
9
|
+
emx = []
|
10
|
+
out = []
|
11
|
+
gemserv = /equitymetrix/
|
12
|
+
|
13
|
+
specs_and_sources.each do |spec, uri_str|
|
14
|
+
emx << spec.first if spec.first && uri_str =~ gemserv
|
15
|
+
end
|
16
|
+
|
17
|
+
out = specs_and_sources.select do |spec, uri_str|
|
18
|
+
uri_str =~ gemserv || !emx.include?(spec.first)
|
19
|
+
end
|
20
|
+
|
21
|
+
[ out, errors ]
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: obtain
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.7
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- EMX
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.3'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.3'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: Write a gem description
|
47
|
+
email:
|
48
|
+
- sys.auto@equitymetrix.com
|
49
|
+
executables:
|
50
|
+
- obtain
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- Rakefile
|
55
|
+
- bin/obtain
|
56
|
+
- lib/obtain/gem.rb
|
57
|
+
- lib/obtain/version.rb
|
58
|
+
- lib/obtain/gem_command.rb
|
59
|
+
- lib/obtain/gem_spec_fetcher.rb
|
60
|
+
- lib/obtain.rb
|
61
|
+
homepage: http://www.equitymetrix.com
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.8.23
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Write a gem summary
|
86
|
+
test_files: []
|