pokonski/public_activity — pull request #107 by kyanny (2013-07-18 10:51:57+00:00)
Title: Move dependencies to gemspec

At a master HEAD (93f64ee4be48e189c6833e1612f192f8761e73a7), `public_activity.gemspec` seems broken. Some gem dependencies are defined at `Gemfile` but bundler cannot install dependent gems written in `Gemfile` properly.

This affects for applications that not depend on `actionpack` explicity (typically non-rails application)

## Example 1:
`bundle install` will not install `actionpack`, so `bundle console` raises exception because fail to load `active_support` or `action_view`.

```
$ cat Gemfile
source "https://rubygems.org"
gem 'public_activity', github: 'pokonski/public_activity'

$ bundle install
Updating git://github.com/pokonski/public_activity.git
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using i18n (0.6.4)
Using public_activity (1.4.0) from git://github.com/pokonski/public_activity.git (at master)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

$ bundle console
/Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/bundler/gems/public_activity-93f64ee4be48/lib/public_activity.rb:1:in `require': cannot load such file -- active_support (LoadError)
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/bundler/gems/public_activity-93f64ee4be48/lib/public_activity.rb:1:in `'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/cli.rb:615:in `console'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/bin/bundle:20:in `block in '
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/bin/bundle:20:in `'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/bin/bundle:23:in `load'
from /Users/kyanny/.rbenv/versions/2.0.0-p195/bin/bundle:23:in `

'
```

## Example 2:
In my fork (represented by this pull request), bundler will install `actionpack` properly, so `bundle console` will succeed.

```
$ cat Gemfile
source "https://rubygems.org"
gem 'public_activity', github: 'kyanny/public_activity', branch: 'move_dependencies_to_gemspec'

$ bundle install
Using rake (10.1.0)
Using i18n (0.6.4)
Using minitest (4.7.5)
Using multi_json (1.7.7)
Using atomic (1.1.10)
Using thread_safe (0.1.0)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using public_activity (1.4.0) from git://github.com/kyanny/public_activity.git (at move_dependencies_to_gemspec)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

$ bundle console
irb(main):001:0>
```

## My runtime environment:

```
$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
$ bundle --version
Bundler version 1.3.5
```