module UnionStationHooksRails
Union Station - www.unionstationapp.com/ Copyright © 2010-2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Union Station - www.unionstationapp.com/ Copyright © 2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Union Station - www.unionstationapp.com/ Copyright © 2010-2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Union Station - www.unionstationapp.com/ Copyright © 2010-2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Union Station - www.unionstationapp.com/ Copyright © 2010-2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Union Station - www.unionstationapp.com/ Copyright © 2010-2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Union Station - www.unionstationapp.com/ Copyright © 2010-2015 Phusion Holding B.V.
“Union Station” and “Passenger” are trademarks of Phusion Holding B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Constants
- LIBROOT
The path to the `union_station_hooks_rails` Ruby library directory.
@private
- MAJOR_VERSION
- MINOR_VERSION
- ROOT
The path to the `union_station_hooks_rails` gem root directory.
@private
- TINY_VERSION
- VERSION_STRING
Public Class Methods
Initializes `union_station_hooks_rails`. This method is automatically called by `UnionStationHooks.initialized!` because we registered ourselves in `UnionStationHooks.initializers`. The application does not need to call this.
If this method successfully initializes, then it returns true.
Calling this method may or may not actually initialize `union_station_hooks_rails`. If this gem determines that initialization is not desired, then this method won't do anything and will return `false`. See {UnionStationHooksRails#should_initialize?}.
Initializing twice is a no-op. It only causes this method to return true.
@private @return [Boolean] Whether initialization was successful.
# File lib/union_station_hooks_rails.rb, line 88 def initialize! return false if !should_initialize? return true if initialized? require_lib('initialize') require_lib('active_record_subscriber') require_lib('exception_logger') if defined?(ActionView) require_lib('action_view_subscriber') end if defined?(ActiveSupport::Cache::Store) require_lib('active_support_cache_subscriber') end if defined?(ActionController::Base) require_lib('action_controller_extension') end if defined?(ActiveSupport::Benchmarkable) require_lib('active_support_benchmarkable_extension') end @@initialized = true true end
Returns whether the Union Station hooks are initialized.
# File lib/union_station_hooks_rails.rb, line 114 def initialized? @@initialized end
@private
# File lib/union_station_hooks_rails.rb, line 152 def require_and_check_union_station_hooks_core if !defined?(UnionStationHooks::VERSION_STRING) require 'union_station_hooks_core' end # If you update the dependency version here, also update # the version in the gemspec and in the Gemfile. compatible = UnionStationHooks::MAJOR_VERSION == 2 && UnionStationHooks::MINOR_VERSION >= 0 if !compatible raise "This version of the union_station_hooks_rails gem " \ "(#{VERSION_STRING}) is only compatible with the " \ "union_station_hooks_core gem 2.x.x. However, you have loaded " \ "union_station_hooks_core #{UnionStationHooks::VERSION_STRING}" end end
@private
# File lib/union_station_hooks_rails.rb, line 147 def require_lib(name) require("#{LIBROOT}/union_station_hooks_rails/#{name}") end
Returns whether the Union Station hooks should be initialized. If this method returns false, then {UnionStationHooksRails.initialize!} doesn't do anything.
This method only returns true if ActiveSupport >= 3 is currently loaded.
# File lib/union_station_hooks_rails.rb, line 123 def should_initialize? if defined?(::ActiveSupport) && !defined?(::ActiveSupport::VERSION) require 'active_support/version' end defined?(::ActiveSupport) && ::ActiveSupport::VERSION::MAJOR >= 3 end
@private
# File lib/union_station_hooks_rails.rb, line 142 def vendored=(val) @@vendored = val end
Returns whether this `union_station_hooks_rails` gem is bundled with Passenger (as opposed to a standalone gem added to the Gemfile). See the README and the file `hacking/Vendoring.md` in the `union_station_hooks_core` gem for information about how Passenger bundles `union_station_hooks_*` gems.
@private
# File lib/union_station_hooks_rails.rb, line 137 def vendored? @@vendored end