Skip to content

Loading…

Support Rails 3 and bump gem version #4

Merged
merged 3 commits into from

2 participants

@yyyc514

Please merge - I already pushed this to ruby gems.

@jnewland jnewland closed this
@yyyc514

What happened to this?

@jnewland
Owner

I thought I had merged it. Whoops. Getting it fixed up now.

Do you want to maintain this? I could switch the forks around so yours is the master.

@jnewland jnewland reopened this
@jnewland jnewland merged commit f2eb045 into jnewland:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2012
  1. @yyyc514

    support rails 3

    yyyc514 committed
  2. @yyyc514

    embrace rails-pulse as our official name and namespace our lib folder…

    yyyc514 committed
    … like every other gem I see
  3. @yyyc514

    fix up gemspec and init.rb

    yyyc514 committed
This page is out of date. Refresh to see the latest.
View
3 Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+
+gemspec
View
21 README.textile
@@ -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>
View
2 init.rb
@@ -1 +1 @@
-require File.dirname(__FILE__) + "/lib/pulse"
+require File.dirname(__FILE__) + "/lib/rails-pulse"
View
3 lib/pulse.rb
@@ -1,3 +0,0 @@
-require File.dirname(__FILE__) + '/pulse_controller'
-require File.dirname(__FILE__) + '/pulse_helper'
-require File.dirname(__FILE__) + '/routes'
View
0 lib/pulse_controller.rb → lib/pulse/controller.rb
File renamed without changes.
View
0 lib/pulse_helper.rb → lib/pulse/helper.rb
File renamed without changes.
View
17 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
View
3 lib/rails-pulse.rb
@@ -0,0 +1,3 @@
+require 'pulse/controller'
+require 'pulse/helper'
+require 'pulse/routes'
View
9 lib/routes.rb
@@ -1,9 +0,0 @@
-module Pulse
- module Routes
- def pulse(path)
- connect path, :controller => 'pulse', :action => 'pulse'
- end
- end
-end
-
-ActionController::Routing::RouteSet::Mapper.send :include, Pulse::Routes
View
22 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
Something went wrong with that request. Please try again.