Skip to content

Commit

Permalink
add lock file rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
spatchcock committed May 1, 2012
2 parents adf4eeb + 6fa1f31 commit 61fedd5
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,61 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (3.2.3)
i18n (~> 0.6)
multi_json (~> 1.0)
amee (4.1.7)
activesupport (~> 3.0)
json
log4r
nokogiri (~> 1.4.4)
builder (3.0.0)
coderay (1.0.6)
diff-lcs (1.1.3)
flexmock (0.9.0)
git (1.2.5)
i18n (0.6.0)
jeweler (1.6.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
json (1.7.0)
log4r (1.1.10)
method_source (0.7.1)
multi_json (1.3.4)
nokogiri (1.4.7)
pry (0.9.9.4)
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
quantify (3.1.2)
activesupport (~> 3.0)
i18n
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
slop (2.4.4)
uuidtools (2.1.2)

PLATFORMS
ruby

DEPENDENCIES
amee (~> 4.1.5)
builder
bundler (~> 1.1.0)
flexmock (> 0.8.6)
jeweler (~> 1.6.4)
pry
quantify (~> 3.1.2)
rdoc
rspec (= 2.6.0)
uuidtools (= 2.1.2)
2 changes: 2 additions & 0 deletions amee-data-abstraction.gemspec
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |s|
".rvmrc",
"CHANGELOG.txt",
"Gemfile",
"Gemfile.lock",
"LICENSE.txt",
"README.txt",
"Rakefile",
Expand All @@ -38,6 +39,7 @@ Gem::Specification.new do |s|
"lib/amee-data-abstraction/output.rb",
"lib/amee-data-abstraction/profile.rb",
"lib/amee-data-abstraction/prototype_calculation.rb",
"lib/amee-data-abstraction/railtie.rb",
"lib/amee-data-abstraction/term.rb",
"lib/amee-data-abstraction/terms_list.rb",
"lib/amee-data-abstraction/usage.rb",
Expand Down
2 changes: 2 additions & 0 deletions lib/amee-data-abstraction.rb
Expand Up @@ -29,6 +29,8 @@ module AMEE::DataAbstraction
mattr_accessor :connection

if defined?(Rails)
require File.dirname(__FILE__) + '/amee-data-abstraction/railtie'

def self.connection
AMEE::Rails.connection
end
Expand Down
13 changes: 13 additions & 0 deletions lib/amee-data-abstraction/railtie.rb
@@ -0,0 +1,13 @@
require 'amee-data-abstraction'
require 'rails'

module AMEE::DataAbstraction

class Railtie < Rails::Railtie

rake_tasks do
load File.join(File.dirname(__FILE__), '..', "tasks", "amee_data_abstraction.rake")
end
end

end
24 changes: 24 additions & 0 deletions lib/tasks/amee_data_abstraction.rake
@@ -0,0 +1,24 @@
# Copyright (C) 2008-2012 AMEE UK Ltd. - http://www.amee.com
# Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details.

namespace :amee do

namespace :calculations do

# Performs application setup
desc 'Regenerates a lock file for a specified calculations config file. Run as: rake "amee:calculations:lock[<file>]"'
task :lock, [:file] => [:environment] do |t, args|
AMEE::DataAbstraction::CalculationSet.regenerate_lock_file(args[:file])
end

# Performs application setup
desc 'Regenerates all locks files. Run as: rake "amee:calculations:lock_all"'
task :lock_all => [:environment] do |t, args|
$sheet_types.each_key do |key|
AMEE::DataAbstraction::CalculationSet.regenerate_lock_file(key.to_s)
end
end

end

end

0 comments on commit 61fedd5

Please sign in to comment.