1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/lib/motion-aasm.rb
Yannick Rekinger 2b9d850d99 Better RubyMotion file management.
CoreDataQuery persistence <3
2016-03-18 02:53:19 +01:00

26 lines
744 B
Ruby

unless defined?(Motion::Project::App)
raise "This must be required from within a RubyMotion Rakefile"
end
file_dependencies = {
'aasm/persistence/base.rb' => ['aasm/base.rb']
}
exclude_files = [
'rspec'
]
Motion::Project::App.setup do |app|
parent = File.expand_path File.dirname(__FILE__)
app.files += Dir.glob(File.join(parent, "aasm/**/*.rb")).reject { |file| exclude_files.any? { |exclude| file.match(exclude) } }
app.files_dependencies file_dependencies.inject({}, &->(file_dependencies, (file, *dependencies)) do
file = File.join(parent, file)
dependencies = dependencies.flatten(1).map do |dependency|
File.join(parent, dependency)
end
file_dependencies.merge({ file => dependencies })
end)
end