fdoc 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fdoc/endpoint.rb CHANGED
@@ -7,7 +7,7 @@ class Fdoc::Endpoint
7
7
  attr_reader :service
8
8
  attr_reader :endpoint_path
9
9
 
10
- def initialize(endpoint_path, service=Fdoc::Service::DefaultService)
10
+ def initialize(endpoint_path, service=Fdoc::Service.default_service)
11
11
  @endpoint_path = endpoint_path
12
12
  @schema = YAML.load_file(@endpoint_path)
13
13
  @service = service
@@ -2,7 +2,7 @@
2
2
  # endpoint. The #consume_* methods can modify the structure of the
3
3
  # in-memory endpoint, to save the results to the file system, call #persist!
4
4
  class Fdoc::EndpointScaffold < Fdoc::Endpoint
5
- def initialize(endpoint_path, service=Fdoc::Service::DefaultService)
5
+ def initialize(endpoint_path, service=Fdoc::Service.default_service)
6
6
  if File.exist?(endpoint_path)
7
7
  super
8
8
  else
data/lib/fdoc/service.rb CHANGED
@@ -5,6 +5,10 @@ class Fdoc::Service
5
5
  attr_reader :service_dir
6
6
  attr_accessor :meta_service
7
7
 
8
+ def self.default_service
9
+ new(Fdoc.service_path)
10
+ end
11
+
8
12
  def initialize(service_dir, scaffold_mode = Fdoc.scaffold_mode?)
9
13
  @service_dir = File.expand_path(service_dir)
10
14
  service_path = Dir["#{@service_dir}/*.fdoc.service"].first
@@ -27,8 +31,6 @@ class Fdoc::Service
27
31
  end
28
32
  end
29
33
 
30
- DefaultService = self.new(Fdoc::DEFAULT_SERVICE_PATH)
31
-
32
34
  # Returns an Endpoint described by (verb, path)
33
35
  # In scaffold_mode, it will return an EndpointScaffold an of existing file
34
36
  # or create an empty EndpointScaffold
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ date: 2011-11-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
18
- requirement: &70216151455820 !ruby/object:Gem::Requirement
18
+ requirement: &70244697855240 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70216151455820
26
+ version_requirements: *70244697855240
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json-schema
29
- requirement: &70216151455000 !ruby/object:Gem::Requirement
29
+ requirement: &70244697787060 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 1.0.1
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70216151455000
37
+ version_requirements: *70244697787060
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: kramdown
40
- requirement: &70216151454100 !ruby/object:Gem::Requirement
40
+ requirement: &70244697780380 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70216151454100
48
+ version_requirements: *70244697780380
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: rake
51
- requirement: &70216151469400 !ruby/object:Gem::Requirement
51
+ requirement: &70244697776460 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *70216151469400
59
+ version_requirements: *70244697776460
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: rspec
62
- requirement: &70216151468660 !ruby/object:Gem::Requirement
62
+ requirement: &70244697773020 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '2.5'
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *70216151468660
70
+ version_requirements: *70244697773020
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: nokogiri
73
- requirement: &70216151468000 !ruby/object:Gem::Requirement
73
+ requirement: &70244697771640 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *70216151468000
81
+ version_requirements: *70244697771640
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: cane
84
- requirement: &70216151467240 !ruby/object:Gem::Requirement
84
+ requirement: &70244697770160 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *70216151467240
92
+ version_requirements: *70244697770160
93
93
  description: A tool for documenting API endpoints.
94
94
  email: support@squareup.com
95
95
  executables: