Permalink
Browse files

split out readme, license

  • Loading branch information...
qrush committed Mar 11, 2012
1 parent 7323958 commit 941ef578ceb9e00a21f8d9521741dac2b2a79532
Showing with 53 additions and 25 deletions.
  1. +20 −0 LICENSE
  2. +32 −0 README.md
  3. +1 −25 query_commenter.rb
View
20 LICENSE
@@ -0,0 +1,20 @@
+# Copyright (c) 2012 37signals, LLC
+#
+# 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.
View
@@ -0,0 +1,32 @@
+# query_comments
+
+Attach comments to your ActiveRecord queries. By default, it adds the application, controller, and action to each query.
+
+This gem helps immensely when searching log files for queries, and seeing where slow queries came from.
+
+For example:
+
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts`
+ WHERE `accounts`.`queenbee_id` = 1234567890
+ LIMIT 1
+ /*application:BCX,controller:project_imports,action:show*/
+
+## Install
+
+For Rails 3.x:
+
+ gem 'query_comments'
+
+Then `bundle`, and that's it!
+
+For Rails 2.x:
+
+ config.gem 'query_comments'
+
+## Support
+
+MySQL only, currently. Tested with mysql and mysql2 gems. Patches are welcome for other database adapters (with tests, of course).
+
+## License
+
+MIT. Please see `LICENSE`.
View
@@ -1,27 +1,3 @@
-# Sample query commenter for MySQL in Rails 2.3.x or 3.x.x applications
-#
-# Copyright (c) 2012 37signals, LLC
-# Maintained by noah@37signals.com
-#
-# 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.
-
# Could run in an initializer, or place in lib/query_commenter.rb or in a gem
module QueryComments
@@ -70,4 +46,4 @@ def record_query_comment
end
# Via an initializer or railtie in a gem, call:
-QueryComments.initialize!
+QueryComments.initialize!

0 comments on commit 941ef57

Please sign in to comment.