Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

mister_gosh posted:

I'm considering learning and writing a RoR program(s) basically for the hell of it, to learn it. I have a need for a web application that is database dependent (Oracle 10g). If I do not go with RoR there is no way I'd even consider PHP, I'd use Java, JSP, Javascript, etc.

So, given my background and disapproval of PHP, does this sound like a wise use of my time? I'm curious just so I can put another skill under my belt, but that's probably the wrong reason to get into this.

Also, can RoR scripts be runnable from a command line if I had such a use? Can it communicate with COM objects?

Learning a new language is never a poor use of your time.

This is, also, exactly how I got started with Rails. The Oracle adapter is stable and works well.

Running Rails scripts from the command line (really, you're likely to just be using ActiveRecord from the command line) is easy. The best way to do it is with Rake tasks. There should be a guide or something out there if you want to Google it.

If you just want to interact with the Oracle database with command-line scripts and have no interest in the Web part of it, you might want to start out with just Ruby and the ActiveRecord gem. Create some simple scripts, and just "require 'activerecord'" and start going. There's no need to have the big directory structure and all of that if you don't need it.

Adbot
ADBOT LOVES YOU

skidooer
Aug 6, 2001

mister_gosh posted:

Can it communicate with COM objects?
http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/index.html

Ghotli
Dec 31, 2005

what am art?
art am what?
what.
If it's mission critical for you to be able to access COM objects you might not want to go with rails. That said, you can probably access COM objects through java if you use jRuby. Jruby allows you to mix and match java and ruby code in your rails application. The COM stuff could be written through java over some sort of COM bridge. There are some downsides to JRuby though, like the fact that you cannot use any gems that have anything that compiles natively in C. You have to rewrite those gem's functionality in java or use a java backed gem that has been created.

Anyway COM with rails sounds like more trouble than it's worth.

NotShadowStar
Sep 20, 2000

mister_gosh posted:

I'm considering learning and writing a RoR program(s) basically for the hell of it, to learn it. I have a need for a web application that is database dependent (Oracle 10g). If I do not go with RoR there is no way I'd even consider PHP, I'd use Java, JSP, Javascript, etc.

So, given my background and disapproval of PHP, does this sound like a wise use of my time? I'm curious just so I can put another skill under my belt, but that's probably the wrong reason to get into this.

Also, can RoR scripts be runnable from a command line if I had such a use? Can it communicate with COM objects?

Learn RoR without the idea of COM, just learn Rails as Rails first. I've been running into a lot of things that Rails doesn't do automatically and it's difficult navigating around the core trying to figure out where I should modify things. Once you have a grasp on how a Rails application works, then you should think about where you should hook into external objects using non-Rails ways. (I'm guessing you're using COM as a broker for proprietary data, in which case you'd create a non-ActiveRecord model using Win32API and create methods in the model to interact and get data)

skeevy achievements
Feb 25, 2008

by merry exmarx
Has anyone tried RubyMine, from the makers of IDEA for Java? That was (and probably still is) an incredible development environment, I'm still new to Ruby and Ruby tools but I'd be interested to hear experienced coders' opinions as I imagine coming from IDEA it would be easy for me to learn RubyMine.

Sewer Adventure
Aug 25, 2004
How can I expire a cache from a model? expire_fragment only works in controllers.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Sewer Adventure posted:

How can I expire a cache from a model? expire_fragment only works in controllers.

The best idea is to use sweepers and set them up to expire the cache when the model performs certain actions.


At least that's what everyone will tell you in order not to break MVC. Alternatively you can just explicitly call the method you need using something like this:
code:
ActionController::Base.expire_fragment
Except whatever the correct one is instead.

Sewer Adventure
Aug 25, 2004

Nolgthorn posted:

The best idea is to use sweepers and set them up to expire the cache when the model performs certain actions.


At least that's what everyone will tell you in order not to break MVC. Alternatively you can just explicitly call the method you need using something like this:
code:
ActionController::Base.expire_fragment
Except whatever the correct one is instead.

The thing about that strict MVC enforcement poo poo is sweepers don't work when I'm using cron jobs to call script/runner to invoke a Model.method

Pardot
Jul 25, 2001




Rails 2.3 is out. http://guides.rubyonrails.org/2_3_release_notes.html - surprisingly great post about all the new stuff.

