ipecache 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
- ipecache (0.0.3)
4
+ ipecache (0.0.4)
5
5
  app_conf (>= 0.4.0)
6
6
  choice (>= 0.1.6)
7
7
  faraday_middleware (>= 0.9.0)
data/README.md CHANGED
@@ -67,7 +67,7 @@ The main component of Ipecache, and the program which initialises and calls all
67
67
 
68
68
  #### Usage
69
69
  ```bash
70
- ipecache [-f -u -c -p --status]
70
+ ipecache [-f -u -c -p -l --status]
71
71
  ```
72
72
 
73
73
  * Mandatory Parameters (you must specify one or the other)
@@ -78,6 +78,8 @@ ipecache [-f -u -c -p --status]
78
78
  * --status: Prints the status of all ipecache plugins
79
79
  * -c: Indicates that only CDN plugins should be run
80
80
  * -p: Indicates that only local proxy plugins should be run.
81
+ * -l: Specify a file to log errors to
82
+ * --nofail: Do not quit on error, continue purging
81
83
 
82
84
 
83
85
  #### Example (Checking plugin status)
@@ -46,6 +46,11 @@ Choice.options do
46
46
  long '--log-file'
47
47
  desc 'Log errors to specified file in addition to stdout'
48
48
  end
49
+
50
+ option :continue_on_error, :required => false do
51
+ long '--nofail'
52
+ desc 'Continue on errors instead of exiting'
53
+ end
49
54
  end
50
55
 
51
56
  if Choice.choices[:status]
@@ -76,6 +81,10 @@ if Choice.choices[:log_file]
76
81
  @log_file = Choice.choices[:log_file]
77
82
  end
78
83
 
84
+ if Choice.choices[:continue_on_error]
85
+ @continue_on_error = Choice.choices[:continue_on_error]
86
+ end
87
+
79
88
  if !Choice.choices[:cdnonly]
80
89
  puts ""
81
90
  puts "Running plugins registered for Proxy Purge..."
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'ipecache'
5
- gem.version = '0.0.3'
5
+ gem.version = '0.0.4'
6
6
  gem.authors = ["Jon Cowie"]
7
7
  gem.email = 'jonlives@gmail.com'
8
8
  gem.homepage = 'https://github.com/jonlives/ipecache'
@@ -54,7 +54,7 @@ module Ipecache
54
54
  response_hash = response.to_hash
55
55
  if response_hash[:purge_request_response][:return][:result_msg] != "Success."
56
56
  plugin_puts_error(url,"An Error occured: #{response_hash[:purge_request_response][:return][:result_msg]}")
57
- exit 1
57
+ exit 1 unless continue_on_error
58
58
  else
59
59
  plugin_puts "Purge successful!"
60
60
  end
@@ -48,7 +48,7 @@ module Ipecache
48
48
  if response.status != 200
49
49
  plugin_puts_error(url,"Response Code: #{response.status}")
50
50
  plugin_puts_error(url,response.body)
51
- exit 1
51
+ exit 1 unless continue_on_error
52
52
  else
53
53
  plugin_puts "Purge successful!"
54
54
  end
@@ -43,7 +43,7 @@ module Ipecache
43
43
  if response.code.to_i != 200
44
44
  plugin_puts_error(url,"Response Code: #{response.code}")
45
45
  plugin_puts_error(url,response.body)
46
- exit 1
46
+ exit 1 unless continue_on_error
47
47
  else
48
48
  plugin_puts "Purge successful!"
49
49
  end
@@ -43,6 +43,10 @@ module Ipecache
43
43
  @options[:log_file]
44
44
  end
45
45
 
46
+ def continue_on_error
47
+ @options[:continue_on_error]
48
+ end
49
+
46
50
  def name
47
51
  self.class.to_s
48
52
  end
@@ -25,11 +25,13 @@ module Ipecache
25
25
  def run_plugins(hook)
26
26
  urls = @urls
27
27
  log_file = @log_file
28
+ continue_on_error = @continue_on_error
28
29
  Ipecache::Plugins.run(
29
30
  :config => ipecache_config,
30
31
  :hook => hook.to_sym,
31
32
  :urls => urls,
32
- :log_file => log_file
33
+ :log_file => log_file,
34
+ :continue_on_error => continue_on_error
33
35
  )
34
36
  end
35
37
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipecache
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: