This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pry' | |
| class Array | |
| def version_sort | |
| array = self.sort_by do |file| | |
| file.gsub(/[a-z].ext/) {|x| x.ord } | |
| end | |
| array.sort_by do |item| | |
| item.scan(/\d+|[a-z]*/).collect do |el| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'json' | |
| require 'rest_client' | |
| reddit_hash = JSON.parse(RestClient.get('http://reddit.com/.json')) | |
| html_reddit = "<html><head></head><body><ul>" | |
| reddit_hash["data"]["children"].each do |post| | |
| next if post["data"]["over_18"] == true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RSpec.configure do |config| | |
| # Use color in STDOUT | |
| config.color_enabled = true | |
| # Use color not only in STDOUT but also in pagers and files | |
| config.tty = true | |
| # Use the specified formatter | |
| config.formatter = :progress # :progress, :html, :textmate | |
| end |
OlderNewer