Question about Gem Creation

50 views
Skip to first unread message

Danny Douglass

unread,
Aug 9, 2010, 7:50:33 AM8/9/10
to nu-...@googlegroups.com
Greetings,

I've been following Nu's progress and I'm really excited about what is coming out of it.  I decided to give gem creation a shot by adding a gemspec for the Spark View Engine using a variety of posts:
My question revolves around dependencies.  The current release of the Spark view engine (1.1.0.0) includes some 154 non-required dependencies.  There are just under 10 DLLs required, depending on what language or framework you are utilizing.  Based on that, those 10 DLLs would be placed in the lib directory, correct?  How would I approach the dependencies in this case?  Would I need to search rubygems.org for each dependency and add it if it was not there?  That seems like a lot of work to add one gem so I'm hoping that I'm missing something.  Forgive me if I'm overlooking something simple here - I'm new to the Ruby/Gem world.

Thanks for all your hard work on this project.  I'm really excited about it and plan on blogging on the project once I get a more solid understanding of gem creation.

--
Danny Douglass
http://DannyDouglass.com

P: 571.248.1326
E: DDou...@gmail.com

Dru Sellers

unread,
Aug 9, 2010, 8:06:11 AM8/9/10
to nu-...@googlegroups.com
Just for context. What are the ~10 dlls that you need?
-d

Danny Douglass

unread,
Aug 9, 2010, 8:16:23 AM8/9/10
to nu-net
There are actually 8 *required* DLLs, depending on the language/
framework you are utilizing:

1. Castle.MonoRail.Views.Spark.dll
2. Spark.dll
3. Spark.Python.dll
4. Spark.Ruby.dll
5. Spark.Web.Mvc.dll
6. Spark.Web.Mvc.Pdf.dll
7. Spark.Web.Mvc.Python.dll
8. Spark.Web.Mvc.Ruby.dll

My understanding is that these are the components I'd be placing into
the *lib* directory.

On Aug 9, 8:06 am, Dru Sellers <d...@drusellers.com> wrote:
> Just for context. What are the ~10 dlls that you need?
> -d
>
>
>
> On Mon, Aug 9, 2010 at 6:50 AM, Danny Douglass <ddougl...@gmail.com> wrote:
> > Greetings,
>
> > I've been following Nu's progress and I'm really excited about what is
> > coming out of it.  I decided to give gem creation a shot by adding a gemspec
> > for the Spark View Engine using a variety of posts:
>
> >    -
> >    http://devlicio.us/blogs/rob_reynolds/archive/2010/07/16/how-to-gems-...
> >    -http://groups.google.com/group/nu-net/web/gempublishers?pli=1
> >    -
> >    http://devlicio.us/blogs/rob_reynolds/archive/2010/07/17/how-to-gems-...
>
> > My question revolves around dependencies.  The current release of the Spark
> > view engine (1.1.0.0) includes some 154 non-required dependencies.  There
> > are just under 10 DLLs required, depending on what language or framework you
> > are utilizing.  Based on that, those 10 DLLs would be placed in the *lib* directory,
> > correct?  How would I approach the dependencies in this case?  Would I need
> > to search rubygems.org for each dependency and add it if it was not there?
> >  That seems like a lot of work to add one gem so I'm hoping that I'm missing
> > something.  Forgive me if I'm overlooking something simple here - I'm new to
> > the Ruby/Gem world.
>
> > Thanks for all your hard work on this project.  I'm really excited about it
> > and plan on blogging on the project once I get a more solid understanding of
> > gem creation.
>
> > --
> > Danny Douglass
> >http://DannyDouglass.com
>
> > P: 571.248.1326
> > E: DDougl...@gmail.com

Dru Sellers

unread,
Aug 9, 2010, 8:25:33 AM8/9/10
to nu-...@googlegroups.com
So, I think I am confused.
Which one is the 'view engine'?

