Readme.md in user_agent_parser-2.1.0 vs Readme.md in user_agent_parser-2.1.1

- old
+ new

@@ -41,10 +41,25 @@ => #<UserAgentParser::UserAgent IE 9.0 (Windows Vista)> parser.parse 'Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.5.24 Version/10.53' => #<UserAgentParser::UserAgent Opera 10.53 (Windows XP)> ``` +In a larger application, you could store a parser in a global to avoid repeat pattern loading: + +```ruby +module MyApplication + + # Instantiate the parser on load as it's quite expensive + USER_AGENT_PARSER = UserAgentParser::Parser.new + + def self.user_agent_parser + USER_AGENT_PARSER + end + +end +``` + ## The pattern database The [ua-parser database](https://github.com/tobie/ua-parser/blob/master/regexes.yaml) is included via a [git submodule](http://help.github.com/submodules/). To update the database the submodule needs to be updated and the gem re-released (pull requests for this are very welcome!). You can also specify the path to your own, updated and/or customised `regexes.yaml` file as a second argument to `UserAgentParser.parse`: @@ -68,11 +83,17 @@ All accepted pull requests will earn you commit and release rights. ## Releasing a new version -1. Update the version in user_agent_parser.gemspec -2. `git commit user_agent_parser.gemspec -m 'Version bump'` +1. Update the version in `user_agent_parser.gemspec` +2. `git commit user_agent_parser.gemspec` with the following message format: + + Version x.x.x + + Changelog: + * Some new feature + * Some new bug fix 3. `rake release` ## License MIT