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
Sierras-MacBook-Air:pictr-rails Sierra$ rspec spec/features/user_account_spec.rb | |
/Users/Sierra/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load': /Users/Sierra/code/pictr-rails/spec/features/user_account_spec.rb:18: syntax error, unexpected tIVAR, expecting keyword_do or '{' or '(' (SyntaxError) | |
...s?(email_address: [email protected])).to be_truthy | |
... ^ | |
/Users/Sierra/code/pictr-rails/spec/features/user_account_spec.rb:18: syntax error, unexpected ')', expecting keyword_end | |
...ail_address: [email protected])).to be_truthy | |
... ^ | |
from /Users/Sierra/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `block in load_spec_files' | |
from /Users/Sierra/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `each' | |
from /Users/Sierra/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.4/lib |
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
Sierras-MacBook-Air:pictr-rails Sierra$ tree | |
. | |
├── CODE_OF_CONDUCT.md | |
├── CONTRIBUTING.md | |
├── Gemfile | |
├── Gemfile.lock | |
├── LICENSE.md | |
├── README.md | |
├── README.rdoc | |
├── Rakefile |
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
68 week-03/to_roman.rb Show notes View | |
@@ -1,20 +1,62 @@ | |
-# Method name: to_roman | |
-# Inputs: A number | |
-# Returns: A String representing the number in roman numerals | |
-# Prints: Nothing | |
+def to_roman(num) | |
-# to_roman takes a number as input and returns that number using Roman numerals | |
-# See http://en.wikipedia.org/wiki/Roman_numerals |
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 'openssl' | |
require 'Base64' | |
def encryption(data) | |
cipher = OpenSSL::Cipher::AES.new(128, :CBC) | |
cipher.encrypt | |
key = cipher.random_key | |
iv = cipher.random_iv |
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
class Wall | |
include DataMapper::Resource | |
property :id, Serial | |
property :created_by, String | |
property :title, String | |
property :description, Text | |
property :likes, Integer | |
property :created_at, DateTime | |
end |
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
def rot_n(string, n) | |
rotn_ary = [] | |
n = n % 26 | |
n > 13 ? n2 = (26 - n) : n2 = n # n2 for numbers greater than 13 | |
string.each_char do |char| | |
if char.ord < 65 || (char.ord > 90 && char.ord < 97) || char.ord > 122 | |
rotn_ary.push(char) | |
elsif "z".ord - n >= char.downcase.ord && "z".ord - char.downcase.ord + n >= 26 | |
rotn_ary.push((char.ord + n).chr) | |
else |
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 'open-uri' | |
def textalyzer (string) | |
file_name = ARGV[0] | |
string = open(file_name).read | |
histogram(freq(count(str_char(sanitize(string))))) | |
return | |
end |