pmirror 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +59 -0
- data/LICENSE.txt +22 -0
- data/README.md +97 -0
- data/README.rdoc +19 -0
- data/Rakefile +67 -0
- data/bin/pmirror +43 -0
- data/features/pmirror.feature +55 -0
- data/features/step_definitions/pmirror_steps.rb +1 -0
- data/features/support/env.rb +49 -0
- data/lib/pmirror.rb +98 -0
- data/lib/pmirror/version.rb +3 -0
- data/pmirror.gemspec +30 -0
- data/spec/something_spec.rb +5 -0
- data/web/floobah.txt +0 -0
- data/web/floober.txt +0 -0
- data/web/mah.txt +0 -0
- data/web/meh.txt +0 -0
- metadata +215 -0
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pmirror (0.0.1)
|
5
|
+
methadone (~> 1.3.1)
|
6
|
+
nokogiri
|
7
|
+
progressbar
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
aruba (0.5.4)
|
13
|
+
childprocess (>= 0.3.6)
|
14
|
+
cucumber (>= 1.1.1)
|
15
|
+
rspec-expectations (>= 2.7.0)
|
16
|
+
builder (3.2.2)
|
17
|
+
childprocess (0.3.9)
|
18
|
+
ffi (~> 1.0, >= 1.0.11)
|
19
|
+
cucumber (1.3.10)
|
20
|
+
builder (>= 2.1.2)
|
21
|
+
diff-lcs (>= 1.1.3)
|
22
|
+
gherkin (~> 2.12)
|
23
|
+
multi_json (>= 1.7.5, < 2.0)
|
24
|
+
multi_test (>= 0.0.2)
|
25
|
+
diff-lcs (1.2.5)
|
26
|
+
ffi (1.9.3)
|
27
|
+
gherkin (2.12.2)
|
28
|
+
multi_json (~> 1.3)
|
29
|
+
json (1.8.1)
|
30
|
+
methadone (1.3.1)
|
31
|
+
bundler
|
32
|
+
mini_portile (0.5.2)
|
33
|
+
multi_json (1.8.4)
|
34
|
+
multi_test (0.0.3)
|
35
|
+
nokogiri (1.6.1)
|
36
|
+
mini_portile (~> 0.5.0)
|
37
|
+
progressbar (0.21.0)
|
38
|
+
rake (0.9.6)
|
39
|
+
rdoc (4.1.1)
|
40
|
+
json (~> 1.4)
|
41
|
+
rspec (2.14.1)
|
42
|
+
rspec-core (~> 2.14.0)
|
43
|
+
rspec-expectations (~> 2.14.0)
|
44
|
+
rspec-mocks (~> 2.14.0)
|
45
|
+
rspec-core (2.14.7)
|
46
|
+
rspec-expectations (2.14.4)
|
47
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
48
|
+
rspec-mocks (2.14.4)
|
49
|
+
|
50
|
+
PLATFORMS
|
51
|
+
ruby
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
aruba
|
55
|
+
bundler (~> 1.3)
|
56
|
+
pmirror!
|
57
|
+
rake (~> 0.9.2)
|
58
|
+
rdoc
|
59
|
+
rspec
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Aaron Nichols
|
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,97 @@
|
|
1
|
+
# Pmirror
|
2
|
+
|
3
|
+
[![Build
|
4
|
+
Status](https://travis-ci.org/adnichols/pmirror.png?branch=master)](https://travis-ci.org/adnichols/pmirror)
|
5
|
+
|
6
|
+
pmirror is a tool primarily intended to mirror a subset of files from a
|
7
|
+
remote http repository. I created the tool because I wanted a way to
|
8
|
+
mirror just some files from a remote RPM repository to a local
|
9
|
+
repository. I also wanted to be able to perform operations on the
|
10
|
+
locally downloaded files once the mirror operation was complete
|
11
|
+
|
12
|
+
Was there already a tool out there that does this? Probably, I couldn't
|
13
|
+
find it.
|
14
|
+
|
15
|
+
## Features
|
16
|
+
|
17
|
+
The tool is very new so it only has the bare minimum feature set:
|
18
|
+
|
19
|
+
- Specify multiple regex patterns to match against the remote directory
|
20
|
+
- Provides a progressbar download status indicator
|
21
|
+
- Specify a local directory to download files to
|
22
|
+
- Specify a command to execute on the local directory once all files are
|
23
|
+
downloaded
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
Add this line to your application's Gemfile:
|
28
|
+
|
29
|
+
gem 'pmirror'
|
30
|
+
|
31
|
+
And then execute:
|
32
|
+
|
33
|
+
$ bundle
|
34
|
+
|
35
|
+
Or install it yourself as:
|
36
|
+
|
37
|
+
$ gem install pmirror
|
38
|
+
|
39
|
+
### Dependencies
|
40
|
+
|
41
|
+
This gem makes use of the following other projects
|
42
|
+
|
43
|
+
- [methadone](https://github.com/davetron5000/methadone)
|
44
|
+
- [progressbar](https://github.com/peleteiro/progressbar)
|
45
|
+
- [nokogiri](http://nokogiri.org/)
|
46
|
+
|
47
|
+
## Usage
|
48
|
+
|
49
|
+
```
|
50
|
+
Usage: pmirror [options] url
|
51
|
+
|
52
|
+
Options:
|
53
|
+
-h, --help Show command line help
|
54
|
+
-p, --pattern PAT1,PAT2,PAT3 Regex to match files in remote dir,
|
55
|
+
may specify multiple patterns
|
56
|
+
-l, --localdir DIR Local directory to mirror files to
|
57
|
+
-e, --exec CMD Execute command after completion
|
58
|
+
-d, --debug Enable debugging
|
59
|
+
-v, --version Show version
|
60
|
+
```
|
61
|
+
|
62
|
+
Usage should be pretty self explanatory but here are the details:
|
63
|
+
|
64
|
+
`url` is the remote URL that you want to fetch files from. Right now
|
65
|
+
this is assumed to be an un-authenticated url. We do not recurse into
|
66
|
+
directories looking for files.
|
67
|
+
|
68
|
+
`--pattern` allows you to specify a comma separated list of patterns to
|
69
|
+
match on the remote directly. We will iterate over each pattern and
|
70
|
+
build up the file list to fetch from the remote url.
|
71
|
+
|
72
|
+
`--localdir` is the location you want files downloaded to. It is also
|
73
|
+
the directory in which any commands specified with `--exec` will be
|
74
|
+
performed.
|
75
|
+
|
76
|
+
`--exec` is used to perform actions on the download directory. The
|
77
|
+
envisioned use case right now is simply to run a createrepo when the
|
78
|
+
downloads are complete. This will change PWD to whatever directory is
|
79
|
+
specified in `--localdir` and then will run the command you specify.
|
80
|
+
There is not currently a way to pass the value of `--localdir` into a
|
81
|
+
command other than to specify `.` in your command.
|
82
|
+
|
83
|
+
`--debug` would enable some extra output
|
84
|
+
|
85
|
+
`--version` provides the version info
|
86
|
+
|
87
|
+
`--help` should be self explanatory
|
88
|
+
|
89
|
+
## Contributing
|
90
|
+
|
91
|
+
1. Fork it
|
92
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
93
|
+
3. Add tests for your new feature to pmirror.feature
|
94
|
+
4. Run tests (`rake`)
|
95
|
+
5. Commit your changes (`git commit -am 'Add some feature'`)
|
96
|
+
6. Push to the branch (`git push origin my-new-feature`)
|
97
|
+
7. Create new Pull Request
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= pmirror - DESCRIBE YOUR GEM
|
2
|
+
|
3
|
+
Author:: YOUR NAME (YOUR EMAIL)
|
4
|
+
Copyright:: Copyright (c) 2014 YOUR NAME
|
5
|
+
|
6
|
+
|
7
|
+
DESCRIBE YOUR GEM HERE
|
8
|
+
|
9
|
+
== Links
|
10
|
+
|
11
|
+
* {Source on Github}[LINK TO GITHUB]
|
12
|
+
* RDoc[LINK TO RDOC.INFO]
|
13
|
+
|
14
|
+
== Install
|
15
|
+
|
16
|
+
== Examples
|
17
|
+
|
18
|
+
== Contributing
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
def dump_load_path
|
2
|
+
puts $LOAD_PATH.join("\n")
|
3
|
+
found = nil
|
4
|
+
$LOAD_PATH.each do |path|
|
5
|
+
if File.exists?(File.join(path,"rspec"))
|
6
|
+
puts "Found rspec in #{path}"
|
7
|
+
if File.exists?(File.join(path,"rspec","core"))
|
8
|
+
puts "Found core"
|
9
|
+
if File.exists?(File.join(path,"rspec","core","rake_task"))
|
10
|
+
puts "Found rake_task"
|
11
|
+
found = path
|
12
|
+
else
|
13
|
+
puts "!! no rake_task"
|
14
|
+
end
|
15
|
+
else
|
16
|
+
puts "!!! no core"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
if found.nil?
|
21
|
+
puts "Didn't find rspec/core/rake_task anywhere"
|
22
|
+
else
|
23
|
+
puts "Found in #{path}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
require 'bundler'
|
27
|
+
require 'rake/clean'
|
28
|
+
|
29
|
+
begin
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
rescue LoadError
|
32
|
+
dump_load_path
|
33
|
+
raise
|
34
|
+
end
|
35
|
+
|
36
|
+
require 'cucumber'
|
37
|
+
require 'cucumber/rake/task'
|
38
|
+
gem 'rdoc' # we need the installed RDoc gem, not the system one
|
39
|
+
require 'rdoc/task'
|
40
|
+
|
41
|
+
include Rake::DSL
|
42
|
+
|
43
|
+
Bundler::GemHelper.install_tasks
|
44
|
+
|
45
|
+
|
46
|
+
RSpec::Core::RakeTask.new do |t|
|
47
|
+
# Put spec opts in a file named .rspec in root
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
PIDFILE = Dir.pwd + "/webrick.pid"
|
52
|
+
CUKE_RESULTS = 'results.html'
|
53
|
+
CLEAN << CUKE_RESULTS
|
54
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
55
|
+
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x"
|
56
|
+
t.fork = false
|
57
|
+
end
|
58
|
+
|
59
|
+
Rake::RDocTask.new do |rd|
|
60
|
+
|
61
|
+
rd.main = "README.rdoc"
|
62
|
+
|
63
|
+
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
64
|
+
end
|
65
|
+
|
66
|
+
task :default => [:spec,:features]
|
67
|
+
|
data/bin/pmirror
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'methadone'
|
5
|
+
require 'pmirror.rb'
|
6
|
+
|
7
|
+
class App
|
8
|
+
include Methadone::Main
|
9
|
+
include Methadone::CLILogging
|
10
|
+
|
11
|
+
main do # Add args you want: |like,so|
|
12
|
+
# your program code here
|
13
|
+
# You can access CLI options via
|
14
|
+
# the options Hash
|
15
|
+
end
|
16
|
+
|
17
|
+
# supplemental methods here
|
18
|
+
|
19
|
+
# Declare command-line interface here
|
20
|
+
|
21
|
+
# description "one line description of your app"
|
22
|
+
#
|
23
|
+
# Accept flags via:
|
24
|
+
# on("--flag VAL","Some flag")
|
25
|
+
# options[flag] will contain VAL
|
26
|
+
#
|
27
|
+
# Specify switches via:
|
28
|
+
# on("--[no-]switch","Some switch")
|
29
|
+
#
|
30
|
+
# Or, just call OptionParser methods on opts
|
31
|
+
#
|
32
|
+
# Require an argument
|
33
|
+
# arg :some_arg
|
34
|
+
#
|
35
|
+
# # Make an argument optional
|
36
|
+
# arg :optional_arg, :optional
|
37
|
+
|
38
|
+
version Pmirror::VERSION
|
39
|
+
|
40
|
+
use_log_level_option
|
41
|
+
|
42
|
+
go!
|
43
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
Feature: My bootstrapped app kinda works
|
2
|
+
In order to get going on coding my awesome app
|
3
|
+
I want to have aruba and cucumber setup
|
4
|
+
So I don't have to do it myself
|
5
|
+
|
6
|
+
Scenario: App just runs
|
7
|
+
When I get help for "pmirror"
|
8
|
+
Then the exit status should be 0
|
9
|
+
And the banner should be present
|
10
|
+
And the banner should document that this app takes options
|
11
|
+
And the following options should be documented:
|
12
|
+
|--pattern|
|
13
|
+
|--debug|
|
14
|
+
|--localdir|
|
15
|
+
|--exec|
|
16
|
+
|--version|
|
17
|
+
And the banner should document that this app's arguments are:
|
18
|
+
|url|which is required|
|
19
|
+
|
20
|
+
|
21
|
+
Scenario: Download a file
|
22
|
+
When I successfully run `pmirror -p meh -l ../foo http://localhost:55555`
|
23
|
+
Then the exit status should be 0
|
24
|
+
And the following files should exist:
|
25
|
+
|../foo/meh.txt|
|
26
|
+
|
27
|
+
Scenario: Execute on local directory
|
28
|
+
When I successfully run `pmirror -p meh -l ../foo -e "touch test" http://localhost:55555`
|
29
|
+
Then the exit status should be 0
|
30
|
+
And the following files should exist:
|
31
|
+
|../foo/meh.txt|
|
32
|
+
|../foo/test |
|
33
|
+
|
34
|
+
Scenario: Match multiple files
|
35
|
+
When I successfully run `pmirror -p floo -l ../foo http://localhost:55555`
|
36
|
+
Then the exit status should be 0
|
37
|
+
And the following files should exist:
|
38
|
+
| ../foo/floober.txt|
|
39
|
+
| ../foo/floobah.txt|
|
40
|
+
And the following files should not exist:
|
41
|
+
| ../foo/mah.txt|
|
42
|
+
| ../foo/meh.txt|
|
43
|
+
|
44
|
+
Scenario: Match multiple patterns
|
45
|
+
When I successfully run `pmirror -p '^floo.*','^mah.*' -l ../foo http://localhost:55555`
|
46
|
+
Then the exit status should be 0
|
47
|
+
And the following files should exist:
|
48
|
+
| ../foo/floober.txt|
|
49
|
+
| ../foo/floobah.txt|
|
50
|
+
| ../foo/mah.txt|
|
51
|
+
And the following files should not exist:
|
52
|
+
| ../foo/meh.txt|
|
53
|
+
|
54
|
+
|
55
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# Put your step definitions here
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'aruba/cucumber'
|
2
|
+
require 'methadone/cucumber'
|
3
|
+
|
4
|
+
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
5
|
+
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
|
6
|
+
|
7
|
+
def start_web
|
8
|
+
require 'webrick'
|
9
|
+
pid = fork do
|
10
|
+
web_server = WEBrick::HTTPServer.new(:Port => 55555, :DocumentRoot => Dir.pwd + '/web')
|
11
|
+
trap('INT') { web_server.shutdown }
|
12
|
+
web_server.start
|
13
|
+
end
|
14
|
+
File.open(PIDFILE, 'w') { |f| f.write(pid) }
|
15
|
+
end
|
16
|
+
|
17
|
+
def end_web
|
18
|
+
if File.exist?(PIDFILE)
|
19
|
+
pid = File.open(PIDFILE, 'r').read.to_i
|
20
|
+
else
|
21
|
+
puts "Server not started... exiting"
|
22
|
+
exit
|
23
|
+
end
|
24
|
+
|
25
|
+
begin
|
26
|
+
Process.kill('INT', pid)
|
27
|
+
rescue
|
28
|
+
puts "Process not running"
|
29
|
+
end
|
30
|
+
File.unlink(PIDFILE)
|
31
|
+
end
|
32
|
+
|
33
|
+
Before do
|
34
|
+
# Using "announce" causes massive warnings on 1.9.2
|
35
|
+
@puts = true
|
36
|
+
@original_rubylib = ENV['RUBYLIB']
|
37
|
+
ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
|
38
|
+
|
39
|
+
FileUtils.mkdir("tmp/foo")
|
40
|
+
start_web
|
41
|
+
end
|
42
|
+
|
43
|
+
After do
|
44
|
+
ENV['RUBYLIB'] = @original_rubylib
|
45
|
+
|
46
|
+
FileUtils.rm_r("tmp/foo")
|
47
|
+
end_web
|
48
|
+
end
|
49
|
+
|
data/lib/pmirror.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
require "pmirror/version"
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'open-uri'
|
4
|
+
require 'progressbar'
|
5
|
+
|
6
|
+
module Pmirror
|
7
|
+
class Pmirror
|
8
|
+
include Methadone::Main
|
9
|
+
include Methadone::CLILogging
|
10
|
+
include Methadone::SH
|
11
|
+
|
12
|
+
main do |url|
|
13
|
+
|
14
|
+
download_files( url, options[:localdir], get_download_list(url, options[:pattern]) )
|
15
|
+
execute(options[:exec]) if options[:exec]
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
description "Mirror files on a remote http server based on pattern match"
|
20
|
+
arg("url", "Url or remote site", :one, :required)
|
21
|
+
on("-p", "--pattern PAT1,PAT2,PAT3", Array,
|
22
|
+
"Regex to match files in remote dir, may specify multiple patterns"
|
23
|
+
)
|
24
|
+
on("-l", "--localdir DIR", "Local directory to mirror files to")
|
25
|
+
on("-e", "--exec CMD", "Execute command after completion")
|
26
|
+
on("-d", "--debug", "Enable debugging")
|
27
|
+
on("-v", "--version", "Show version")
|
28
|
+
|
29
|
+
def self.get_download_list(url, pattern)
|
30
|
+
info "Getting download list"
|
31
|
+
page = Nokogiri::HTML(open(url))
|
32
|
+
downloads = []
|
33
|
+
|
34
|
+
page.css("a").each do |link|
|
35
|
+
rpm_name = link.attributes['href'].value
|
36
|
+
pattern.each do |matcher|
|
37
|
+
if /#{matcher}/.match(rpm_name)
|
38
|
+
downloads << rpm_name
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
downloads
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.download_files(url, local_dir, file_list=[])
|
46
|
+
file_list.each do |file|
|
47
|
+
local_fn = "#{local_dir}/#{file}"
|
48
|
+
|
49
|
+
unless Dir.exist? options[:localdir]
|
50
|
+
puts "PWD: #{Dir.pwd}"
|
51
|
+
puts Dir.open(Dir.pwd).read
|
52
|
+
puts "Destination directory '#{options[:localdir]}' does not exist!"
|
53
|
+
exit 1
|
54
|
+
end
|
55
|
+
|
56
|
+
remote_fn = "#{url}/#{file}"
|
57
|
+
unless File.exist?(local_fn)
|
58
|
+
puts "Downloading File: #{file}"
|
59
|
+
puts "#{remote_fn} ==> #{local_fn}"
|
60
|
+
http_to_file(local_fn, remote_fn)
|
61
|
+
# File.write(local_fn, open(remote_fn).read)
|
62
|
+
puts "Download Complete for #{file}"
|
63
|
+
else
|
64
|
+
puts "Skipping #{file}, already exists"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.http_to_file(filename,url)
|
70
|
+
pbar = nil
|
71
|
+
File.open(filename, 'wb') do |save_file|
|
72
|
+
open(url, 'rb',
|
73
|
+
:content_length_proc => lambda {|t|
|
74
|
+
if t && 0 < t
|
75
|
+
pbar = ProgressBar.new("=", t)
|
76
|
+
pbar.file_transfer_mode
|
77
|
+
end
|
78
|
+
},
|
79
|
+
:progress_proc => lambda {|s|
|
80
|
+
pbar.set s if pbar
|
81
|
+
}) {|f| save_file.write(f.read) }
|
82
|
+
end
|
83
|
+
puts
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.execute(cmd)
|
87
|
+
puts "Executing: #{cmd}"
|
88
|
+
sh("cd #{options[:localdir]} && #{cmd}")
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.update_repodata(local_dir)
|
92
|
+
puts "Running createrepo for dir '#{local_dir}'"
|
93
|
+
sh("createrepo -c /#{local_dir}/.cache -d #{local_dir}")
|
94
|
+
end
|
95
|
+
|
96
|
+
go!
|
97
|
+
end
|
98
|
+
end
|
data/pmirror.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'pmirror/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "pmirror"
|
8
|
+
spec.version = Pmirror::VERSION
|
9
|
+
spec.authors = ["Aaron Nichols"]
|
10
|
+
spec.email = ["anichols@trumped.org"]
|
11
|
+
spec.description = %q{Mirror files from remote http server by pattern}
|
12
|
+
spec.summary = %q{Mirror files from remote http server by pattern}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency('rdoc')
|
24
|
+
spec.add_development_dependency('aruba')
|
25
|
+
spec.add_development_dependency('rake', '~> 0.9.2')
|
26
|
+
spec.add_dependency('methadone', '~> 1.3.1')
|
27
|
+
spec.add_dependency('nokogiri')
|
28
|
+
spec.add_dependency('progressbar')
|
29
|
+
spec.add_development_dependency('rspec')
|
30
|
+
end
|
data/web/floobah.txt
ADDED
File without changes
|
data/web/floober.txt
ADDED
File without changes
|
data/web/mah.txt
ADDED
File without changes
|
data/web/meh.txt
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,215 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pmirror
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aaron Nichols
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-01-19 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
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rdoc
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: aruba
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 0.9.2
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.9.2
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: methadone
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.3.1
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.3.1
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: nokogiri
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: progressbar
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rspec
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
description: Mirror files from remote http server by pattern
|
159
|
+
email:
|
160
|
+
- anichols@trumped.org
|
161
|
+
executables:
|
162
|
+
- pmirror
|
163
|
+
extensions: []
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- .gitignore
|
167
|
+
- .travis.yml
|
168
|
+
- Gemfile
|
169
|
+
- Gemfile.lock
|
170
|
+
- LICENSE.txt
|
171
|
+
- README.md
|
172
|
+
- README.rdoc
|
173
|
+
- Rakefile
|
174
|
+
- bin/pmirror
|
175
|
+
- features/pmirror.feature
|
176
|
+
- features/step_definitions/pmirror_steps.rb
|
177
|
+
- features/support/env.rb
|
178
|
+
- lib/pmirror.rb
|
179
|
+
- lib/pmirror/version.rb
|
180
|
+
- pmirror.gemspec
|
181
|
+
- spec/something_spec.rb
|
182
|
+
- web/floobah.txt
|
183
|
+
- web/floober.txt
|
184
|
+
- web/mah.txt
|
185
|
+
- web/meh.txt
|
186
|
+
homepage: ''
|
187
|
+
licenses:
|
188
|
+
- MIT
|
189
|
+
post_install_message:
|
190
|
+
rdoc_options: []
|
191
|
+
require_paths:
|
192
|
+
- lib
|
193
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
194
|
+
none: false
|
195
|
+
requirements:
|
196
|
+
- - ! '>='
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
none: false
|
201
|
+
requirements:
|
202
|
+
- - ! '>='
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: '0'
|
205
|
+
requirements: []
|
206
|
+
rubyforge_project:
|
207
|
+
rubygems_version: 1.8.23
|
208
|
+
signing_key:
|
209
|
+
specification_version: 3
|
210
|
+
summary: Mirror files from remote http server by pattern
|
211
|
+
test_files:
|
212
|
+
- features/pmirror.feature
|
213
|
+
- features/step_definitions/pmirror_steps.rb
|
214
|
+
- features/support/env.rb
|
215
|
+
- spec/something_spec.rb
|