flexible_api_server 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module FlexibleApiServer
2
2
 
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
 
5
5
  end
@@ -0,0 +1,113 @@
1
+ <html>
2
+
3
+ <head>
4
+ <style type="text/css">
5
+ * { font-family: 'Helvetica', sans-serif; }
6
+ body { background: #ddd; text-align: center; }
7
+ .model { background: #fff; padding: 20px; border-bottom: 2px solid #333; margin-bottom: 20px }
8
+ .model_name { font-size: 42px; margin: 20px 20px 15px 20px; text-shadow: 2px 2px #ccc; }
9
+ #wrapper { margin: 30px auto 20px auto; text-align: left; width: 890px }
10
+ .request_level { margin-bottom: 10px; }
11
+ .request_level .includes { padding: 0px 10px 0px 10px }
12
+ .includes .include { background: #ddd !important; }
13
+ .include .name, .include .type, .include .request_level { display: inline-block; }
14
+ .include .request_level_name { color: #777 !important; display: inline-block; }
15
+ .includes .include, .fields .notation, .fields .field { display: inline-block; border: 1px solid #aaa; margin: 0px 10px 10px 0px; background: #eee; padding: 5px 10px; }
16
+ .fields .notation { color: #990000; }
17
+ .fields .field { color: #000099; }
18
+ .request_level .level_name, .request_level .level_name:visited { display: block; font-size: 24px; padding: 5px 10px; border-bottom: 1px solid #aaa; color: #000099; text-shadow: 1px 1px #aaa; }
19
+ .request_level .fields { padding: 10px 10px 0px 10px; }
20
+ .associations { font-size: 24px; color: #336633; }
21
+ .scopes { font-size: 24px; margin-top: 10px; color: #663333; }
22
+ .associations .association, .scopes .scope { border-bottom: 1px solid #aaa; padding: 5px 10px; text-shadow: 1px 1px #aaa }
23
+ .field .label, .notation .label { }
24
+ .field .description, .notation .description, .include .description { font-size: 12px; color: #333 }
25
+ #intro { margin-bottom: 10px; padding: 10px; font-size: 24px; color: #aaa; }
26
+ </style>
27
+ </head>
28
+
29
+ <body>
30
+
31
+ <div id="wrapper">
32
+
33
+ <div id="intro">
34
+ This documentation was automatically generated by <em>FlexibleApi</em> as a guide to the available calls and options.
35
+ </div>
36
+
37
+ <% @model_details.each do |model| %>
38
+
39
+ <% model_type = model.name.pluralize.underscore.downcase %>
40
+
41
+ <div class="model_name">/<%= model_type %></div>
42
+ <div class="model">
43
+
44
+ <div class="request_levels">
45
+
46
+ <% levels = model.request_levels << nil %>
47
+ <% levels.each do |level_name| %>
48
+
49
+ <% detail = model.find_level(level_name).to_hash %>
50
+
51
+ <div class="request_level">
52
+ <a href="#" class="level_name">?level=<%= detail[:name] %></a>
53
+ <a class="details">
54
+
55
+ <div class="fields">
56
+ <% (detail[:fields]).each do |field| %>
57
+ <% desc = @copy[model_type]['fields'][field.to_s] if @copy && @copy[model_type] && @copy[model_type]['fields'] %>
58
+ <div class="field">
59
+ <div class="label"><%= field %></div>
60
+ <div class="description"><%= desc || 'No description' %></div>
61
+ </div>
62
+ <% end %>
63
+ </div>
64
+
65
+ <div class="includes">
66
+ <% detail[:includes].each do |inc| %>
67
+ <% desc = @copy[model_type]['includes'][inc[:name].to_s] if @copy && @copy[model_type] && @copy[model_type]['includes'] %>
68
+ <div class="include">
69
+ <div class="name"><%= inc[:name] %></div>
70
+ <% unless inc[:type] == inc[:name] %>
71
+ <div class="type"><%= "[#{inc[:type]}]" %></div>
72
+ <% end %>
73
+ <div class="request_level_name"><%= "(:#{inc[:request_level]})" %></div>
74
+ <div class="description"><%= desc || 'No description' %></div>
75
+ </div>
76
+ <% end %>
77
+ </div>
78
+
79
+ </a>
80
+ </div>
81
+
82
+ <% end %>
83
+
84
+ <% unless model.scopes.empty? %>
85
+ <div class="scopes">
86
+ <% model.scopes.each do |scope| %>
87
+ <div class="scope"><%= "?scopes[]=#{scope}" %></div>
88
+ <% end %>
89
+ </div>
90
+ <% end %>
91
+
92
+ <% unless true || model[:associations].empty? %>
93
+ <div class="associations">
94
+ <% model[:associations].each do |assoc| %>
95
+ <div class="association">
96
+ <%= "/#{assoc[:name]}" %>
97
+ <% unless assoc[:name].to_s == assoc[:type] %>
98
+ <%= "(type: #{assoc[:type]})" %>
99
+ <% end %>
100
+ </div>
101
+ <% end %>
102
+ </div>
103
+ <% end %>
104
+
105
+ </div>
106
+
107
+ </div>
108
+
109
+ <% end %>
110
+
111
+ </body>
112
+
113
+ </html>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexible_api_server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Crepezzi
@@ -143,6 +143,7 @@ extra_rdoc_files: []
143
143
  files:
144
144
  - lib/flexible_api_server/version.rb
145
145
  - lib/flexible_api_server.rb
146
+ - views/doc_index.html.erb
146
147
  - spec/spec_helper.rb
147
148
  has_rdoc: true
148
149
  homepage: http://github.com/seejohnrun/flexible_api_server