Giter Club home page Giter Club logo

rspec.github.io's Introduction

rspec.github.io

Source for https://rspec.info

Requires a recent version of Ruby (tested on 2.7.5, Ruby 3.x is not yet working), bundler and imagemagick (to generate favicons).

Local Setup

  • brew install imagemagick (or your package manager of choice).
  • brew install nodejs (or your javascript runtime of choice for execjs).
  • bundle install
  • middleman build

Local Developing

Run LIVERELOAD=true middleman server

Docker Setup + Development

If you don't have a local Ruby environment suitable to making changes to rspec.info, or prefer containerised development; use the following scripts to build the included Docker image and build the site in the containerised environment instead.

# Start the middleman server. Access site at http://localhost:4567
bin/server

# Build the site in the `docs/` directory. Replacement for `middleman build`.
bin/build

# Start a console inside the docker container. Useful for debugging or running commands locally.
bin/console

Deploying

We now use the Github action in .github/workflows/middleman_deploy.yml to automatically build and deploy, builds are run on PR to ensure they "work" but you should check the artifacts locally / in the build before merging.

Credits

Andrew Harvey - for his incredible effort of making this repository as it is now

rspec.github.io's People

Contributors

andyw8 avatar antn avatar benoittgt avatar bf4 avatar brenfrow avatar cohitre avatar dchelimsky avatar dependabot[bot] avatar epidemian avatar exoego avatar francois2metz avatar igor-alexandrov avatar imtayadeway avatar jonrowe avatar joshcheek avatar juanitofatas avatar ku1ik avatar mico avatar mootpointer avatar myronmarston avatar ngtk avatar pirj avatar soulcutter avatar thomascchen avatar threeplanetssoftware avatar tombruijn avatar tomstuart avatar w1ldr avatar xaviershay avatar yujinakayama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rspec.github.io's Issues

Blog post headings mis-sized

If you look at one of the blog posts that has titled sections, you'll notice that the section headings are styled identically to the blog post title. This is because they are all <h2> tags.

Ideally the section headings would be styled to look less prominent. I think the solution is to change the blog post template to use an <h1> for the blog post title and then update the styles appropriately.

HTML title is the same for every page

The title tag in the head is hardcoded to "RSpec: Behaviour Driven Development for Ruby". That's a good title for the homepage but it seems like the different sections should cause the title to change, and for any blog posts, the title of the blog post should be the title of the page.

I can take a stab at this but I'm guessing there are standard middleman patterns to handle this. @JonRowe, do you have a pattern in mind for this?

Inform user about deprecated doc

Hello

When searching RSpec documentation online. I often end up on a page documentation of RSpec gems bellow 2.99.

I was thinking about the best way to mark our doc as deprecated. Few ideas:

  • Add a block to tell the reader that he/she is not on the last version with an easy link to jump to current. We can see this on PostgreSQL

Capture d’écran 2020-10-18 à 23 00 38

  • Maybe too powerful... Disable search engine indexing on old version? The best should be to change the SEO but I do not have those magic capabilities.

  • Set a new documentation for RSpec 4? VCR had a discussion.

Deploy occasionally borks doc styling

This happened to me before and it appears to have happened again:

screen shot 2015-02-01 at 4 46 50 pm

I'll be deploying shortly to get @JonRowe's improvements out there, which should hopefully fix the issue but we should figure out why it happens.

RSpec logo process

Pulling out the conversation from #6 into its own thread here. I think the logo competition can be run separately from the website redesign effort, though the logo will likely inform the new visual design.

From a process standpoint, once we have a means to collect submissions I think it makes sense to run a "submission phase" where we would solicit submissions from the community for a month or so.

Assuming a manageable number of submissions, we could commence voting for the next 30 days or however long. If there are enough submissions, perhaps multiple rounds of votes are appropriate. We'd also have to decide if each user gets multiple votes to spread around or just a single vote.

Technical challenges might also inform how the contest is run. From that perspective, I was hoping to find an existing community or open source project we could use, but it might make the most sense to build something. I don't think it'd be too hard. Features would be:

  • Login via OAuth
  • Upload Images
  • View and sort images
  • Vote on images
  • Comment on images (maybe?).

Listing that out, it's hard to believe this doesn't already exist. My first thought was to use dribbble, but I don't think it supports voting. It might make sense if we want a small committee to select from the overall pool, but not for community voting. I'll look around to see if there's anything else out there we could use.

Style guide

It'd be nice for the RSpec website to include a brief "recommended" style guide, it's something that's been talked about before and occasionally pops up in discussion (today's via twitter). I know betterspecs.org exists but in the past we've disagreed over what constitutes "better" and I think it'd be nice to have a short synopsis of what we think are good practises to follow.

/cc @keithpitty

Site uses old syntax in example

The live website uses the old should syntax.

# bowling_spec.rb
require 'bowling'

describe Bowling, "#score" do
  it "returns 0 for all gutter game" do
    bowling = Bowling.new
    20.times { bowling.hit(0) }
    bowling.score.should eq(0)  # <-------
  end
end

The code snippet in this repo uses the new expect syntax

# bowling_spec.rb
require 'bowling'
describe Bowling, "#score" do
  it "returns 0 for all gutter game" do
    bowling = Bowling.new
    20.times { bowling.hit(0) }
    expect(bowling.score).to eq(0)  # <-------
  end
end

So I'm guessing the update just hasn't been deployed yet?

Refresh rspec.info for v3

