2 Replies - 548 Views - Last Post: 08 May 2013 - 02:34 PM Rate Topic: -----

#1 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Starting out a new gem, skeleton generator

Posted 08 May 2013 - 10:56 AM

After doing bundle gem gem_name is there a quick way to setup rspec files such as spec_helper.rb and putting references to rspec in the .gemspec file? I'm noticing that even though I'm using a generator to start out a gem, there's still tons of repetitive typing that gets in the way of my workflow.

This post has been edited by NotarySojac: 08 May 2013 - 10:57 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Starting out a new gem, skeleton generator

#2 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Re: Starting out a new gem, skeleton generator

Posted 08 May 2013 - 12:27 PM

I started playing around with google to configure bundler for this, and that lead to a gem called ore which does pretty much exactly what I need (though I'd like to tweak the rakefile it generates and the docs are a little iffy on how templating works).

$  gem install ore

$  mine project_name --rspec --bundler


Was This Post Helpful? 0
  • +
  • -

#3 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Re: Starting out a new gem, skeleton generator

Posted 08 May 2013 - 02:34 PM

Just to make this thead a little more classy, I'll update with what I've settled into doing.

To rapidly generate a new prototype gem, I've installed ore which sets up the skeleton for me.

$  gem install ore



Now when I want to create a new library (typically I see the need for a new lib when I'm smack in the middle of another project) I just need to invoke ore on the commandline.

$  cd ~/dev/ruby
$  mine app_name



It consults the defaults specified here:

(~/.ore/options.yml)
bundler:        true
gemspec_yml:    true
rubygems_tasks: true
rspec:          true

standard_prototype: true



The ensures that the project has a Gemfile, rspec testing files and a decent Rakefile. Also ato the bottom it says standard_prototype: true. That's a template I jotted up today. I cached it on github and can installed it on the commandline with the below command.

$  ore install https://github.com/TheNotary/standard_prototype



That template adds a bin folder and allows the gem to be called on the command line via gem_name blah which just puts the word blah to the screen.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1