sget 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Manifest +7 -0
- data/README +16 -0
- data/Rakefile +13 -0
- data/bin/sget +50 -0
- data/lib/formula/jquery.rb +5 -0
- data/lib/formula/raphael.rb +5 -0
- data/lib/formula/underscore.rb +5 -0
- data/lib/sget/version.rb +3 -0
- data/lib/sget.rb +26 -0
- data/sget.gemspec +32 -0
- metadata +81 -0
data/.gitignore
ADDED
data/Manifest
ADDED
data/README
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
== sget ==
|
2
|
+
shortcut'd wget
|
3
|
+
|
4
|
+
simple ruby gem to download stuff.
|
5
|
+
|
6
|
+
the code is based somewhat on the homebrew project
|
7
|
+
https://github.com/mxcl/homebrew
|
8
|
+
|
9
|
+
== install ==
|
10
|
+
sudo gem install sget
|
11
|
+
|
12
|
+
== usage ==
|
13
|
+
$ sget jquery # will download the jquery javascript lib to current directory.
|
14
|
+
|
15
|
+
== requirements ==
|
16
|
+
wget
|
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
5
|
+
require 'sget/version'
|
6
|
+
|
7
|
+
task :build do
|
8
|
+
system "gem build sget.gemspec"
|
9
|
+
end
|
10
|
+
|
11
|
+
task :release => :build do
|
12
|
+
system "gem push sget-#{Sget::VERSION}.gem"
|
13
|
+
end
|
data/bin/sget
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# I really don't get gem development yet....
|
5
|
+
if ENV['LOCAL_GEM_DEV']
|
6
|
+
lib = File.expand_path('../../lib/', __FILE__)
|
7
|
+
$:.unshift lib unless $:.include?(lib)
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'rubygems'
|
11
|
+
require 'sget'
|
12
|
+
|
13
|
+
case ARGV.first
|
14
|
+
when nil
|
15
|
+
puts "Requires at least one library, see --usage"
|
16
|
+
exit 0
|
17
|
+
when '-h', '--help', '--usage', '-?', 'help'
|
18
|
+
puts "Help to come."
|
19
|
+
exit 0
|
20
|
+
when '--version'
|
21
|
+
puts Sget::VERSION
|
22
|
+
exit 0
|
23
|
+
when '-v'
|
24
|
+
if ARGV.length > 1
|
25
|
+
puts "Sget #{Sget::VERSION}"
|
26
|
+
ARGV << ARGV.shift
|
27
|
+
else
|
28
|
+
puts Sget::VERSION
|
29
|
+
exit 0
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
aliases = { 'ls' => 'list' }
|
34
|
+
cmd = ARGV.shift
|
35
|
+
cmd = aliases[cmd] if aliases[cmd]
|
36
|
+
|
37
|
+
if cmd == 'list'
|
38
|
+
puts Sget.list
|
39
|
+
exit 0
|
40
|
+
end
|
41
|
+
|
42
|
+
begin
|
43
|
+
Sget.set(cmd)
|
44
|
+
url = Sget.url
|
45
|
+
github = url.match /https:\/\/.*github/
|
46
|
+
`wget #{url} #{"--no-check-certificate" if github}`
|
47
|
+
rescue LoadError => e
|
48
|
+
puts "Sorry, don't know #{cmd}."
|
49
|
+
exit 1
|
50
|
+
end
|
data/lib/sget/version.rb
ADDED
data/lib/sget.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'sget/version'
|
2
|
+
|
3
|
+
module Sget
|
4
|
+
|
5
|
+
def self.require?(path)
|
6
|
+
require path.to_s.chomp
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.say_hello
|
10
|
+
puts "Get a better gem!"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.set(lib)
|
14
|
+
require?(File.join(File.dirname(__FILE__), "formula/" + lib))
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.url
|
18
|
+
raise "Override this method."
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.list
|
22
|
+
files = Dir.glob(File.join(File.dirname(__FILE__), "formula/*.rb"))
|
23
|
+
filter = lambda { |x| x.chomp(".rb").gsub(/.*\//, "") }
|
24
|
+
files.map(&filter).join("\n")
|
25
|
+
end
|
26
|
+
end
|
data/sget.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib/', __FILE__)
|
4
|
+
$:.unshift lib unless $:.include?(lib)
|
5
|
+
|
6
|
+
require 'sget/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |s|
|
9
|
+
s.name = "sget"
|
10
|
+
s.version = Sget::VERSION
|
11
|
+
|
12
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
13
|
+
s.authors = ["Michael Hoy"]
|
14
|
+
s.date = %q{2011-03-17}
|
15
|
+
s.email = %q{michael.john.hoy@gmail.com}
|
16
|
+
s.extra_rdoc_files = ["README", "lib/sget.rb"]
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
|
19
|
+
s.homepage = %q{https://github.com/mjhoy/sget}
|
20
|
+
|
21
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Sget", "--main", "README"]
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
s.executables = ["sget"]
|
24
|
+
s.default_executable = "sget"
|
25
|
+
|
26
|
+
s.rubyforge_project = %q{sget}
|
27
|
+
s.rubygems_version = %q{1.6.2}
|
28
|
+
|
29
|
+
s.description = %q{Grab stuff.}
|
30
|
+
s.summary = %q{Simple gem to shortcut downloads (like jquery.js, for instance).}
|
31
|
+
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sget
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Michael Hoy
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-03-17 00:00:00 -04:00
|
18
|
+
default_executable: sget
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Grab stuff.
|
22
|
+
email: michael.john.hoy@gmail.com
|
23
|
+
executables:
|
24
|
+
- sget
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files:
|
28
|
+
- README
|
29
|
+
- lib/sget.rb
|
30
|
+
files:
|
31
|
+
- .gitignore
|
32
|
+
- Manifest
|
33
|
+
- README
|
34
|
+
- Rakefile
|
35
|
+
- bin/sget
|
36
|
+
- lib/formula/jquery.rb
|
37
|
+
- lib/formula/raphael.rb
|
38
|
+
- lib/formula/underscore.rb
|
39
|
+
- lib/sget.rb
|
40
|
+
- lib/sget/version.rb
|
41
|
+
- sget.gemspec
|
42
|
+
has_rdoc: true
|
43
|
+
homepage: https://github.com/mjhoy/sget
|
44
|
+
licenses: []
|
45
|
+
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options:
|
48
|
+
- --line-numbers
|
49
|
+
- --inline-source
|
50
|
+
- --title
|
51
|
+
- Sget
|
52
|
+
- --main
|
53
|
+
- README
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 1
|
71
|
+
- 2
|
72
|
+
version: "1.2"
|
73
|
+
requirements: []
|
74
|
+
|
75
|
+
rubyforge_project: sget
|
76
|
+
rubygems_version: 1.3.7
|
77
|
+
signing_key:
|
78
|
+
specification_version: 3
|
79
|
+
summary: Simple gem to shortcut downloads (like jquery.js, for instance).
|
80
|
+
test_files: []
|
81
|
+
|