Top Level Namespace
- Includes:
- GLI::App
Defined Under Namespace
Modules: MCLI
Constant Summary collapse
- APP_NAME =
File.basename $0, File.extname($0)
- CONFIG_FILE =
File.join(ENV['HOME'], ".#{APP_NAME}rc")
Instance Method Summary collapse
-
#date_str(date) ⇒ Object
Human friendly date/time in user’s time zone (almost RFC 2822).
- #print_event_details(event) ⇒ Object
- #query_events(attendance) ⇒ Object
Instance Method Details
#date_str(date) ⇒ Object
Human friendly date/time in user’s time zone (almost RFC 2822)
53 54 55 |
# File 'lib/meetup-cli.rb', line 53 def date_str(date) date.to_time.strftime('%a, %-d %b %Y %H:%M:%S %Z') end |
#print_event_details(event) ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/meetup-cli.rb', line 57 def print_event_details(event) puts "#{event.name.light_blue}" + (/pizza/i.match(event.description) ? " 🍕" : "") + (/(beer|drinks)/i.match(event.description) ? " 🍺" : "") + (/wine/i.match(event.description) ? " 🍷" : "") puts " #{"URL:".magenta} #{event.event_url}" puts " #{"Date:".magenta} #{date_str(event.time)}" puts " #{"Where:".magenta} #{(event.venue.name.nil? ? "Not specified" : "#{event.venue.address_1}, #{event.venue.city}, #{event.venue.state} (#{event.venue.name.colorize(:green)})")}" end |
#query_events(attendance) ⇒ Object
67 68 69 70 71 72 |
# File 'lib/meetup-cli.rb', line 67 def query_events(attendance) MCLI::send('get_' + attendance + '_events').each do |event| print_event_details event puts end end |