Class: MyScripts::Jew

Inherits:
Script
  • Object
show all
Defined in:
lib/my_scripts/scripts/jew.rb

Overview

This script uses Jeweler to create new project skeleton, local git repo and initiate remote repo on github

Constant Summary collapse

VERSION =
'0.1.0'

Instance Method Summary collapse

Methods inherited from Script

#error, #gets, #initialize, #puts, #system, #to_s, #usage, #version

Constructor Details

This class inherits a constructor from MyScripts::Script

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/my_scripts/scripts/jew.rb', line 8

def run
  usage "project_name Summary or description goes here" if @argv.empty?

  # First Arg should be project name
  name = @argv.shift

  # All the other args lumped into summary, or default summary
  summary = @argv.empty? ? "New project #{name}" : @argv.join(' ')

  puts "Creating Jeweler project #{name} with summary/description: #{summary}"

  success = system \
  %Q[jeweler --rspec --cucumber --create-repo --summary "#{summary}" --description "#{summary}" #{name}]
  if success
    puts "Now you need to fix these files:"
    system "cd #{name} && git grep FIXME"
  end
end