trackchange 0.5.2 → 0.5.3

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.
@@ -46,7 +46,7 @@ module Trackchange
46
46
 
47
47
  # instant probe on add
48
48
  config.sites = [ { url: args.first } ]
49
- probe
49
+ Probe.new(config).probe(config.sites.last)
50
50
  end
51
51
 
52
52
  def list
@@ -55,6 +55,24 @@ module Trackchange
55
55
  end
56
56
  end
57
57
 
58
+ # TODO refactor to make remove code duplication
59
+ def test
60
+ pos = args.first.to_i - 1
61
+ raise "Invalid position" if pos == -1
62
+ site = config.sites[pos]
63
+ url = site[:url]
64
+
65
+ cmd = config.fetch
66
+ substitutions = {
67
+ url: url,
68
+ queryscript: File.expand_path('../query.coffee', __FILE__),
69
+ selector: site[:selector]
70
+ }
71
+ substitutions.each { |key, value| cmd = cmd.gsub("%#{key}%", value.to_s) }
72
+ puts "% #{cmd}"
73
+ puts %x[#{cmd}]
74
+ end
75
+
58
76
  def remove
59
77
  pos = args.first.to_i - 1
60
78
  raise "Invalid position" if pos == -1
@@ -1,3 +1,3 @@
1
1
  module Trackchange
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackchange
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  segments:
97
97
  - 0
98
- hash: -1126504187557020857
98
+ hash: -2268921304151947388
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  segments:
106
106
  - 0
107
- hash: -1126504187557020857
107
+ hash: -2268921304151947388
108
108
  requirements: []
109
109
  rubyforge_project:
110
110
  rubygems_version: 1.8.23