Skip to content

Commit 7d1956d

Browse files
committed
Merge pull request #66 from zipmark/remove_assets
Remove assets
2 parents 84bff60 + f19b5ac commit 7d1956d

31 files changed

+46
-21115
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ See the `example` folder for a sample Rails app that has been documented.
3939
## Configuration options
4040
- app - Set the application that Rack::Test uses, defaults to `Rails.application`
4141
- docs_dir - Output folder
42-
- format - An array of output format(s). Possible values are :json, :html, or :wurl. The final option is similar to :html, but includes the wURL console.
42+
- format - An array of output format(s). Possible values are :json, :html
4343
- template_path - Location of templates
4444
- filter - Filter by example document type
4545
- exclusion_filter - Filter by example document type
46-
- url_prefix - Add before all links on the index page, useful if docs are located in `public/docs`, must include a leading `/`, no trailing `/`; eg `/docs`
4746
- curl_host - Used when adding a cURL output to the docs
4847
- keep_source_order - By default examples and resources are ordered by description. Set to true keep the source order.
4948
- api_name - Change the name of the API on index pages, default is "API Documentation"
@@ -57,7 +56,6 @@ RspecApiDocumentation.configure do |config|
5756

5857
config.define_group :public do |config|
5958
config.docs_dir = Rails.root.join("public", "docs")
60-
config.url_prefix = "/docs"
6159
end
6260
end
6361
```

example/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ end
2222
group :test, :development do
2323
gem 'rspec-rails'
2424
gem 'rspec_api_documentation', :path => "../"
25-
gem 'raddocs', '0.1.0'
25+
gem 'raddocs', :github => "smartlogic/raddocs"
2626
end

example/Gemfile.lock

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
GIT
2+
remote: git://github.com/smartlogic/raddocs.git
3+
revision: 00cfb5cfc97ce98bcdef236088ee385327b4f68f
4+
specs:
5+
raddocs (0.1.3)
6+
haml
7+
json
8+
sinatra
9+
110
PATH
211
remote: ../
312
specs:
4-
rspec_api_documentation (0.9.0)
13+
rspec_api_documentation (0.9.1)
514
activesupport (>= 3.0.0)
615
i18n (>= 0.1.0)
716
json (>= 1.4.6)
@@ -55,7 +64,8 @@ GEM
5564
erubis (2.7.0)
5665
execjs (1.2.12)
5766
multi_json (~> 1.0)
58-
haml (3.1.6)
67+
haml (4.0.2)
68+
tilt
5969
has_scope (0.5.1)
6070
hike (1.2.1)
6171
i18n (0.6.0)
@@ -65,7 +75,7 @@ GEM
6575
jquery-rails (1.0.19)
6676
railties (~> 3.0)
6777
thor (~> 0.14)
68-
json (1.6.3)
78+
json (1.7.7)
6979
json_spec (0.7.0)
7080
multi_json (~> 1.0.0)
7181
rspec (~> 2.0)
@@ -82,16 +92,12 @@ GEM
8292
rack (>= 0.4)
8393
rack-mount (0.8.3)
8494
rack (>= 1.0.0)
85-
rack-protection (1.2.0)
95+
rack-protection (1.5.0)
8696
rack
8797
rack-ssl (1.3.2)
8898
rack
8999
rack-test (0.6.2)
90100
rack (>= 1.0)
91-
raddocs (0.1.0)
92-
haml
93-
json
94-
sinatra
95101
rails (3.1.3)
96102
actionmailer (= 3.1.3)
97103
actionpack (= 3.1.3)
@@ -130,17 +136,17 @@ GEM
130136
railties (~> 3.1.0)
131137
sass (~> 3.1.10)
132138
tilt (~> 1.3.2)
133-
sinatra (1.3.1)
134-
rack (~> 1.3, >= 1.3.4)
135-
rack-protection (~> 1.1, >= 1.1.2)
139+
sinatra (1.3.3)
140+
rack (~> 1.3, >= 1.3.6)
141+
rack-protection (~> 1.2)
136142
tilt (~> 1.3, >= 1.3.3)
137143
sprockets (2.0.3)
138144
hike (~> 1.2)
139145
rack (~> 1.0)
140146
tilt (~> 1.1, != 1.3.0)
141147
sqlite3 (1.3.5)
142148
thor (0.14.6)
143-
tilt (1.3.3)
149+
tilt (1.3.7)
144150
treetop (1.4.10)
145151
polyglot
146152
polyglot (>= 0.3.1)
@@ -160,7 +166,7 @@ DEPENDENCIES
160166
inherited_resources
161167
jquery-rails
162168
json_spec
163-
raddocs (= 0.1.0)
169+
raddocs!
164170
rails (= 3.1.3)
165171
rspec-rails
166172
rspec_api_documentation!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Raddocs.configure do |config|
2-
config.docs_dir = "public/docs"
2+
config.docs_dir = "docs"
33
end

example/spec/spec_helper.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@
3333
end
3434

3535
RspecApiDocumentation.configure do |config|
36-
config.docs_dir = Rails.root.join("public", "docs")
37-
# html pages with the wURL console
38-
config.format = [:json, :wurl, :combined_text]
39-
# html pages without the wURL console
40-
#config.format = [:json, :html]
41-
config.url_prefix = "/docs"
36+
config.format = [:json, :combined_text]
4237
config.curl_host = 'http://localhost:3000'
4338
config.api_name = "Example App API"
4439
end

features/step_definitions/html_steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
end
4343

4444
Then /^I should see the following request body:$/ do |request_body|
45-
page.should have_css("div.request.body", :text => request_body)
45+
page.should have_css("pre.request.body", :text => request_body)
4646
end
4747

4848
Then /^I should see the following response body:$/ do |response_body|
49-
page.should have_css("div.response.body", :text => response_body)
49+
page.should have_css("pre.response.body", :text => response_body)
5050
end
5151

5252
Then /^I should see the api name "(.*?)"$/ do |name|

lib/rspec_api_documentation.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module RspecApiDocumentation
2525
autoload :OAuth2MACClient, "rspec_api_documentation/oauth2_mac_client"
2626
autoload :TestServer
2727
autoload :HtmlWriter
28-
autoload :WurlWriter
2928
autoload :JsonWriter
3029
autoload :JsonIodocsWriter
3130
autoload :IndexWriter

lib/rspec_api_documentation/api_documentation.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def clear_docs
1414
FileUtils.rm_rf(docs_dir, :secure => true)
1515
end
1616
FileUtils.mkdir_p(docs_dir)
17-
FileUtils.cp_r(File.join(configuration.template_path, "assets"), docs_dir)
1817
end
1918

2019
def document_example(rspec_example)

lib/rspec_api_documentation/configuration.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def define_group(name, &block)
1717
subconfig = self.class.new(self)
1818
subconfig.filter = name
1919
subconfig.docs_dir = self.docs_dir.join(name.to_s)
20-
subconfig.url_prefix = "#{self.url_prefix}/#{name}"
2120
yield subconfig
2221
groups << subconfig
2322
end
@@ -47,7 +46,6 @@ def self.add_setting(name, opts = {})
4746
add_setting :template_path, :default => File.expand_path("../../../templates", __FILE__)
4847
add_setting :filter, :default => :all
4948
add_setting :exclusion_filter, :default => nil
50-
add_setting :url_prefix, :default => ""
5149
add_setting :app, :default => lambda { |config|
5250
if defined?(Rails)
5351
Rails.application

lib/rspec_api_documentation/html_writer.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ class HtmlWriter
55
attr_accessor :index, :configuration
66

77
def initialize(index, configuration)
8-
warn "[NOTICE] Assets will be gone from the next release. Please use Raddocs for nicer looking docs"
98
self.index = index
109
self.configuration = configuration
1110
end
@@ -44,10 +43,6 @@ def sections
4443
IndexWriter.sections(examples, @configuration)
4544
end
4645

47-
def url_prefix
48-
@configuration.url_prefix
49-
end
50-
5146
def examples
5247
@index.examples.map { |example| HtmlExample.new(example, @configuration) }
5348
end
@@ -92,10 +87,6 @@ def requests
9287
end
9388
end
9489

95-
def url_prefix
96-
configuration.url_prefix
97-
end
98-
9990
private
10091
def format_hash(hash = {})
10192
return nil unless hash.present?

lib/rspec_api_documentation/wurl_writer.rb

Lines changed: 0 additions & 110 deletions
This file was deleted.

spec/configuration_spec.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
its(:exclusion_filter) { should be_nil }
5050
its(:app) { should be_nil }
5151
its(:curl_host) { should be_nil }
52-
its(:url_prefix) { should be_blank }
5352
its(:keep_source_order) { should be_false }
5453
its(:api_name) { should == "API Documentation" }
5554
end
@@ -86,13 +85,6 @@
8685
config.docs_dir.should == subject.docs_dir.join('sub')
8786
end
8887
end
89-
90-
it "should scope the url_prefix directory" do
91-
subject.url_prefix = "/docs"
92-
subject.define_group(:sub) do |config|
93-
config.url_prefix.should == "/docs/sub"
94-
end
95-
end
9688
end
9789

9890
it { should be_a(Enumerable) }
Binary file not shown.
-13.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)