Anyone going to be at acts as conference this weekend?

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

Sewer Adventure posted:

The thing about that strict MVC enforcement poo poo is sweepers don't work when I'm using cron jobs to call script/runner to invoke a Model.method

You might want to look into Observers. That way you can keep strict MVC separation but also have it work with models alone. I've used Observers for permissioning for the same reason, and it worked really well.

Evil Trout
Nov 16, 2004

The evilest trout of them all

Pardot posted:

Rails 2.3 is out. http://guides.rubyonrails.org/2_3_release_notes.html - surprisingly great post about all the new stuff.

A small correction: it's a release candidate, not an official release yet.

http://weblog.rubyonrails.org/2009/2/1/rails-2-3-0-rc1-templates-engines-rack-metal-much-more

mister_gosh
May 24, 2002

I'm watching a Rails screencast from peepcode (Rails from scratch part 2). I have tried to watch it a couple times now and 3 minutes in I always turn it off and try to read other resources to confirm something.

He states that with:

code:
ruby script/generate scaffold ModelName
will create a scaffolding for a table name. I assume that means that the model will be "book" if the database table is named "books".

He also states that this puts together a migration that will build these tables in your database.

The application I hope to build while learning Rails is to work with an already existing, and partly 3rd party, database. This database does not have "s" at the end of each table name (am I breaking some cardinal RoR rule here?).

I'm thinking I probably don't want to build a scaffold as the migration is not needed, but then I feel like I'm missing the point here. Does an entire RoR application have to include the creation of almost proprietary type tables for Rails to work with? They can't already exist? By not building a scaffold, am I missing a major point in the ease of building web apps using rails?

I just started learning, so feel free to just say "keep reading" if my questions make no sense.

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

mister_gosh posted:

I'm watching a Rails screencast from peepcode (Rails from scratch part 2). I have tried to watch it a couple times now and 3 minutes in I always turn it off and try to read other resources to confirm something.

He states that with:

code:
ruby script/generate scaffold ModelName
will create a scaffolding for a table name. I assume that means that the model will be "book" if the database table is named "books".

He also states that this puts together a migration that will build these tables in your database.

The application I hope to build while learning Rails is to work with an already existing, and partly 3rd party, database. This database does not have "s" at the end of each table name (am I breaking some cardinal RoR rule here?).

I'm thinking I probably don't want to build a scaffold as the migration is not needed, but then I feel like I'm missing the point here. Does an entire RoR application have to include the creation of almost proprietary type tables for Rails to work with? They can't already exist? By not building a scaffold, am I missing a major point in the ease of building web apps using rails?

I just started learning, so feel free to just say "keep reading" if my questions make no sense.

You don't have to use the generator, it is just easier.

In your case, just create a file in app/models called "book.rb" and start it thusly:

code:
class Book < ActiveRecord::Base
  set_table_name "book"
end
And then you're good to go. If you want unit tests, go create the file in test/unit and create the fixture in test/fixtures. The generators don't do anything magical.

Edit: Also, testing will be difficult in this scenario and I honestly don't know how you'd be able to do it.

Sir Chicken Caesar
Feb 19, 2005

Cock a doodle don't
Fun Shoe

Praetorian42 posted:

You don't have to use the generator, it is just easier.

In your case, just create a file in app/models called "book.rb" and start it thusly:

code:
class Book < ActiveRecord::Base
  set_table_name "book"
end
And then you're good to go. If you want unit tests, go create the file in test/unit and create the fixture in test/fixtures. The generators don't do anything magical.

Edit: Also, testing will be difficult in this scenario and I honestly don't know how you'd be able to do it.

Or you could just run scaffold, then delete the migration and then set up your tables as you suggest.

As for testing, you can clone an existing database via the 'rake db:test:clone' command (although this might fail). See this blog post I found about testing non rails apps via rails which might be useful: http://www.martinicity.net/articles/2007/03/31/testing-a-non-rails-application-using-rails

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I've been playing around with Authlogic for my new application.

It seems to me it is very nice.

For some reason it doesn't have a great grasp of telling me what is best for my database while using it. For instance, the suggestion on the site offers migrations which include :null => false on just about every single field and things like :default => "" etc, but not in all examples. Why are things like this so prevalent in so many gems and plugin tutorials out there? Personally I prefer to handle all of that "is-it-blank?" validation stuff in the model, if it gets by the model I probably planned on it going into the database not being rejected for some reason after it gets there or being replaced with "" instead of being null.

