Permalink
Browse files

Add configuration

  • Loading branch information...
1 parent 02c83c1 commit 6b23eab3f60636477ecab30410e7b7e29a7cddd2 Sebastian von Conrad committed Jan 8, 2012
Showing with 24 additions and 0 deletions.
  1. +1 −0 in_bed_with.gemspec
  2. +12 −0 lib/in_bed_with.rb
  3. +11 −0 spec/in_bed_with/config_spec.rb
View
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split('\n').map{ |f| File.basename(f) }
s.require_paths = ['lib']
+ s.add_dependency 'activesupport', '~> 3.1'
s.add_development_dependency 'rails', '~> 3.1'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '~> 2.8.0'
View
@@ -1,2 +1,14 @@
require 'rubygems'
require 'bundler/setup'
+
+require 'active_support/core_ext/module'
+
+require 'in_bed_with/analytics'
+
+module InBedWith
+ mattr_accessor :analytics_pid
+
+ def self.config(&block)
+ yield self
+ end
+end
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe InBedWith do
+ it 'sets defaults with a block' do
+ InBedWith.config do |config|
+ config.analytics_pid = 'abc123'
+ end
+
+ InBedWith.analytics_pid.should == 'abc123'
+ end
+end

0 comments on commit 6b23eab

Please sign in to comment.