apispec 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/Gemfile.lock +30 -0
- data/Rakefile +4 -9
- data/apispec.gemspec +3 -3
- data/lib/apispec/generator.rb +1 -1
- data/lib/apispec/version.rb +1 -4
- data/spec/generator_spec.rb +33 -19
- data/spec/spec_helper.rb +20 -1
- metadata +63 -78
- data/apispec-0.0.2.gem +0 -0
- data/apispec-0.0.3.gem +0 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
apispec (0.0.4)
|
5
|
+
RedCloth
|
6
|
+
coderay
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
RedCloth (4.2.9)
|
12
|
+
RedCloth (4.2.9-java)
|
13
|
+
coderay (1.0.9)
|
14
|
+
diff-lcs (1.2.2)
|
15
|
+
rspec (2.13.0)
|
16
|
+
rspec-core (~> 2.13.0)
|
17
|
+
rspec-expectations (~> 2.13.0)
|
18
|
+
rspec-mocks (~> 2.13.0)
|
19
|
+
rspec-core (2.13.1)
|
20
|
+
rspec-expectations (2.13.0)
|
21
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
22
|
+
rspec-mocks (2.13.1)
|
23
|
+
|
24
|
+
PLATFORMS
|
25
|
+
java
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
apispec!
|
30
|
+
rspec
|
data/Rakefile
CHANGED
@@ -1,9 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
4
|
-
|
5
|
-
t.spec_opts << '--diff --format d'
|
6
|
-
#t.rcov = true
|
7
|
-
end
|
8
|
-
|
9
|
-
task :default => :spec
|
1
|
+
require 'rspec/core/rake_task'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
RSpec::Core::RakeTask.new(:spec)
|
4
|
+
task :default => :spec
|
data/apispec.gemspec
CHANGED
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = "A documentation generator for http/rest"
|
13
13
|
|
14
14
|
dependencies = [
|
15
|
-
[:runtime, "RedCloth"
|
16
|
-
[:runtime, "coderay"
|
17
|
-
[:development, "rspec"
|
15
|
+
[:runtime, "RedCloth"],
|
16
|
+
[:runtime, "coderay"],
|
17
|
+
[:development, "rspec"],
|
18
18
|
]
|
19
19
|
|
20
20
|
s.files = Dir['**/*']
|
data/lib/apispec/generator.rb
CHANGED
data/lib/apispec/version.rb
CHANGED
data/spec/generator_spec.rb
CHANGED
@@ -3,26 +3,40 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
3
3
|
EXAMPLE_DIR = File.expand_path(File.join(File.dirname(__FILE__), "..", "example"))
|
4
4
|
|
5
5
|
describe APISpec::Generator do
|
6
|
-
|
7
|
-
@generator = APISpec::Generator.new
|
8
|
-
@generator.working_directory = EXAMPLE_DIR
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should be possible to parse the example" do
|
12
|
-
@generator.parse_files!
|
13
|
-
end
|
6
|
+
let(:generator) { described_class.new :workspace => EXAMPLE_DIR }
|
14
7
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
8
|
+
context "parsed" do
|
9
|
+
before { generator.parse_files! }
|
10
|
+
|
11
|
+
context "#print_tree" do
|
12
|
+
let(:tree) { generator.namespace.print_tree() }
|
13
|
+
subject { tree }
|
14
|
+
|
15
|
+
it { should include('Namespace (Nodes: 6)') }
|
16
|
+
it { should include(' Namespace Account (Nodes: 7)') }
|
17
|
+
it { should include(' User => Object User') }
|
18
|
+
it { should include(' UserRest => Interface UserRest') }
|
19
|
+
it { should include(' firstname => Field firstname') }
|
20
|
+
it { should include(' id => Field id') }
|
21
|
+
it { should include(' lastname => Field lastname') }
|
22
|
+
it { should include(' login => Field login') }
|
23
|
+
it { should include(' password => Field password') }
|
24
|
+
it { should include(' Folder => Object Folder') }
|
25
|
+
it { should include(' FolderID => Field folder_id') }
|
26
|
+
it { should include(' Folders => Interface Folders') }
|
27
|
+
it { should include(' SystemCheck => Interface SystemCheck') }
|
28
|
+
it { should include(' UserID => Field X-User') }
|
29
|
+
end
|
19
30
|
|
20
|
-
|
21
|
-
|
22
|
-
|
31
|
+
it "should be possible to find fields using there path" do
|
32
|
+
generator.namespace.find_field("Account.User").should_not be_nil
|
33
|
+
generator.namespace.find_field("Folder").should_not be_nil
|
34
|
+
generator.namespace.find_field("UserID").should_not be_nil
|
35
|
+
end
|
23
36
|
|
24
|
-
|
25
|
-
|
26
|
-
|
37
|
+
it "raises error if something is already definded" do
|
38
|
+
expect { generator.parse_files! }.to \
|
39
|
+
raise_error(APISpec::Namespace::AlreadyDefinedError)
|
40
|
+
end
|
27
41
|
end
|
28
|
-
end
|
42
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1 +1,20 @@
|
|
1
|
-
|
1
|
+
$:.unshift(File.expand_path("../../lib", __FILE__))
|
2
|
+
require "apispec"
|
3
|
+
|
4
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
5
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
6
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
7
|
+
# loaded once.
|
8
|
+
#
|
9
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
12
|
+
config.run_all_when_everything_filtered = true
|
13
|
+
config.filter_run :focus
|
14
|
+
|
15
|
+
# Run specs in random order to surface order dependencies. If you find an
|
16
|
+
# order dependency and want to debug it, you can fix the order by providing
|
17
|
+
# the seed, which is printed after each run.
|
18
|
+
# --seed 1234
|
19
|
+
config.order = 'random'
|
20
|
+
end
|
metadata
CHANGED
@@ -1,85 +1,78 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: apispec
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 4
|
10
|
-
version: 0.0.4
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Vincent Landgraf
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: RedCloth
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 4
|
31
|
-
- 2
|
32
|
-
- 7
|
33
|
-
version: 4.2.7
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: coderay
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
25
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: coderay
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
50
38
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: rspec
|
54
39
|
prerelease: false
|
55
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
56
41
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
65
54
|
type: :development
|
66
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
67
62
|
description: A documentation generator for http/rest
|
68
63
|
email: vilandgr+github@googlemail.com
|
69
|
-
executables:
|
64
|
+
executables:
|
70
65
|
- apispec
|
71
66
|
extensions: []
|
72
|
-
|
73
67
|
extra_rdoc_files: []
|
74
|
-
|
75
|
-
files:
|
76
|
-
- apispec-0.0.2.gem
|
77
|
-
- apispec-0.0.3.gem
|
68
|
+
files:
|
78
69
|
- apispec.gemspec
|
79
70
|
- bin/apispec
|
80
71
|
- example/datagram/user.json
|
81
72
|
- example/example.rb
|
82
73
|
- example/user.rb
|
74
|
+
- Gemfile
|
75
|
+
- Gemfile.lock
|
83
76
|
- lib/apispec/example.rb
|
84
77
|
- lib/apispec/field.rb
|
85
78
|
- lib/apispec/generator.rb
|
@@ -116,38 +109,29 @@ files:
|
|
116
109
|
- templates/resource.html.erb
|
117
110
|
homepage: http://github.com/threez/apispec/
|
118
111
|
licenses: []
|
119
|
-
|
120
112
|
post_install_message:
|
121
113
|
rdoc_options: []
|
122
|
-
|
123
|
-
require_paths:
|
114
|
+
require_paths:
|
124
115
|
- lib
|
125
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
117
|
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
|
132
|
-
- 0
|
133
|
-
version: "0"
|
134
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
123
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
140
|
-
segments:
|
141
|
-
- 0
|
142
|
-
version: "0"
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
143
128
|
requirements: []
|
144
|
-
|
145
129
|
rubyforge_project:
|
146
|
-
rubygems_version: 1.8.
|
130
|
+
rubygems_version: 1.8.24
|
147
131
|
signing_key:
|
148
132
|
specification_version: 3
|
149
133
|
summary: A ruby based http/rest documentation generator
|
150
|
-
test_files:
|
134
|
+
test_files:
|
151
135
|
- spec/dsl/example_spec.rb
|
152
136
|
- spec/dsl/field_spec.rb
|
153
137
|
- spec/dsl/interface_spec.rb
|
@@ -156,3 +140,4 @@ test_files:
|
|
156
140
|
- spec/dsl/resource_spec.rb
|
157
141
|
- spec/generator_spec.rb
|
158
142
|
- spec/spec_helper.rb
|
143
|
+
has_rdoc:
|
data/apispec-0.0.2.gem
DELETED
Binary file
|
data/apispec-0.0.3.gem
DELETED
Binary file
|