wsdsl 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/lib/ws_list.rb +19 -0
  3. data/wsdsl.gemspec +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/lib/ws_list.rb CHANGED
@@ -3,6 +3,8 @@
3
3
  # @api public
4
4
  module WSList
5
5
 
6
+ class UnknownService < StandardError; end
7
+
6
8
  module_function
7
9
 
8
10
  # Add a service to the array tracking
@@ -24,6 +26,23 @@ module WSList
24
26
  def all
25
27
  @list || []
26
28
  end
29
+
30
+ # Returns a service based on its name
31
+ #
32
+ # @param [String] name The name of the service you are looking for.
33
+ # @raise [UnknownService] if a service with the passed name isn't found.
34
+ # @return [WSDSL] The found service.
35
+ #
36
+ # @api public
37
+ def self.named(name)
38
+ service = all.find{|service| service.name == name}
39
+ if service.nil?
40
+ raise UnknownService, "Service named #{name} isn't available"
41
+ else
42
+ service
43
+ end
44
+ end
45
+
27
46
 
28
47
  end
29
48
 
data/wsdsl.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wsdsl}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Aimonetti"]
12
- s.date = %q{2011-02-28}
12
+ s.date = %q{2011-03-04}
13
13
  s.description = %q{A Ruby DSL describing Web Services without implementation details.}
14
14
  s.email = %q{mattaimonetti@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Aimonetti
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-28 00:00:00 -08:00
17
+ date: 2011-03-04 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20