The other thing it seems to not be mentioning is to add indexes to any of the database fields, is this common practice too? I would think for logging in purposes things like the login field should be indexed.

What about all of those <blank>_token fields? Those should be indexed too...

I'm always so confused when I hit the migrations portion of any tutorial because they still seem to not do things the way I do them. Is there a benefit to not indexing fields and is there a benefit to adding restrictions or defaults to the fields in a clean database?


Edit: Besides setting a boolean field to default false or a <blank>_count field to 0...
:shobon:

Also doesn't setting a default on a field in migrations negate the :null => false assignment anyway?

Nolgthorn fucked around with this message at 07:29 on Feb 16, 2009

Hop Pocket
Sep 23, 2003

Nolgthorn posted:

I'm always so confused when I hit the migrations portion of any tutorial because they still seem to not do things the way I do them. Is there a benefit to not indexing fields and is there a benefit to adding restrictions or defaults to the fields in a clean database?

In general, I believe indexes are left out because it really depends on the usage pattern of the application. In a use case where you're only dealing with a small number of rows it probably does not make a huge difference. Separating them out further defines the boundaries of the relationships between the app developer and the DBA (who's job it is to make sure the db is running well). That having been said, I as a rule create indexes on obvious foreign keys. I have also never had the benefit of working with a DBA.

Regarding restrictions -- a lot of it has to do with whether or not there will be different applications hitting the same database. In that case, it makes a lot of sense to back up your model validations with database constraints. That way at least you can be sure that your database will not be left in some crazy state by a non-Rails process that also happens to be writing to it. I'm currently working on a project that has a DB that both the Rails processes and a Java server process access, and it's pretty essential that the constraints be definitively defined at the DB layer. Now, why some would assume that to be the default when creating migrations, I suppose it's really just a matter of preference to the coder.

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

Hop Pocket posted:

Regarding restrictions -- a lot of it has to do with whether or not there will be different applications hitting the same database. In that case, it makes a lot of sense to back up your model validations with database constraints. That way at least you can be sure that your database will not be left in some crazy state by a non-Rails process that also happens to be writing to it. I'm currently working on a project that has a DB that both the Rails processes and a Java server process access, and it's pretty essential that the constraints be definitively defined at the DB layer. Now, why some would assume that to be the default when creating migrations, I suppose it's really just a matter of preference to the coder.

I believe the reason that this is done is with error handling. Databases give lovely and sometimes hard to determine error messages for constraints. Not saying it couldn't be done, but a lot of work would have to be done for each adapter to make it viable.

I think this is something that will eventually come to Rails, but not for another couple of years still.

El Generico
Feb 3, 2009

Nobody outrules the Marquise de Cat!
Hey, I was wondering if anybody could help me with a little problem. I'm trying to learn Ruby on Rails and while setting it up in Ubuntu (intrepid ibex) everything seemed to be going alright until I started a new project and tried to run the web server. It gives me this whenever I try to run it:

code:
=> Booting WEBrick...
/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:259:in `require_frameworks': no such file to load -- openssl (RuntimeError)
	from /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:133:in `process'
	from /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
	from /home/dreich/snapsuplex/config/environment.rb:13
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /home/dreich/.gem/ruby/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
	from /home/dreich/.gem/ruby/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
	from /home/dreich/.gem/ruby/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
	from /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb:59
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /home/dreich/.gem/ruby/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
	from /home/dreich/.gem/ruby/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
	from /home/dreich/.gem/ruby/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
	from /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from script/server:3
Could anybody help me out?

Trabisnikof
Dec 24, 2005

edit: Dang, I have never seen that error before.


In other news Passenger is awesome, but first load is slow. Sports at 11.

Trabisnikof fucked around with this message at 01:02 on Feb 19, 2009

NotShadowStar
Sep 20, 2000
Ah yes, the Ruby install in Ubuntu is kind of half-broken because of bad choices, and unfortunately the maintainer still hasn't fixed it.

I remember you have to install the openssl devel libraries, then getting the Ruby core source, then recompiling OpenSSL from there

http://www.slashdotdash.net/2007/06/27/problem-with-openssl-with-ruby-1-8-6-on-ubuntu-fesity-7-04/