In Myron's blog post, he asked for help in updating the rspec.info site. I'd like to contribute with that, but I'm curious what the maintainers think the best way to go about this is.

My immediate thought is that a Github Pages site would be perfect for this kind of thing. I have the current site saved as a Markdown file that could generate a GH Pages site rather quickly, but I'm not sure whether it belongs in a branch here, or in the rspec repo. If it was in a gh-pages branch on this repo, clicking the "fork this" or "see source" etc. would go to the rspec-website repo, which might be different than what people would expect (the rspec/rspec repo).

Either way, I'm really interested in helping out here, so let me know what you guys think is the best way to proceed.

Rspec.info rebuild

I've been talking for a while with Myron about Ninefold helping out with the design/build/hosting of Rspec.info. Here's the work that we started with our designer today. Tomorrow we're going to start looking at the branding and logo.

Home page: https://redpen.io/d6bk2o

About page (and template for doc/other pages): https://redpen.io/t9keu6

The idea was to create a landing/home page which concisely expressed the benefits of rspec and showed off how to use it without being too cluttered. This could be matched with a template which is easily used for documentation and "about" style pages. Most notably, the four rough segments I established: documentation, project info (about), where to get help, and how to contribute.

These are quite early layouts, and we'd appreciate some feedback on where we've got to thus far. You can annotate the linked images and we'll take that into our work tomorrow and moving forward.

The plan would be to build in middleman and host on Ninefold. This would of course be at no cost :)

Docs javascript not referenced correctly for 3.6 docs

On the docs pages for each library, there is a search box for classes, methods and files that uses JS for a nice experience. Here's a working example:

http://rspec.info/documentation/3.5/rspec-core/

But if you try that same page on 3.6 the JS isn't working:

http://rspec.info/documentation/3.6/rspec-core/

If you look at the <head> for each page, you can see they reference the javascript files differently:

<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

<script type="text/javascript" charset="utf-8" src="js/app.js"></script>

(That's 3.6 where it's not working.)

vs

<script type="text/javascript" charset="utf-8" src="/javascripts/docs/jquery.js"></script>

<script type="text/javascript" charset="utf-8" src="/javascripts/docs/app.js"></script>

(That's 3.5 where it is working.)

@JonRowe do you have any ideas what's causing this?

@samphippen did you get any strange warnings when you generated the docs for 3.6?

CNAME file is blown away on every deploy

It took me a while to figure out why our CNAME file wasn't working. We had it in our source branch ut not in our master branch. As github's docs state, it needs to be in the master branch:

https://help.github.com/articles/adding-a-cname-file-to-your-repository/

I added it to master and that made it work. Then I noticed on the next deploy that it was blown away by the deploy (since middleman apparently force pushes -- is that really necessary?).

@JonRowe / @mootpointer -- do either of you know how to configure our deploy so that it won't blow away extra files (such as the CNAME) on each deploy? For now I'm just re-adding it manually after each deploy but that's no fun.

Many relative links are broken (because Github Pages adds trailing slashes)

Hello! I recently submitted the PR #187 that fixed a few relative links on the website.

After, I wondered if there were any more. I checked out the repo, started middleman and ran broken-link-checker. I was surprised to find: It reported the exact links that I just fixed.

Indeed: Due to the fact that middleman does NOT add trailing slashes to paths, but Github Pages does, the website works perfectly fine in development, but not in production.

I installed Rack Rewrite and added this to the config.rb to sync the behaviour:

require 'rack/rewrite'

configure :development do
  use ::Rack::Rewrite do
    # add trailing slash, like Github Pages
    r301 %r{/features/(.*)}, '/features/$1/', not: %r{/$}
  end
end

I ran the broken-link-checker again, and this time, it found links that were really broken, around ~75. I think they all have the same problem, that don't account for the trailing slash.

I was wondering if it would make sense to fix these in a PR or not? I noticed that the markdown files basically mirror the files in the repo: https://github.com/rspec/rspec-rails/blob/main/features/controller_specs/README.md so I'd guess that it doesn't make sense to edit all the files here manually?

I'd be happy to help, but I think I need someone to point me in the right direction.

Staging deploy results in page build warning email from GitHub

When you deploy to staging, we receive this email from GitHub

[rspec-staging.github.io] Page build warning

The page build completed successfully, but returned the following warning:

CNAME already taken: rspec.info

For information on troubleshooting Jekyll see:

https://help.github.com/articles/using-jekyll-with-pages#troubleshooting

If you have any questions please contact us at https://github.com/contact.

This occurs because of @JonRowe's fix in #43 for #41. The rspec.info CNAME file gets copied to the staging repo and triggers this email. @JonRowe is there a way to add a step to staging deploys that prevent this file from being copied over? If not, the email isn't a big deal and we can ignore it but if it's a simple fix it'd be nice to fix it.

Most documentation pages have empty `<title>` tags

I noticed that in web search results, results from rspec.info have empty titles (or show inconsistent text), making it unclear what's on each page. The cause is that the <title> tags are empty for most pages, except those with frontmatter (e.g. #32).

If the first H1 could be used as the default for the title in the absence of frontmatter, that should solve the issue without having to add titles to every page manually.

Either way, ensuring pages have titles is useful for both accessibility and search engines and would be a real help to be added to the RSpec docs.

patreon for RSpec

is RSpec core team considering opening Patreon account ?

I'm one of many developers that don't have time to contribute with code but feel guilty and would happily contributed with some monthly micro-payment for all the effort you guys are doing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.