Skip to content

Commit

Permalink
Moved everything into lib instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspernj committed May 28, 2014
1 parent 61c8d2e commit 9ad5600
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/php_process.rb
Expand Up @@ -14,11 +14,13 @@
class PhpProcess
#Autoloader for subclasses.
def self.const_missing(name)
path = "#{File.dirname(__FILE__)}/../include/#{::StringCases.camel_to_snake(name)}.rb"
raise LoadError, "Does not exist: '#{path}'." unless File.exists?(path)
require path
raise LoadError, "Still not defined after autoload: '#{name}'." unless ::PhpProcess.const_defined?(name)
return ::PhpProcess.const_get(name)
path = "#{File.dirname(__FILE__)}/php_process/#{::StringCases.camel_to_snake(name)}.rb"
if File.exists?(path)
require path
return ::PhpProcess.const_get(name) if ::PhpProcess.const_defined?(name)
end

super
end

#Returns the path to the gem.
Expand Down Expand Up @@ -252,7 +254,7 @@ def php_cmd_as_string
end
end

cmd_str << " \"#{File.dirname(__FILE__)}/php_script.php\""
cmd_str << " \"#{File.dirname(__FILE__)}/php_process/php_script.php\""

return cmd_str
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9ad5600

Please sign in to comment.