Module: DescribedRoutes::RakeTaskMethods

Defined in:
lib/described_routes/rake_task_methods.rb

Class Method Summary collapse

Class Method Details

.get_routesObject

Gets the application’s routes



26
27
28
# File 'lib/described_routes/rake_task_methods.rb', line 26

def self.get_routes
  DescribedRoutes::RailsRoutes.get_resource_templates(ENV['BASE'])
end

.jsonObject

Describe resource structure in JSON format



6
7
8
# File 'lib/described_routes/rake_task_methods.rb', line 6

def self.json
  get_routes.to_json
end

.textObject

Describe resource structure in text format



21
22
23
# File 'lib/described_routes/rake_task_methods.rb', line 21

def self.text
  get_routes.to_text
end

.xmlObject

Describe resource structure in XML format



16
17
18
# File 'lib/described_routes/rake_task_methods.rb', line 16

def self.xml
  get_routes.to_xml(Builder::XmlMarkup.new(:indent => 2)).target!
end

.yamlObject

“Describe resource structure in YAML format



11
12
13
# File 'lib/described_routes/rake_task_methods.rb', line 11

def self.yaml
  get_routes.to_yaml
end