Skip to content

Commit

Permalink
add default formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Paret committed Dec 8, 2014
1 parent 2f3bba8 commit 11ce9cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
5 changes: 5 additions & 0 deletions lib/apipie/routes_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ class RoutesFormater

class Path
def format(rails_path_spec)
rails_path_spec.gsub!('(.:format)', '')
rails_path_spec.gsub!(/[()]/, '')
Apipie.configuration.api_base_url.values.each do |values|
rails_path_spec.gsub!("#{values}/", '/')
end
rails_path_spec
end
end
Expand Down
13 changes: 0 additions & 13 deletions spec/dummy/config/initializers/apipie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,6 @@
# config.link_extension = ""
end

# define formatter
class RoutesFormater::Path
def format(rails_path_spec)
rails_path_spec.gsub!('(.:format)', '')
rails_path_spec.gsub!(/[()]/, '')
Apipie.configuration.api_base_url.values.each do |values|
rails_path_spec.gsub!("#{values}/", '/')
end
rails_path_spec
end
end


# integer validator
class Apipie::Validator::IntegerValidator < Apipie::Validator::BaseValidator

Expand Down

0 comments on commit 11ce9cc

Please sign in to comment.