From c2ffbf63757ca71727e2134f2d700e5e46504c73 Mon Sep 17 00:00:00 2001 From: Brandon Robins Date: Sun, 17 Dec 2017 14:03:34 -0600 Subject: [PATCH] Add an install generator and update README --- README.md | 12 ++++- lib/calligraphy.rb | 15 +++--- lib/calligraphy/version.rb | 2 +- .../calligraphy/install_generator.rb | 15 ++++++ lib/generators/templates/calligraphy.rb | 47 +++++++++++++++++++ 5 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 lib/generators/calligraphy/install_generator.rb create mode 100644 lib/generators/templates/calligraphy.rb diff --git a/README.md b/README.md index c38d668..6fced51 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,17 @@ Add the following line to your Gemfile: gem 'calligraphy' ``` -Then run `bundle install` +Then, run `bundle install` -Next, set up a `calligraphy_resource` route in `config/routes.rb` with a `resource_class`. +Next, run the generator: + +```ruby +rails generate calligraphy:install +``` + +The generator will install an initializer which describes Calligraphy's configuration options. + +Finally, set up a `calligraphy_resource` route in `config/routes.rb` with a `resource_class`. ```ruby # config/routes.rb diff --git a/lib/calligraphy.rb b/lib/calligraphy.rb index 09d53cc..846c0d3 100644 --- a/lib/calligraphy.rb +++ b/lib/calligraphy.rb @@ -35,11 +35,11 @@ module Calligraphy TAGGED_LIST_REGEX = /\)\s