Change API in config & project file

6 views
Skip to first unread message

devboy

unread,
Aug 20, 2011, 6:59:59 AM8/20/11
to gator-g...@googlegroups.com
I want to change a few things in the gator config and project files.
First problem that arises right now is the scope:

project = Project.new

won't work as it will create a new local var instead of using the provided setter. Thats why we use this right now:

project(Project.new)

I will go and attach all these properties to another object, so we can do stuff like this:

gator.project = Project.new
gator.config = ...

We then could think about introducin something like this:

gator.project do |p|
p.name = "name"
end

Additionally I want to get rid of the require syntax to add generators as it is probably better to associate extensions to a project, so a generator for example can be configured via a property it adds to gator.project.

gator.project.generators do |g|
g.test_with :asunit4
end

Simon Bailey

unread,
Aug 20, 2011, 7:56:13 AM8/20/11
to gator-g...@googlegroups.com
Sounds good....
--
Cheers,

Simon

[ http://newtriks.com ]


devboy

unread,
Aug 22, 2011, 1:11:08 PM8/22/11
to gator-g...@googlegroups.com
Cool! ;)

Ihave been working on this over the weekend, but it's quite a big change which will affect a lot of internal things of gator. For the better i hope!

Cheers

devboy

unread,
Sep 25, 2011, 3:27:28 PM9/25/11
to gator-g...@googlegroups.com

devboy

unread,
Sep 25, 2011, 3:32:33 PM9/25/11
to gator-g...@googlegroups.com
The api right now is not perfect yet, but it works as intended:

gator.configuration.project do |p|
  p.name = "MyProject"
  p.layout = ...
end

We need to think about how we want to have configurations accessible in the buildfile,
do we want everything to be on the top-level? Like this:

project do |project| ...

Or do we want to at least put it inside the gator object like:

gator.project do |p| ...

We also need to consider how this is gonna work with plugins like gator-as3-robotlegs and their own configurations.
Reply all
Reply to author
Forward
0 new messages