However since you're at that point I'd just recompile Ruby 1.8.7 from source anyway and replace the unoptimized Ubuntu version, which is 1/2 has fast as a compile from scratch version. No idea why. (Install from source is really, really easy. Get source, extract, cd ruby-src, ./configure && make && sudo make install. Done)

http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008/

NotShadowStar fucked around with this message at 01:04 on Feb 19, 2009

hmm yes
Dec 2, 2000
College Slice

Trabisnikof posted:

In other news Passenger is awesome, but first load is slow. Sports at 11.

Yeah, this pisses me off too. I modified my PoolIdleTime to something like 3000s instead of 300s to avoid having to let the sites spin up. Not sure if there are any major drawbacks to that, I'm not aware of any.

El Generico
Feb 3, 2009

Nobody outrules the Marquise de Cat!

NotShadowStar posted:

Ah yes, the Ruby install in Ubuntu is kind of half-broken because of bad choices, and unfortunately the maintainer still hasn't fixed it.

I remember you have to install the openssl devel libraries, then getting the Ruby core source, then recompiling OpenSSL from there

http://www.slashdotdash.net/2007/06/27/problem-with-openssl-with-ruby-1-8-6-on-ubuntu-fesity-7-04/

However since you're at that point I'd just recompile Ruby 1.8.7 from source anyway and replace the unoptimized Ubuntu version, which is 1/2 has fast as a compile from scratch version. No idea why. (Install from source is really, really easy. Get source, extract, cd ruby-src, ./configure && make && sudo make install. Done)

http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008/

Used this to fix it, thank you very much!

EDIT: Yay, a new problem.

I need to "gem install sqlite3-ruby", but it gives me this:

code:
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
	ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install sqlite3-ruby
checking for fdatasync() in -lrt... yes
checking for sqlite3.h... no

make
make: *** No rule to make target `ruby.h', needed by `sqlite3_api_wrap.o'.  Stop.


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
If you need any information, please let me know.

El Generico fucked around with this message at 02:00 on Feb 19, 2009

NotShadowStar
Sep 20, 2000
Install the sqlite devel libraries for Ubuntu and redo the gem installation.

Ruby can either have pure Ruby based extensions, or extensions built on C, much like Python. If you're building a C extension, rubygems will tell you, and if it fails you need to solve it like you would any compiled program. Usually things are C extensions to hook into external libraries and provide a bridge, like sqlite, or if they need to be REALLY fast like the Hpricot XML parser.

narbsy
Jun 2, 2007

NotShadowStar posted:

Install the sqlite devel libraries for Ubuntu and redo the gem installation.

Ruby can either have pure Ruby based extensions, or extensions built on C, much like Python. If you're building a C extension, rubygems will tell you, and if it fails you need to solve it like you would any compiled program. Usually things are C extensions to hook into external libraries and provide a bridge, like sqlite, or if they need to be REALLY fast like the Hpricot XML parser.

You need the ruby headers, should be in a package called 'ruby-dev'. Otherwise the above holds.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Trabisnikof posted:

In other news Passenger is awesome, but first load is slow. Sports at 11.

It still doesn't get us past using god drat horrible awful terrible capistrano though, which is my biggest grief, so it's useless to me until that day which I'm dreaming of.

hmm yes
Dec 2, 2000
College Slice
What is it about Capistrano that you don't like? What is preventing you from just using an alternative? Off the top of my head I can't think of what about using Passenger it is that locks you into capistrano.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I've always felt after being tutored on and using capistrano that it is far too complex for something as simple as a rails deployment. I can perform deployments faster with less issues just using a SFTP client of my choosing.

Really, capistrano is unnecessary all you need is to move the files onto the server, perform some rights management on the files create a symlink and that's it.

This could all probably be done extremely easily with a bash script. Instead capistrano comes lumbering in with it's billions of lines of code and complete absurdity to "do it for me" which is crap too since I have to go out of my way to tell it not to do things that break the deployment if left alone.

I don't even fully grasp the benefit of a server side huge ton bunch of file changes and history of the application, but even that is handled by svn not capistrano.

Capistrano is a big piece of crap. <:mad:>

Trabisnikof
Dec 24, 2005

Nolgthorn posted:

