Skip to content

Commit

Permalink
Merge pull request #66 from zipmark/remove_assets
Browse files Browse the repository at this point in the history
Remove assets
  • Loading branch information
oestrich committed Apr 24, 2013
2 parents 84bff60 + f19b5ac commit 7d1956d
Show file tree
Hide file tree
Showing 31 changed files with 46 additions and 21,115 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ See the `example` folder for a sample Rails app that has been documented.
## Configuration options
- app - Set the application that Rack::Test uses, defaults to `Rails.application`
- docs_dir - Output folder
- 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.
- format - An array of output format(s). Possible values are :json, :html
- template_path - Location of templates
- filter - Filter by example document type
- exclusion_filter - Filter by example document type
- 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`
- curl_host - Used when adding a cURL output to the docs
- keep_source_order - By default examples and resources are ordered by description. Set to true keep the source order.
- api_name - Change the name of the API on index pages, default is "API Documentation"
Expand All @@ -57,7 +56,6 @@ RspecApiDocumentation.configure do |config|

config.define_group :public do |config|
config.docs_dir = Rails.root.join("public", "docs")
config.url_prefix = "/docs"
end
end
```
Expand Down
2 changes: 1 addition & 1 deletion example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ end
group :test, :development do
gem 'rspec-rails'
gem 'rspec_api_documentation', :path => "../"
gem 'raddocs', '0.1.0'
gem 'raddocs', :github => "smartlogic/raddocs"
end
32 changes: 19 additions & 13 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
GIT
remote: git://github.com/smartlogic/raddocs.git
revision: 00cfb5cfc97ce98bcdef236088ee385327b4f68f
specs:
raddocs (0.1.3)
haml
json
sinatra

PATH
remote: ../
specs:
rspec_api_documentation (0.9.0)
rspec_api_documentation (0.9.1)
activesupport (>= 3.0.0)
i18n (>= 0.1.0)
json (>= 1.4.6)
Expand Down Expand Up @@ -55,7 +64,8 @@ GEM
erubis (2.7.0)
execjs (1.2.12)
multi_json (~> 1.0)
haml (3.1.6)
haml (4.0.2)
tilt
has_scope (0.5.1)
hike (1.2.1)
i18n (0.6.0)
Expand All @@ -65,7 +75,7 @@ GEM
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.3)
json (1.7.7)
json_spec (0.7.0)
multi_json (~> 1.0.0)
rspec (~> 2.0)
Expand All @@ -82,16 +92,12 @@ GEM
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-protection (1.2.0)
rack-protection (1.5.0)
rack
rack-ssl (1.3.2)
rack
rack-test (0.6.2)
rack (>= 1.0)
raddocs (0.1.0)
haml
json
sinatra
rails (3.1.3)
actionmailer (= 3.1.3)
actionpack (= 3.1.3)
Expand Down Expand Up @@ -130,17 +136,17 @@ GEM
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
sinatra (1.3.1)
rack (~> 1.3, >= 1.3.4)
rack-protection (~> 1.1, >= 1.1.2)
sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.5)
thor (0.14.6)
tilt (1.3.3)
tilt (1.3.7)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
Expand All @@ -160,7 +166,7 @@ DEPENDENCIES
inherited_resources
jquery-rails
json_spec
raddocs (= 0.1.0)
raddocs!
rails (= 3.1.3)
rspec-rails
rspec_api_documentation!
Expand Down
2 changes: 1 addition & 1 deletion example/config/initializers/raddocs.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Raddocs.configure do |config|
config.docs_dir = "public/docs"
config.docs_dir = "docs"
end
7 changes: 1 addition & 6 deletions example/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
end

RspecApiDocumentation.configure do |config|
config.docs_dir = Rails.root.join("public", "docs")
# html pages with the wURL console
config.format = [:json, :wurl, :combined_text]
# html pages without the wURL console
#config.format = [:json, :html]
config.url_prefix = "/docs"
config.format = [:json, :combined_text]
config.curl_host = 'http://localhost:3000'
config.api_name = "Example App API"
end
4 changes: 2 additions & 2 deletions features/step_definitions/html_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
end

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

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

Then /^I should see the api name "(.*?)"$/ do |name|
Expand Down
1 change: 0 additions & 1 deletion lib/rspec_api_documentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module RspecApiDocumentation
autoload :OAuth2MACClient, "rspec_api_documentation/oauth2_mac_client"
autoload :TestServer
autoload :HtmlWriter
autoload :WurlWriter
autoload :JsonWriter
autoload :JsonIodocsWriter
autoload :IndexWriter
Expand Down
1 change: 0 additions & 1 deletion lib/rspec_api_documentation/api_documentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def clear_docs
FileUtils.rm_rf(docs_dir, :secure => true)
end
FileUtils.mkdir_p(docs_dir)
FileUtils.cp_r(File.join(configuration.template_path, "assets"), docs_dir)
end

def document_example(rspec_example)
Expand Down
2 changes: 0 additions & 2 deletions lib/rspec_api_documentation/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def define_group(name, &block)
subconfig = self.class.new(self)
subconfig.filter = name
subconfig.docs_dir = self.docs_dir.join(name.to_s)
subconfig.url_prefix = "#{self.url_prefix}/#{name}"
yield subconfig
groups << subconfig
end
Expand Down Expand Up @@ -47,7 +46,6 @@ def self.add_setting(name, opts = {})
add_setting :template_path, :default => File.expand_path("../../../templates", __FILE__)
add_setting :filter, :default => :all
add_setting :exclusion_filter, :default => nil
add_setting :url_prefix, :default => ""
add_setting :app, :default => lambda { |config|
if defined?(Rails)
Rails.application
Expand Down
9 changes: 0 additions & 9 deletions lib/rspec_api_documentation/html_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class HtmlWriter
attr_accessor :index, :configuration

def initialize(index, configuration)
warn "[NOTICE] Assets will be gone from the next release. Please use Raddocs for nicer looking docs"
self.index = index
self.configuration = configuration
end
Expand Down Expand Up @@ -44,10 +43,6 @@ def sections
IndexWriter.sections(examples, @configuration)
end

def url_prefix
@configuration.url_prefix
end

def examples
@index.examples.map { |example| HtmlExample.new(example, @configuration) }
end
Expand Down Expand Up @@ -92,10 +87,6 @@ def requests
end
end

def url_prefix
configuration.url_prefix
end

private
def format_hash(hash = {})
return nil unless hash.present?
Expand Down
110 changes: 0 additions & 110 deletions lib/rspec_api_documentation/wurl_writer.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
its(:exclusion_filter) { should be_nil }
its(:app) { should be_nil }
its(:curl_host) { should be_nil }
its(:url_prefix) { should be_blank }
its(:keep_source_order) { should be_false }
its(:api_name) { should == "API Documentation" }
end
Expand Down Expand Up @@ -86,13 +85,6 @@
config.docs_dir.should == subject.docs_dir.join('sub')
end
end

it "should scope the url_prefix directory" do
subject.url_prefix = "/docs"
subject.define_group(:sub) do |config|
config.url_prefix.should == "/docs/sub"
end
end
end

it { should be_a(Enumerable) }
Expand Down
Binary file removed templates/assets/img/glyphicons-halflings-white.png
Binary file not shown.
Binary file removed templates/assets/img/glyphicons-halflings.png
Binary file not shown.
Loading

0 comments on commit 7d1956d

Please sign in to comment.