A Rails Engine to tell your users about recent updates to the application.
Ruby JavaScript HTML CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bundle
app
config
db/migrate
doc
lib
pkg
public
spec
.gitignore
.rspec
.ruby-gemset
.ruby-version
Gemfile
Gemfile.lock
README.textile
Rakefile
UNLICENSE
init.rb
install.rb
recent_updates.gemspec
uninstall.rb

README.textile

RecentUpdates

The RecentUpdates Rails engine provides a resource for displaying release notes to users, as well as the ability to create, update, and delete recent updates as an admin. It can tweet your updates if you enable it to. It can also post your updates to another instance of your application via ActiveResource (if you enable it to). It will get you coffee in the morning. It doesn’t do Windows or non-dairy creamer though. Here are some screenshots:

Also see live examples of RecentUpdates in action at the following URLs:

License

Released by Snooty Monkey, LLC ( http://snootymonkey.com ) and Hexawise Inc. ( http://hexawise.com/ ) into the Public Domain under the Unlicense ( http://unlicense.org/ ).

Installation for Rails 2.3.x

See the master branch for Rails3.0.x installation instructions

See the Rails2.3 branch. And… you know… upgrade already!

Rails 3.0.x:
1. Add the recent_updates gems to the Gemfile:
gem 'recent_updates', :git => 'git://github.com/SnootyMonkey/Recent-Updates.git'

2. Run bundle install to download the gem.

3.Run the rake tasks
$ rake recent_updates:sync this will copy the config file, migration files, as well as static assets: js, css, and image files.
$ rake db:migrate

4. You will need a current_user method available to controllers that returns an object (presumably a User object) that can answer admin? with true or false (yeah.. it’s duck typing). If admin? returns true, the given current_user will be able to:

  • post new updates
  • edit existing updates
  • delete existing updates
  • Tweet (if enabled)

5. Open config/recent_updates.yml and edit the following:

  • Replace the APP_NAME value with your app’s name.
  • If you have a remote app that needs to have recent updates created, updated, or deleted automatically:
    • Set the root url for the REMOTE_SITE value (e.g. http://your-app.com, not http://your-app.com/recent_updates).
    • Set an API key for the API_KEY value. Make sure to set the same API_KEY in your remote app.
  • The default layout that Recent Update uses is the application layout. If you want to use a different layout, edit the LAYOUT value.
  • If you want different colors or tag names, edit the TAGS values.
  • If you want to automatically tweet your recent updates, you will need twitter and bit.ly API keys. See the Twitter and Bit.ly Setup section below for instructions.

6. TODO: check if still needed! In public/javascripts/rails.js, change line 167 from
document.on("ajax:after", "form", function(event, element) {
to
document.on("ajax:complete", "form", function(event, element) {

This will disable the “Add Update” button when clicked until the Recent Update is created. This is a workaround for this Rails ticket.

7. Run the tests, make sure they all pass:

  • cd spec/dummy;bundle install;rake db:migrate;cd ../..
  • rspec spec

8. Fire up your server, and visit http://app_url/recent_updates to see the RecentUpdates Rails engine in action.

Upgrading

Follow these steps (Rails 3 / gem):

  1. bundler update recent_updates
  2. rake recent_updates:sync
  3. rake db:migrate

TODO list

  • [X] Get rid of the JS error when updating a recent update
  • [X] Merge in improvements from rails2.3 branch into rails 3
  • [ ] Remove Rails 2/3 branch code (now just separate branches) and otherwise refactor as needed
  • [ ] Remove Rails 3 deprecations
  • [ ] Finish rspec test suite
    • [ ] RemoteUpdate
  • [ ] Publish the gem

Futures/maybe list

  • Add a rich text editor for creating and editing recent updates
  • Create seed data with one of each tag of the recent updates
  • Change the recent change implementation date select and editing to a calendar select.
  • Take care of being able to post an update in the future.
    • Perhaps allow it but don’t display for users; display in grey text for admins.
  • Add multiple author functionality (identify who)
  • Switch to e.g. backbone for the single-page app functionality?

Dependencies

  • will_paginate gem
  • uuidtools gem
  • twitter gem

Twitter and Bit.ly Setup

Twitter (optional)

1. Sign up for/log in to twitter.com with your app credentials.
2. Click on the “API” link on the bottom.
3. Follow the steps for registering your application
4. Copy and paste your consumer key and secret into the Twitter “key” and “secret” fields of the recent_updates YAML file, respectively.
5. Click on the button labeled “My access token” on the right side; copy and paste your access token and access token secret into the “akey” and “asecret” fields, respectively.

Bit.ly (required if you enable Twitter (which is optional (but cool (so is Lisp))))

1. Sign up for/log in to bit.ly with your app credentials.
2. Visit the “bit.ly API page”http://bit.ly/a/your_api_key to obtain your API key.
3. Type in your login to the bit.ly “login” field; copy and paste your API key into the “key” field.