githubnext / githubnext/monaspace

Add Ruby code preview to website

Open
#40 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
19.6k
Forks
322
PR merge metrics
No merged PRs in 30d

Description

I want to see how it looks with Ruby source code.

![image](https://github.com/githubnext/monaspace/assets/1383035/a67daf62-5fd9-4df1-a4a7-c8b1371e7183)

Feel free to use this snippet:
```rb
class Person
attr_accessor :name, :age

def initialize(name, age)
@name = name
@age += age
end

def ==(other)
@name == other.name && @age == other.age
end

def <=>(other)
@age <=> other.age
end

def !~(other)
@name !~ other.name || @age != other.age
end

def =~(other)
@name =~ other.name && @age == other.age
end

def <<(other)
@name << other.name
end

def >>(other)
@age >> other.age
end

def **(other)
@age ** other.age
end

def &&(other)
@name && other.name && @age && other.age
end

def ||(other)
@name || other.name || @age || other.age
end
end

alice = Person.new("Alice", 30)
bob = Person.new("Bob", 35)

puts alice == bob # => false
puts alice <=> bob # => -1
puts alice !~ bob # => true
puts alice =~ bob # => false
puts alice << bob # => "AliceBob"
puts alice >> bob # => 30
puts alice ** bob # => 9000000000000000
puts alice && bob # => true
puts alice || bob # => true
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the website code that assembles the existing code previews and compare how other source languages are represented. Add the supplied Ruby snippet where appropriate, then verify that the website renders the Ruby source correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
web-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.