I think based on our current thinking the 'Castle.MonoRail.Views.Spark.dll' would for sure go into some kind of optional folder. So if want to use the spark view engine in a console application that I am writing to build pretty html reports which dlls do I need?

-d

Danny Douglass

unread,
Aug 9, 2010, 8:34:14 AM8/9/10
to nu-net
Only the spark.dll. The other dlls are optional, based on the
language/framework you are utilizing. For example, if I'm creating an
ASP.NET MVC application and wish to utilize the Spark view engine
instead of the standard ASP.NET MVC view engine, I would include two
components: spark.dll and spark.web.mvc.dll.

As I'm talking this out I think I'm approaching this the wrong way.
The gem would be simply the spark.dll and the other dlls would be
optional components. Is that more of the approach I would want to
take? If so, how are optional components handled, if that feature is
even available at this point.

Dru Sellers

unread,
Aug 9, 2010, 8:46:00 AM8/9/10
to nu-...@googlegroups.com
Yeah, the spark.dll is teh main gem, and other things are optional. There is a thread about that optional stuff somewhere in the list.
when I get to work I can help you find it.
-d

Danny Douglass

unread,
Aug 9, 2010, 9:17:29 AM8/9/10
to nu-net
Thanks Dru. I found a few threads discussing the optional components,
and form what I can tell I would structure my gem directory like the
following with optional components:

/lib
/.net-3.5
spark.dll
/opt
/spark.web.mvc.dll
/spark.web.mvc.ruby.dll
/docs
sparkviewengine.gemspec
VERSION

then in the gem install: nu install sparkviewengine -include ???

I saw a few different discussions on how optional components would be
handled, but didn't see anything that was decided. If this is going
down the right route, how would I include the ASP.Net MVC reference as
an optional component and *not* the ruby reference? Would all
optional components be installed regardless?

Dru Sellers

unread,
Aug 9, 2010, 9:33:09 AM8/9/10
to nu-...@googlegroups.com
So stage one, we just copy everything in the 'lib' folder over to the project.
We are working on something more intelligent but right now all of my time is being spent on setting up the server.
I would encourage you to try making the gem and then install it locally with

gem install spark.gem

and then run 'nu install spark'

and see what happens.
you can uninstall with 'gem uninstall spark'

wash rinse repeat until happy. :)
-d

Rob Reynolds

unread,
Aug 9, 2010, 10:26:22 AM8/9/10
to nu-...@googlegroups.com
At this stage of the game, and possibly carrying forward, nu will bring over everything in the lib folder. Then actually referencing what the developer wants becomes the decision process of that developer. I think that's a fair trade off and greatly simplifies things. If someone is using spark or nhibernate, they might want to learn what they should reference. 

What we've talked about is adding an include switch so you could go down to a subdirectory of the gem to get components for like net-2.0 or net-3.5 instead of both and then deleting the one you don't need.

NuForVS which Michael is working on is going to help a little with the referencing aspect of dlls that you want to bring in. That's where we are going to prescribe a best practice to make that story of getting the optionals in as well even more rock solid.

Rob Reynolds

unread,
Aug 9, 2010, 10:40:26 AM8/9/10
to nu-...@googlegroups.com
Also have a look here for other publishing considerations: http://groups.google.com/group/nu-net/web/gempublishers

Charlie Poole

unread,
Aug 9, 2010, 10:50:37 AM8/9/10
to nu-...@googlegroups.com
Hi Rob,

It's sometimes a little hard for newcomers - including myself - to
distinguish what's
being implemented right away from what is more futuristic. Do we have - or could
we get - some sort of roadmap?

Charlie

Rob Reynolds

unread,
Aug 9, 2010, 11:04:35 AM8/9/10
to nu-...@googlegroups.com
Charlie, 
 That's a great idea. Let me see if I can get something up on the wiki this week.

Dru Sellers

