httpstatus 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/httpstatus.gemspec +62 -0
  3. data/lib/httpstatus.rb +12 -2
  4. metadata +3 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -0,0 +1,62 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "httpstatus"
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["daixque"]
12
+ s.date = "2013-02-21"
13
+ s.description = "httpstatus shows meaning of given HTTP status code"
14
+ s.email = "daixque@gmail.com"
15
+ s.executables = ["httpstatus", "httpstatus"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".rspec",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE.txt",
26
+ "README.rdoc",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "bin/httpstatus",
30
+ "httpstatus.gemspec",
31
+ "lib/httpstatus.rb",
32
+ "spec/httpstatus_spec.rb",
33
+ "spec/spec_helper.rb"
34
+ ]
35
+ s.homepage = "http://github.com/daixque/httpstatus"
36
+ s.licenses = ["MIT"]
37
+ s.require_paths = ["lib"]
38
+ s.rubygems_version = "1.8.17"
39
+ s.summary = "dictionary of HTTP status code"
40
+
41
+ if s.respond_to? :specification_version then
42
+ s.specification_version = 3
43
+
44
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
+ s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
46
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
47
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
48
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
49
+ else
50
+ s.add_dependency(%q<rspec>, ["~> 2.8.0"])
51
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
52
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
53
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
54
+ end
55
+ else
56
+ s.add_dependency(%q<rspec>, ["~> 2.8.0"])
57
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
58
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
59
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
60
+ end
61
+ end
62
+
data/lib/httpstatus.rb CHANGED
@@ -62,9 +62,19 @@ class HttpStatus
62
62
  }
63
63
  end
64
64
 
65
+ def lookup(code)
66
+ results = []
67
+ @statuses.each do |c, m|
68
+ if c.start_with?(code) || m.downcase.match(code.downcase)
69
+ results << "#{c}: #{m}"
70
+ end
71
+ end
72
+ results
73
+ end
74
+
65
75
  def run(args)
66
76
  code = args.shift
67
- result = @statuses[code]
68
- puts result
77
+ results = lookup code
78
+ puts results
69
79
  end
70
80
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: httpstatus
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - daixque
@@ -75,6 +75,7 @@ files:
75
75
  - Rakefile
76
76
  - VERSION
77
77
  - bin/httpstatus
78
+ - httpstatus.gemspec
78
79
  - lib/httpstatus.rb
79
80
  - spec/httpstatus_spec.rb
80
81
  - spec/spec_helper.rb
@@ -91,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
92
  requirements:
92
93
  - - ">="
93
94
  - !ruby/object:Gem::Version
94
- hash: -2701534221444654713
95
+ hash: -4610773712882357016
95
96
  segments:
96
97
  - 0
97
98
  version: "0"