Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Rails 3 and bump gem version #4

Merged
merged 3 commits into from Jan 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
@@ -0,0 +1,3 @@
source :rubygems

gemspec
21 changes: 21 additions & 0 deletions README.textile
Expand Up @@ -14,6 +14,27 @@ h2. Requirements

h2. Installation

h3. Rails 3.x

Just add the gem to your @Gemfile@ and then @bundle install@:

<pre>
<code>
gem 'rails-pulse'
</code>
</pre>

In your @config/routes.rb@:

<pre>
<code>
pulse '/my/pulse/url'
</code>
</pre>


h3. Rails 2.x

In your @config/environment.rb@:

<pre>
Expand Down
2 changes: 1 addition & 1 deletion init.rb
@@ -1 +1 @@
require File.dirname(__FILE__) + "/lib/pulse"
require File.dirname(__FILE__) + "/lib/rails-pulse"
3 changes: 0 additions & 3 deletions lib/pulse.rb

This file was deleted.

File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions lib/pulse/routes.rb
@@ -0,0 +1,17 @@
module Pulse
module Routes
def pulse(path)
if Rails::VERSION::MAJOR == 2
connect path, :controller => 'pulse', :action => 'pulse'
else
match path => "pulse#pulse"
end
end
end
end

if Rails::VERSION::MAJOR == 3
ActionDispatch::Routing::Mapper.send :include, Pulse::Routes
else # fallback to 2.x stuff
ActionController::Routing::RouteSet::Mapper.send :include, Pulse::Routes
end
3 changes: 3 additions & 0 deletions lib/rails-pulse.rb
@@ -0,0 +1,3 @@
require 'pulse/controller'
require 'pulse/helper'
require 'pulse/routes'
9 changes: 0 additions & 9 deletions lib/routes.rb

This file was deleted.

22 changes: 11 additions & 11 deletions rails-pulse.gemspec
@@ -1,24 +1,24 @@
Gem::Specification.new do |s|
s.name = %q{rails-pulse}
s.version = "0.4.5"
s.version = "0.4.7"
s.authors = ["Paul Gross", "Jesse Newland", "Josh Goebel", "Will Farrington"]
s.date = %q{2011-02-07}
s.date = %q{2012-01-10}
s.description = s.summary = %q{Adds a pulse URL that pings the DB to a Rails app.}
s.description += "\nThis is an improved version of the `pulse` gem."
s.description += "\nThis is the maintained version of the `pulse` gem."
s.email = %q{jnewland@gmail.com}
s.homepage = %q{http://github.com/jnewland/pulse}

s.files = [
"init.rb",
"lib/pulse.rb",
"lib/pulse_controller.rb",
"lib/pulse_helper.rb",
"lib/routes.rb",
"README.textile"
]
# init.rb does not need to be in our gem
s.files = ["README.textile"] + Dir.glob("lib/**/*.rb")

s.test_files = `git ls-files -- spec/*`.split("\n")

s.extra_rdoc_files = [ "README.textile" ]
s.require_paths = ["lib"]

s.has_rdoc = false

s.add_runtime_dependency "rails"

s.rubygems_version = %q{1.2.0}
end