It still doesn't get us past using god drat horrible awful terrible capistrano though, which is my biggest grief, so it's useless to me until that day which I'm dreaming of.

We don't use capistrano with our Passenger deployment at all.

Ghotli
Dec 31, 2005

what am art?
art am what?
what.
Maybe I just don't get it. It took me a few days of scouring google and the capistrano documentation when I built our initial infrastructure. Now we've been using it for over a year with no problems. One command to deploy and another to migrate is quite nice.

I set up my git repository using gitosis and ssh public keys. The webserver and my user on the staging and production servers are in the same group. As is everyone on my development team. Here's my capfile for the perusal.

deploy.rb posted:

set :application, "appname"

# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/rails/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:
set :scm, :git
set :repository, "git@gitserver.domain.com:#{application}.git"
set :branch, "master"
set :deploy_via, :remote_cache

# supposedly helps with ssh to git repo
set :ssh_options, { :forward_agent => true }

# sudo causes permissions hell
set :use_sudo, false

# deploy to staging with:
# cap staging deploy
task :staging do
role :app, "staging.domain.com"
role :web, "staging.domain.com"
role :db, "staging.domain.com", :primary => true
end

# deploy to production with:
# cap production deploy
task :production do
role :app, "production.domain.com"
role :web, "production.domain.com"
role :db, "production.domain.com", :primary => true
end

# Add in stuff to turn off mongrels and turn on passenger
namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "ln -s #{deploy_to}/shared/database.yml #{current_path}/config/database.yml"
run "touch #{current_path}/tmp/restart.txt"
end

