http_find 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20cd3400333198c6a692fe8418f0648e3c5278c2
4
- data.tar.gz: 7eacec0e4e24d158bf5fec2f132713a4d255c569
3
+ metadata.gz: 3122dfecfba59775fb74216ca4bbb44d692afb52
4
+ data.tar.gz: 604e501ce13ba659e67af15c01df727f59df6f8d
5
5
  SHA512:
6
- metadata.gz: be7eb9eb7cde160e0575ca9c2453ada0f96b49640990706e2a615401d800cd785bd4a4404ecaa813fa56821fe8b0ae74b1a6efb397fa55b216c8a8a0161fd002
7
- data.tar.gz: 3197a99c3c5692e3223495a8480adb7fcad2356939e9ec4b1e0f1b4e987369d19d8bca13d5695bf5ba80ee66ba1760d0af5e560b24876128d5d3b66aa3017d25
6
+ metadata.gz: 8a1f79e36d1de73c7b07fde9f445c6a85230fae8ca4e32301517347037d4037e5845dc8e318e95bbeb4929301c35c8a3674532fd3a27a46c72ff6619e6f2b277
7
+ data.tar.gz: 4ff1c4547ec1c573aa63d7eb8c3e0de4a060135479ff1ad6d2b210cdd7aa2c342ff2f7cc7e25770f596ddf26d60eba1756cefe3c92efd368e95a35b2c0b5513f
data/exe/httpfind CHANGED
@@ -6,4 +6,11 @@ source_path = (Pathname(__dir__) + "../lib").expand_path
6
6
  $LOAD_PATH << source_path
7
7
 
8
8
  require "http_find"
9
- HttpFind::Cli.start(ARGV)
9
+
10
+ if ARGV.empty?
11
+ puts "Usage: httpfind [options] URI TERM"
12
+ puts "See httpfind --help for more info"
13
+ else
14
+ cli = HttpFind::Cli.new
15
+ cli.find(ARGV[0], ARGV[1])
16
+ end
data/http_find.gemspec CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_runtime_dependency "httparty", "~> 0.13"
23
23
  spec.add_runtime_dependency "colorize", "~> 0.8"
24
- spec.add_runtime_dependency "thor", "~> 0.19"
25
24
 
26
25
  spec.add_development_dependency "bundler", "~> 1.12"
27
26
  spec.add_development_dependency "coveralls", "~> 0.8"
data/lib/http_find/cli.rb CHANGED
@@ -1,15 +1,38 @@
1
- require "thor"
1
+ require "optparse"
2
2
 
3
3
  module HttpFind
4
- class Cli < Thor
5
- option :regexp, type: :boolean, default: false, aliases: "-e",
6
- desc: "Indicate that TERM is a regular expression"
7
- desc "find URI TERM", "searches the HTTP GET response of URI for TERM"
4
+ class Cli
5
+ def initialize
6
+ @options = {}
7
+ gather_opts
8
+ end
9
+
8
10
  def find(uri, term)
9
- subject = options[:regexp] ? /#{term}/ : term
11
+ subject = @options[:regexp] ? /#{term}/ : term
10
12
  HttpFind.find(uri, subject).each { |l| puts l }
11
13
  end
12
14
 
13
- default_task :find
15
+ private
16
+
17
+ def gather_opts
18
+ OptionParser.new do |opts|
19
+ opts.banner = "Usage: httpfind [options] URI TERM"
20
+
21
+ opts.on("-e", "--regexp",
22
+ "Indicate that TERM is a regular expression") do |e|
23
+ options[:regexp] = e
24
+ end
25
+
26
+ opts.on("-v", "--version", "Show version info") do
27
+ puts "httpfind #{HttpFind::VERSION}"
28
+ exit
29
+ end
30
+
31
+ opts.on("-h", "--help", "Display this message") do
32
+ puts opts
33
+ exit
34
+ end
35
+ end.parse!
36
+ end
14
37
  end
15
38
  end
@@ -1,3 +1,3 @@
1
1
  module HttpFind
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_find
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Scheurich
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.8'
41
- - !ruby/object:Gem::Dependency
42
- name: thor
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.19'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.19'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: bundler
57
43
  requirement: !ruby/object:Gem::Requirement