Skip to content

Loading…

Change redis port and add in bundler/shotgun #13

Closed
wants to merge 3 commits into from

9 participants

@qrush

First of many cleanups :)

Also removed the require for Hiredis, it's not used yet so it can just be added back in once it's needed.

@qrush

Any feedback on this? not sure why it hasn't been merged. trying to make it easier for others to contribute!

@PabloC

+1 for this! Thanks Antirez and qrush!

@ThroughTheNet

bundler support is essential, but this gemfile will load shotgun in the production environment, which is undesirable. Change the line to:

gem 'shotgun', :group => :development

TBH I don't use shotgun as it's too slow, and a lot of other people do the same for the same reason, so maybe it shouldn't be included at all? People generally make their own decisions on these things.

@sgoodwin

Haha. I was just about to issue a similar pull request myself.

@antirez
Owner

Please can you rebase this? I'll merge ASAP. Thanks.

@antirez
Owner

p.s. +1 for not including shotgun. I use it but that's up to the developer, and we should just specify the essential gems to run the code IMHO.

@PabloC

and what about support for 1.9.2 and a simple Gemfile?

@seppo0010 seppo0010 referenced this pull request
Closed

Cloud Foundry support #11

@guilleiguaran

would be nice be able to specify RedisHost using ENV["REDIS_HOST"] env variable

@PabloC

+1!

@zhemao

I've gotten rid of shotgun in the Gemfile and regenerated the Gemfile.lock. Changes are sitting at my fork https://github.com/zhemao/lamernews

@antirez
Owner

zhemao: thanks, but can't merge your as well as there are unrelated commits in your tree that are now fixed merging other pull requests.

@zhemao

Blech, fixing merge conflicts would have been a nightmare, so I rolled back and added the changes back in manually. Hopefully it is acceptable now.

@fcambus
Collaborator

We now have a Gemfile, introduced by this commit : 1fe117a

Closing.

@fcambus fcambus closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 48 additions and 16 deletions.
  1. +6 −0 Gemfile
  2. +24 −0 Gemfile.lock
  3. +5 −8 README.md
  4. +7 −7 app.rb
  5. +1 −1 app_config.rb
  6. +5 −0 config.ru
View
6 Gemfile
@@ -0,0 +1,6 @@
+source :rubygems
+
+gem "json"
+gem "redis"
+gem "shotgun"
+gem "sinatra"
View
24 Gemfile.lock
@@ -0,0 +1,24 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ json (1.6.1)
+ rack (1.3.5)
+ rack-protection (1.1.4)
+ rack
+ redis (2.2.2)
+ shotgun (0.9)
+ rack (>= 1.0)
+ sinatra (1.3.1)
+ rack (~> 1.3, >= 1.3.4)
+ rack-protection (~> 1.1, >= 1.1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ tilt (1.3.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ json
+ redis
+ shotgun
+ sinatra
View
13 README.md
@@ -18,14 +18,11 @@ Installation
===
Lamer news is a Ruby/Sinatra/Redis/jQuery application.
-You just need Ruby 1.8.7 with the following gems:
-
-* redis
-* hiredis
-* sinatra
-* json
-* digest/sha1
-* digest/md5
+You just need Ruby 1.8.7, and run:
+
+ gem install bundler --pre
+ bundle
+ shotgun
How to contribute
===
View
14 app.rb
@@ -25,15 +25,15 @@
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Salvaore Sanfilippo.
-require 'rubygems'
-require 'hiredis'
-require 'redis'
-require 'page'
-require 'app_config'
-require 'sinatra'
-require 'json'
+require "rubygems"
+require "bundler"
+Bundler.require(:default)
+
require 'digest/sha1'
require 'digest/md5'
+
+require 'page'
+require 'app_config'
require 'comments'
before do
View
2 app_config.rb
@@ -3,7 +3,7 @@
# Redis config
RedisHost = "127.0.0.1"
-RedisPort = 10000
+RedisPort = ENV["REDIS_PORT"] || 6379
# Security
PasswordSalt = "*LAMER*news*"
View
5 config.ru
@@ -0,0 +1,5 @@
+$LOAD_PATH << File.dirname(__FILE__)
+
+require 'app'
+
+run Sinatra::Application
Something went wrong with that request. Please try again.