Skip to content

Commit

Permalink
Delay #route_path initialization when no path os provided to let Rail…
Browse files Browse the repository at this point in the history
…s.root be

available and load route files in lib directory correctly.
  • Loading branch information
mariochavez committed Oct 23, 2014
1 parent cc6db2f commit 3b53e75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/api_taster.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'jquery-rails'
#require 'bootstrap-sass'
require 'remotipart'
require 'active_support/dependencies'
require 'api_taster/engine'
Expand All @@ -13,7 +12,11 @@ module ApiTaster
self.global_params = {}

mattr_accessor :route_path
self.route_path = "#{Rails.root}/lib/api_tasters"
def self.route_path
@@route_path ||= begin
"#{Rails.root.to_s}/lib/api_tasters"
end
end

mattr_accessor :global_headers
self.global_headers = {}
Expand Down
1 change: 1 addition & 0 deletions lib/api_taster/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Route
cattr_accessor :metadata

class << self

def map_routes(path = ApiTaster.route_path)
self.route_set = Rails.application.routes
self.supplied_params = {}
Expand Down
2 changes: 1 addition & 1 deletion lib/api_taster/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ApiTaster
VERSION = "0.8.3"
VERSION = "0.8.4"
end

0 comments on commit 3b53e75

Please sign in to comment.