Permalink
Browse files

better heroku deployment, gem dependency management

  • Loading branch information...
1 parent c32a5ea commit 1e906e1f5050fd23d3ee161c065e48aabbfb7f67 @mmb committed Feb 23, 2011
Showing with 50 additions and 86 deletions.
  1. +1 −39 Gemfile
  2. +8 −0 Gemfile.app
  3. +1 −0 lib/murlsh.rb
  4. +5 −0 lib/murlsh/install.rb
  5. +3 −0 lib/murlsh/version.rb
  6. +32 −28 murlsh.gemspec
  7. +0 −19 plugins/add_pre_30_unajax_twitter.rb
View
40 Gemfile
@@ -1,41 +1,3 @@
source :rubygems
-# This does not use 'gemspec' because it creates a Gemfile.lock that treats
-# murlsh as a "gem" and will not work on Heroku, which sees murlsh as an
-# "app".
-
-# Dependencies duplicated in gemspec and here until a better solution is
-# found.
-
-%w{
- activerecord >= 2.3.4
- aws-s3 ~> 0.6
- bcrypt-ruby >= 2.1.2
- builder > 0
- htmlentities >= 4.2.0
- json >= 1.2.3
- nokogiri ~> 1.0
- plumnailer >= 0.1.3
- postrank-uri ~> 1.0
- public_suffix_service ~> 0.0
- push-notify >= 0.1.0
- rack >= 1.0.0
- rack-cache >= 0.5.2
- rack-rewrite >= 1.0.2
- rack-throttle >= 0.3.0
- rmagick >= 1.15.14
- rmail ~> 1.0
- sqlite3 ~> 1.3
- tinyatom >= 0.3.4
- treetop ~> 1.4
- twitter >= 0.9.12
- }.each_slice(3) { |g,o,v| gem g, "#{o} #{v}" }
-
-group :development do
- %w{
- fakeweb ~> 1.3
- flog >= 2.5.0
- rack-test ~> 0.5
- rspec ~> 2.0
- }.each_slice(3) { |g,o,v| gem g, "#{o} #{v}" }
-end
+gemspec
View
@@ -0,0 +1,8 @@
+# This Gemfile is for 'instances' of murlsh. It is not the Gemfile for the
+# gem, but for installations of murlsh created with the 'murlsh' command.
+
+require 'murlsh/version'
+
+source :rubygems
+
+gem 'murlsh', "= #{Murlsh::VERSION}"
View
@@ -39,6 +39,7 @@
require 'murlsh/url'
require 'murlsh/url_result_set'
require 'murlsh/url_server'
+require 'murlsh/version'
require 'murlsh/write_ordered_hash'
require 'murlsh/yaml_ordered_hash'
View
@@ -21,8 +21,13 @@ def install(dest_dir)
db/
plugins/
public/
+ Gemfile.app
}.map { |x| File.join(MurlshRoot, x) }, dest_dir, :verbose => true)
+ File.rename(
+ File.join(dest_dir, 'Gemfile.app'),
+ File.join(dest_dir, 'Gemfile'))
+
FileUtils.mkdir_p(File.join(dest_dir, 'tmp'), :verbose => true)
end
View
@@ -0,0 +1,3 @@
+module Murlsh
+ VERSION = '1.5.0'
+end
View
@@ -1,8 +1,12 @@
# -*- encoding: utf-8 -*-
+$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
+
+require 'murlsh/version'
+
Gem::Specification.new do |s|
s.name = 'murlsh'
- s.version = '1.5.0'
+ s.version = Murlsh::VERSION
s.summary = 'Host your bookmarks or maintain a link blog'
s.description = s.summary
s.homepage = 'https://github.com/mmb/murlsh'
@@ -12,35 +16,35 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
%w{
- activerecord >= 2.3.4
- aws-s3 ~> 0.6
- bcrypt-ruby >= 2.1.2
- builder > 0
- htmlentities >= 4.2.0
- json >= 1.2.3
- nokogiri ~> 1.0
- plumnailer >= 0.1.3
- postrank-uri ~> 1.0
- public_suffix_service ~> 0.0
- push-notify >= 0.1.0
- rack >= 1.0.0
- rack-cache >= 0.5.2
- rack-rewrite >= 1.0.2
- rack-throttle >= 0.3.0
- rmagick >= 1.15.14
- rmail ~> 1.0
- sqlite3 ~> 1.3
- tinyatom >= 0.3.4
- treetop ~> 1.4
- twitter >= 0.9.12
- }.each_slice(3) { |g,o,v| s.add_dependency(g, "#{o} #{v}") }
+ activerecord
+ aws-s3
+ bcrypt-ruby
+ builder
+ htmlentities
+ json
+ nokogiri
+ plumnailer
+ postrank-uri
+ public_suffix_service
+ push-notify
+ rack
+ rack-cache
+ rack-rewrite
+ rack-throttle
+ rmagick
+ rmail
+ sqlite3
+ tinyatom
+ treetop
+ twitter
+ }.each { |g| s.add_dependency g }
%w{
- fakeweb ~> 1.3
- flog >= 2.5.0
- rack-test ~> 0.5
- rspec ~> 2.0
- }.each_slice(3) { |g,o,v| s.add_development_dependency(g, "#{o} #{v}") }
+ fakeweb
+ flog
+ rack-test
+ rspec
+ }.each { |g| s.add_development_dependency g }
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files spec/*`.split("\n")
@@ -1,19 +0,0 @@
-require 'murlsh'
-
-module Murlsh
-
- # Convert Ajax friendly Twitter urls (with #!) into usable urls.
- class AddPre30UnajaxTwitter < Plugin
-
- @hook = 'add_pre'
-
- TwitterAjaxRe = %r{^(https?://twitter\.com/)#!/}i
-
- def self.run(url, config)
- url.url.sub! TwitterAjaxRe, '\1'
- url.via.sub!(TwitterAjaxRe, '\1') if url.via
- end
-
- end
-
-end

0 comments on commit 1e906e1

Please sign in to comment.