lib/fdoc/service.rb in fdoc-0.2.3 vs lib/fdoc/service.rb in fdoc-0.2.4

- old
+ new

@@ -3,10 +3,14 @@ # Services represent a group of Fdoc API endpoints in a directory class Fdoc::Service attr_reader :service_dir attr_accessor :meta_service + def self.default_service + new(Fdoc.service_path) + end + def initialize(service_dir, scaffold_mode = Fdoc.scaffold_mode?) @service_dir = File.expand_path(service_dir) service_path = Dir["#{@service_dir}/*.fdoc.service"].first @schema = if service_path YAML.load_file(service_path) @@ -24,11 +28,9 @@ schema else {} end end - - DefaultService = self.new(Fdoc::DEFAULT_SERVICE_PATH) # Returns an Endpoint described by (verb, path) # In scaffold_mode, it will return an EndpointScaffold an of existing file # or create an empty EndpointScaffold def open(verb, path, scaffold_mode = Fdoc.scaffold_mode?)