unread,
Aug 9, 2010, 11:38:02 AM8/9/10
to nu-...@googlegroups.com
you can always look at http://youtrack.codebetter.com as well for now too.
right now its all about getting the server stood up.

-d

Danny Douglass

unread,
Aug 9, 2010, 12:37:20 PM8/9/10
to nu-net
Thanks guys - I like that direction as well. I saw no problem with
everything being included, but I wanted to make sure I wasn't
"polluting" the gem, so to speak. I'll definitely work on creating
the Spark package tonight after work. I'm really excited to
contribute to this project in any way that I can. I'll keep an eye on
the youtrack site on codebetter as well.

Also, I wrote a blog post this morning showing an example of Nu
through a default ASP.NET MVC 2 project that hooks up AutoFac utlizing
the Nu package.
http://dannydouglass.com/2010/08/whats-new-in-the-dotnet-world/

On Aug 9, 11:38 am, Dru Sellers <d...@drusellers.com> wrote:
> you can always look athttp://youtrack.codebetter.comas well for now too.
> right now its all about getting the server stood up.
>
> -d
>
> On Mon, Aug 9, 2010 at 10:04 AM, Rob Reynolds <ferventco...@gmail.com>wrote:
>
>
>
> > Charlie,
> >  That's a great idea. Let me see if I can get something up on the wiki this
> > week.
>
> > On Mon, Aug 9, 2010 at 9:50 AM, Charlie Poole <charliepo...@gmail.com>wrote:
>
> >> Hi Rob,
>
> >> It's sometimes a little hard for newcomers - including myself - to
> >> distinguish what's
> >> being implemented right away from what is more futuristic. Do we have - or
> >> could
> >> we get - some sort of roadmap?
>
> >> Charlie
>
> >> On Mon, Aug 9, 2010 at 7:26 AM, Rob Reynolds <ferventco...@gmail.com>
> >> >> On Mon, Aug 9, 2010 at 8:17 AM, Danny Douglass <ddougl...@gmail.com>

Danny Douglass

unread,
Aug 9, 2010, 9:28:35 PM8/9/10
to nu-net
Thanks for your help getting going guys. I've created my first gem
for the Spark View Engine: http://rubygems.org/gems/sparkviewengine.
I added it to the list of current packages on the wiki as well:
http://nu.wikispot.org/Current_Packages.

One question I have is that when installing the sparkviewengine nu
package, my docs directory is not installed. I assume this is
intentional since I already have it installed in my ruby gems
directory. Am I correct in that assumption?

Also, I wasn't sure how samples were handled, so instead of adding n-
level of recursion in the docs directory I simply zipped up the
samples and dropped them into docs.


On Aug 9, 12:37 pm, Danny Douglass <ddougl...@gmail.com> wrote:
> Thanks guys - I like that direction as well.  I saw no problem with
> everything being included, but I wanted to make sure I wasn't
> "polluting" the gem, so to speak.  I'll definitely work on creating
> the Spark package tonight after work.  I'm really excited to
> contribute to this project in any way that I can.  I'll keep an eye on
> the youtrack site on codebetter as well.
>
> Also, I wrote a blog post this morning showing an example of Nu
> through a default ASP.NET MVC 2 project that hooks up AutoFac utlizing
> the Nu package.http://dannydouglass.com/2010/08/whats-new-in-the-dotnet-world/
>
> On Aug 9, 11:38 am, Dru Sellers <d...@drusellers.com> wrote:
>
>
>
> > you can always look athttp://youtrack.codebetter.comaswell for now too.

Dru Sellers

unread,
Aug 9, 2010, 9:38:40 PM8/9/10
to nu-...@googlegroups.com
we currently only copy the lib directory.
feel free to put a feature request up for the docs at 'http://youtrack.codebetter.com'

and the source is at 'http://github.com/drusellers/nu' so feel free to fork and implement as well.

working with nick on the server right now.

-d
Reply all
Reply to author
Forward
0 new messages