[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end

Ghotli fucked around with this message at 06:33 on Feb 20, 2009

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

Nolgthorn posted:

I've always felt after being tutored on and using capistrano that it is far too complex for something as simple as a rails deployment. I can perform deployments faster with less issues just using a SFTP client of my choosing.

Really, capistrano is unnecessary all you need is to move the files onto the server, perform some rights management on the files create a symlink and that's it.

This could all probably be done extremely easily with a bash script. Instead capistrano comes lumbering in with it's billions of lines of code and complete absurdity to "do it for me" which is crap too since I have to go out of my way to tell it not to do things that break the deployment if left alone.

I don't even fully grasp the benefit of a server side huge ton bunch of file changes and history of the application, but even that is handled by svn not capistrano.

Capistrano is a big piece of crap. <:mad:>

Try out Vlad. http://rubyhitsquad.com/Vlad_the_Deployer.html

Simone Poodoin
Jun 26, 2003

Che storia figata, ragazzo!



This week I got introduced to the wonders of HAML/SASS and was further blown away by Compass using the Blueprint CSS framework.

It took me a while to set it up right because Compass only works with HAML 2.1 (which is an svn version), and I had to use rails 2.1 because with 2.0.2 I couldn't freeze the haml/compass gems and with 2.2.2 mysql wouldnt work.

After doing all that I created a sort of complex layout in a couple hours and it looks perfect and consistent in Firefox 3, IE7, Opera and Chrome. I haven't tested in IE6/IE5 and Im not hoping for much, but if it works as good there then this would be the best web design platform ever.

Also, using the Blueprint thing normally leads to ugly markup:

code:
<div class="span-15 prepend-1 colborder">
But with compass the blueprint classes are converted to mixins, so you can have this html:

code:
<div class="nice-column">

With this in the sass file:

code:
.nice-column
  +span(15)
  +prepend(1)
  +colborder
Awesome :D

http://haml.hamptoncatlin.com/
http://acts-as-architect.blogspot.com/2008/11/compass-primer.html

hmm yes
Dec 2, 2000
College Slice
Yeah, the HAML/SASS/Blueprint/Compass combination is really fun to work with. If you have to create a smaller static site, staticmatic is pretty sweet and lets you use all of those as well. You can also setup a pretty straightforward capistrano recipe to checkout/build the site on your server too.

Pardot
Jul 25, 2001




atastypie posted:

Yeah, the HAML/SASS/Blueprint/Compass combination is really fun to work with. If you have to create a smaller static site, staticmatic is pretty sweet and lets you use all of those as well. You can also setup a pretty straightforward capistrano recipe to checkout/build the site on your server too.

I've been using webby for my blog for the last several months and it's been great since it's mostly static anyway

savetheclocktower
Sep 23, 2004

You wait and see, Mr. Caruthers. I will be president! I'll be the most powerful president in the history of America. And I'm gonna clean up this country!
To each his own, of course — HAML has many zealous users and I'm sure it is well-made — but the trend of applying a Ruby frontend to everything drives me insane.

It's bad enough having to re-learn the best way of doing things every six months when I revisit Rails. People keep inventing their own goddamned DSLs for everything and I don't know how they keep them all straight.

I guess I like the ERB approach to things: HTML with splashes of Ruby, rather than RUBY EVERYTHING.

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

savetheclocktower posted:

To each his own, of course — HAML has many zealous users and I'm sure it is well-made — but the trend of applying a Ruby frontend to everything drives me insane.

It's bad enough having to re-learn the best way of doing things every six months when I revisit Rails. People keep inventing their own goddamned DSLs for everything and I don't know how they keep them all straight.

I guess I like the ERB approach to things: HTML with splashes of Ruby, rather than RUBY EVERYTHING.

Eh? Haml isn't any more Ruby than ERB is. Haml is a re-implementation of HTML using a more terse syntax. There are Haml libraries for Python, and several other languages I believe.

savetheclocktower
Sep 23, 2004

You wait and see, Mr. Caruthers. I will be president! I'll be the most powerful president in the history of America. And I'm gonna clean up this country!

Operation Atlas posted:

Eh? Haml isn't any more Ruby than ERB is. Haml is a re-implementation of HTML using a more terse syntax. There are Haml libraries for Python, and several other languages I believe.

Ah, how sloppy of me. I think I was thinking of Markaby.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

savetheclocktower posted:

Ah, how sloppy of me. I think I was thinking of Markaby.
Ohh neat!


There does seem to be a trend towards Ruby but Ruby is a really really good high level programming language.

bitprophet
Jul 22, 2004
Taco Defender

Nolgthorn posted:

There does seem to be a trend towards Ruby but Ruby is a really really good high level programming language.

Well, the "trend towards Ruby" is largely (IMO) because many Ruby/Rails folks can't stand to use anything else and will generally bend over backwards to rewrite perfectly decent and integrate-able existing tools in Ruby. Not Invented Here Syndrome to the max! (For example, God, which is also a terrible, awful name for a piece of software.)

Not that other languages don't have NIHS, of course, but it seems to be worse for Rubyists.


And to be more on-topic, Haml gets a lot of love from the Rails guys where I work, and they're relatively down to earth, so it must be pretty good :) I haven't been able to work with it myself yet, still stuck in the Rails 1.2 / ERb maintenance ghetto when I'm on the programming side.

manero
Jan 30, 2006

atastypie posted:

What is it about Capistrano that you don't like? What is preventing you from just using an alternative? Off the top of my head I can't think of what about using Passenger it is that locks you into capistrano.

I always would get pissed when I tried to look up documentation (ha!) or wondered why it isn't just a bunch of Rake tasks.

I try to ignore it and I scrape by with just enough of a recipe to deploy under passenger.


Operation Atlas posted:

Try out Vlad. http://rubyhitsquad.com/Vlad_the_Deployer.html

Checking this out, thanks.

Adbot
ADBOT LOVES YOU

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Drogadon posted:

This week I got introduced to the wonders of HAML/SASS and was further blown away by Compass using the Blueprint CSS framework.


Awesome :D

http://haml.hamptoncatlin.com/
http://acts-as-architect.blogspot.com/2008/11/compass-primer.html

I've just been working with this today! A few notes:

Here is the guide I used to get up and running with compass and blueprintcss on Rails:
http://github.com/chriseppstein/compass-rails-sample-application/blob/81ab7a654754e30f76560018c58b90d05e8200dd/README

After that I wanted to vendor the gem, so I added these two lines to my environment.rb:
code:
Rails::Initializer.run do |config|
  config.gem "haml"
  config.gem "chriseppstein-compass", :lib => "compass", :source => "http://gems.github.com/"
end
And ran:
rake gems:unpack

Bada bing bada bang boom!

In addition I found that when trying to use +showgrid with this gem it was pointing to the grid.png image in the wrong place. I had to change the gem in <gem>/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass, line 1 and line 4.

From: images/grid.png
To: /images/grid.png

Now everything works, I'm on Rails 2.2.2.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply