pmirror 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pmirror (0.0.3)
4
+ pmirror (0.0.4)
5
5
  methadone (~> 1.3.1)
6
6
  nokogiri
7
7
  progressbar
@@ -7,6 +7,7 @@ Feature: My bootstrapped app kinda works
7
7
  When I get help for "pmirror"
8
8
  Then the exit status should be 0
9
9
  And the banner should be present
10
+ And the banner should include the version
10
11
  And the banner should document that this app takes options
11
12
  And the following options should be documented:
12
13
  |--pattern|
@@ -21,6 +22,10 @@ Feature: My bootstrapped app kinda works
21
22
  |-e|
22
23
  |-u|
23
24
 
25
+ Scenario: Check version
26
+ When I successfully run `pmirror --version`
27
+ Then the exit status should be 0
28
+
24
29
  Scenario: Download a file
25
30
  When I successfully run `pmirror -p meh -l ../foo -u http://localhost:55555`
26
31
  Then the exit status should be 0
@@ -8,25 +8,30 @@ module Pmirror
8
8
  include Methadone::Main
9
9
  include Methadone::CLILogging
10
10
  include Methadone::SH
11
+ version(::Pmirror::VERSION)
11
12
 
12
13
  main do
13
14
  d "Inside main"
14
15
 
15
- download_list = get_download_list(options[:url], options[:pattern])
16
- d "download_list: #{download_list.inspect}"
17
- download_files(options[:localdir], download_list)
18
- execute(options[:exec]) if options[:exec]
16
+ if options[:url] && options[:pattern] && options[:localdir]
17
+ download_list = get_download_list(options[:url], options[:pattern])
18
+ d "download_list: #{download_list.inspect}"
19
+ download_files(options[:localdir], download_list)
20
+
21
+ execute(options[:exec]) if options[:exec]
22
+ else
23
+ help_now!("Missing arguments")
24
+ end
19
25
 
20
26
  end
21
27
 
22
28
  description "Mirror files on a remote http server based on pattern match"
23
- on("-p", "--pattern PAT1,PAT2,PAT3", Array,
29
+ on("-p", "--pattern PAT,PAT", Array,
24
30
  "Regex to match files in remote dir, may specify multiple patterns"
25
31
  )
26
32
  on("-l", "--localdir DIR", "Local directory to mirror files to")
27
33
  on("-e", "--exec CMD", "Execute command after completion")
28
34
  on("-d", "--debug", "Enable debugging")
29
- on("-v", "--version", "Show version")
30
35
  on("-u", "--url URL,URL", Array, "Url or remote site")
31
36
 
32
37
  def self.d(msg)
@@ -1,3 +1,3 @@
1
1
  module Pmirror
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pmirror
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: