Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
Fix gem issues: Remove ActiveSupport, upgrade DataMapper to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RISCfuture committed Jun 29, 2010
1 parent 887fe55 commit 68e850f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 31 deletions.
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ gem 'daemons'
gem 'anise'

group :pre_config do
gem 'activesupport', :require => 'active_support'
gem 'facets'
end

# Only loaded if a database.yml file exists for a season
group :datamapper do
gem 'do_mysql' # Change this to whatever adapter you need for your database
gem 'data_objects'
gem 'dm-mysql-adapter' # Change this to whatever adapter you need for your database
gem 'dm-core'
gem 'dm-migrations'
end

# load each leaf's gem requirements in its own group
Expand Down
34 changes: 16 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
hash: aa15ee85f9164ad34b1aabc9793c935648eb39cf
hash: e20ec6131647f0225dd1d85532f5f0b84875dd52
sources:
- Rubygems:
uri: http://gemcutter.org
specs:
- rake:
version: 0.8.7
- activesupport:
version: 2.3.8
- addressable:
version: 2.1.2
- facets:
Expand All @@ -23,21 +21,27 @@ specs:
- chronic:
version: 0.2.3
- daemons:
version: 1.0.10
version: 1.1.0
- data_objects:
version: 0.10.2
- extlib:
version: 0.9.15
- dm-core:
version: 0.10.2
version: 1.0.0
- dm-ar-finders:
version: 1.0.0
- dm-do-adapter:
version: 1.0.0
- dm-migrations:
version: 1.0.0
- do_mysql:
version: 0.10.2
- dm-mysql-adapter:
version: 1.0.0
- dm-timestamps:
version: 0.10.2
version: 1.0.0
- dm-validations:
version: 0.10.2
- do_mysql:
version: 0.10.2
version: 1.0.0
dependencies:
daemons:
version: ">= 0"
Expand All @@ -47,25 +51,19 @@ dependencies:
version: ">= 0"
group:
- :default
activesupport:
version: ">= 0"
group:
- :pre_config
require:
- active_support
facets:
version: ">= 0"
group:
- :pre_config
do_mysql:
dm-mysql-adapter:
version: ">= 0"
group:
- :datamapper
data_objects:
dm-core:
version: ">= 0"
group:
- :datamapper
dm-core:
dm-migrations:
version: ">= 0"
group:
- :datamapper
Expand Down
1 change: 0 additions & 1 deletion libs/foliater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def load_leaf_helpers(type)
end

def load_leaf_libs(type)
Extlib::Hook # fix some retarded autoload BS
Bundler.require type.snakecase.to_sym
Dir.glob("#{Autumn::Config.root}/leaves/#{type.snakecase}/lib/*.rb").each { |lib_file| require lib_file }
end
Expand Down
2 changes: 1 addition & 1 deletion libs/leaf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def method_missing(meth, *args)

def preconfigure # :nodoc:
if options[:authentication] then
@authenticator = Autumn::Authentication.const_get(options[:authentication]['type'].camelcase).new(options[:authentication].rekey(&:to_sym))
@authenticator = Autumn::Authentication.const_get(options[:authentication]['type'].camelcase(:upper)).new(options[:authentication].rekey(&:to_sym))
stems.add_listener @authenticator
end
end
Expand Down
6 changes: 6 additions & 0 deletions libs/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class String # :nodoc:
def except_first
self[1, size-1]
end

# Removes modules from a full class name.

def demodulize
split("::").last
end
end

class Hash # :nodoc:
Expand Down
16 changes: 8 additions & 8 deletions libs/speciator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ def options_for_leaf(identifier)
end

class OptionsProxy # :nodoc:
extend ActiveSupport::Memoizable

MERGED_METHODS = [ :[], :each, :each_key, :each_pair, :each_value, :eql?,
:fetch, :has_key?, :include?, :key?, :member?, :has_value?, :value?,
:hash, :index, :inspect, :invert, :keys, :length, :size, :merge, :reject,
Expand All @@ -150,18 +148,20 @@ def method_missing(meth, *args, &block)
merged.send meth, *args, &block
else
returnval = @hashes.last.send(meth, *args, &block)
merged :reload
merged true
returnval
end
end

private

def merged
merged = Hash.new
@hashes.each { |hsh| merged.merge! hsh }
merged
def merged(reload=false)
@merged = nil if reload
@merged ||= begin
merged = Hash.new
@hashes.each { |hsh| merged.merge! hsh }
merged
end
end
memoize :merged
end
end

0 comments on commit 68e850f

Please sign in to comment.