Skip to content

Instantly share code, notes, and snippets.

View jendiamond's full-sized avatar
🏠
Working from home

JenDiamond jendiamond

🏠
Working from home
View GitHub Profile
## [Thor](http://whatisthor.com/) - Interpreted by Jen Diamond
Thor is a toolkit for building powerful command-line interfaces. It is used in Bundler, Vagrant, Rails, and 197 other gems.
Getting Started
A simple Thor class exposes an executable with a number of subcommands, like git or bundler. In a Thor class, public methods become commands.
class MyCLI < Thor
desc "hello NAME", "say hello to NAME"
def hello(name)
@jendiamond
jendiamond / gist:6118263
Created July 31, 2013 00:19
Week 3 Day 11
## [Thor](http://whatisthor.com/) - Interpreted by Jen Diamond
Thor is a toolkit for building powerful command-line interfaces. It is used in Bundler, Vagrant, Rails, and 197 other gems.
Getting Started
A simple Thor class exposes an executable with a number of subcommands, like git or bundler. In a Thor class, public methods become commands.
class MyCLI < Thor
desc "hello NAME", "say hello to NAME"
def hello(name)
@jendiamond
jendiamond / gist:6118266
Last active November 13, 2016 05:56
Week 3 Day 11

Creating your own Gem

  1. Run this command in your Terminal. This creates and names all the files you need for your gem. We are going to create a Lorem Ipsum Generator; you can call it whatever you want but seeing as we are creating a Lorem Ipsum generator we'll call it lorem. Read about gem naming conventions.

     $ bundle gem lorem
    

    Notice that this command also initialized a git repository for you on your local machine and gives you the path name for it.

  2. cd into lorem. Make your lorem.gemspec file look like this. Add your name and your email. Read more about the gemspec file.

@jendiamond
jendiamond / gist:6128633
Created August 1, 2013 05:34
Week 3 Day 12

Week 3 Day 12

Due Diligence - Bundle Gem & Thor CLI

What We Did

  • More Thor. We created our cheatsheets for Creating a Gem and Using Thor to Add CLI. We fixed the Thor files so it actually prints Lorem Ipsum instead of the Thor hello name message from the tutorial.

  • We found out that we get to attend the Distill Conference next week. This is perfect because Jessica will be speaking there and we will get to meet our mentor Andre in person. We are gearing up to give a lightning talk on Creating a Gem & Using Thor to Add CLI.

@jendiamond
jendiamond / gist:6128723
Last active April 11, 2024 11:35
Creating your own Gem & Command Line Interface Using Bundler

Presentation slides

Create a Gem - Make it a CLI - Add Rspec Tests

Create a Gem - Make it a Command Line Interface - Add Rspec Tests Using Bundler & Thor

#Creating your own Gem

  1. Run this command in your Terminal. This creates and names all the files you need for your gem. We are going to create a Lorem Ipsum Generator; you can call it whatever you want but seeing as we are creating a Lorem Ipsum generator we'll call it lorem. Read about gem naming conventions.
@jendiamond
jendiamond / gist:6134783
Created August 1, 2013 20:09
Week 3 Day 13
http://stackoverflow.com/questions/4398262/setup-rspec-to-test-a-gem-not-rails
Rspec Book Chapter 5
http://tutorials.jumpstartlab.com/topics/creating_a_gem.html
@jendiamond
jendiamond / gist:6144433
Last active December 20, 2015 14:09
Week 3 Day 14

More Gem Production and Testing

Alt gems

We were both reading about Rspec in the Pragmatic Programmer's The RSpec Book (Behaviour-Driven Development with RSpec, Cucumber, and Friends) by David Chelimsky

We also were looking at Peepcode's Rspec Screencast.

Jen's Friday


@jendiamond
jendiamond / gist:6169493
Last active December 20, 2015 17:29
Bundler Website/Documentation

General Notes

  1. Each page except the main page could have a small bundler logo at the top left as an index/HOME link
  2. A side Bar would be very useful
  3. There are 11 Learn More Pages - This needs it's own Link - Perhaps in side Bar and in the Learn About section
  4. There are 6 Man Pages - This needs it's own Link - Perhaps in side Bar and in the Learn About section
  5. There are a lot of horizontal rule tags separating the page sections which looks cluttered and a bit confusing. I think the pages just need to be broken down into smaller bits than using anchor tags to move around. It will make the information clearer and easier to navigate.

Site Breakdown with Notes

@jendiamond
jendiamond / gist:6178823
Last active December 20, 2015 18:49
Week 4 Day 16

Week 4 Day 16 Documentation

Today we started working on improving the documentation on the Bundler website. We all agree that the site needs better navigation.

Jen's Friday

I went through every page of the Bundler site testing buttons, links and identifing problems with the structuring of the information. I found a 404 error. My notes. I also fixed the slide presentation for our possible talk at Distill tomorrow. I really hope that happens.

Joyce' Friday

@jendiamond
jendiamond / gist:6182214
Last active December 20, 2015 19:19
Week 4 Day 17

Week 4 Day 17

How I love ya, Friscoooo

All 3 of us flew to San Francisco today. Every time I think about San Francisco I think of this Frank Zappa & The Mothers song - Who Needs the Peace Corps ? <iframe width="420" height="315" src="//www.youtube.com/embed/WnjufR8GDcw" frameborder="0" allowfullscreen></iframe>

While Jessica attended a speaker's dinner we went to the Mission. We went to Curry Up Now then we saw the band Gaucho at Amnesia Here's their myspace(https://myspace.com/gauchosf) It is important to have culture and inspiration.

The hotel is beautiful and the rooms are so comfortable and posh. Thanks Distill, Engineyard and Rails Girls Summer of Code!