This file contains 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
# irb 0.9.6(09/06/30) | |
# ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] | |
2.0.0p247 :001 > ^C | |
# I entered ^D at this point, but it didn't show up. | |
2.0.0p247 :001 > | |
#<Class:0x000000025c4750>: No live threads left. Deadlock? | |
from /home/jake/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ext/multi-irb.rb:231:in `stop' | |
from /home/jake/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ext/multi-irb.rb:231:in `irb' | |
from /home/jake/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/cmd/subirb.rb:19:in `execute' | |
from /home/jake/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/cmd/nop.rb:20:in `execute' |
This file contains 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
PostgreSQL | |
gem install pg | |
- Postgres interface access through Ruby | |
su - postgres | |
(or use: sudo su … then once logged in as root… su postgres to switch to postgres user) | |
-This will switch to the postgres user for setup | |
Initialize DB Cluster & give access to postgres user |
This file contains 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
#=> spec/features/seeds_spec.rb | |
require 'spec_helper' | |
feature "Seed Data" do | |
scenario "The basics" do | |
#Load bin/rake task code prior to running | |
load Rails.root + "db/seeds.rb" | |
user = User.where(email: "[email protected]").first! | |
project = Project.where(name: "Ticketee Beta").first! | |
end | |
end |
This file contains 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
##Tickets Controller | |
class TicketsController < ApplicationController | |
before_action :require_signin! #except: [:show, :index] (temp-disabled) | |
before_action :set_project | |
before_action :set_ticket, only: [:show, :edit, :update, :destroy] | |
#Restrict Permissions (creating tickets) | |
before_action :authorize_create!, only: [:new, :create] | |
before_action :authorize_update!, only: [:edit, :update] | |
before_action :authorize_delete!, only: :destroy |
This file contains 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
##SPEC TRACE## | |
Failures: | |
1) Creating Tickets Creating a ticket with an attachment | |
Failure/Error: click_button "Create Ticket" | |
TypeError: | |
can't cast ActionDispatch::Http::UploadedFile to string | |
# /home/jake/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `type_cast' |
This file contains 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
Updating git://github.com/radar/searcher | |
Fetching gem metadata from https://rubygems.org/......... | |
Fetching gem metadata from https://rubygems.org/.. | |
Resolving dependencies... | |
Bundler could not find compatible versions for gem "activerecord": | |
In Gemfile: | |
searcher (>= 0) ruby depends on | |
activerecord (~> 3.0) ruby | |
rails (= 4.0.0) ruby depends on |
This file contains 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
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux] | |
Rails 4.0.2 | |
Gem 2.2.0 | |
rvm 1.25.13 (stable) | |
[jake@white ServiceDesk]$ rails s | |
=> Booting WEBrick | |
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000 | |
=> Run `rails server -h` for more startup options | |
=> Ctrl-C to shutdown server |
This file contains 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 Computer < ActiveRecord::Base | |
validates :make, presence: true, length: { maximum: 23 } | |
validates :model, presence: true, length: { maximum: 23 } | |
#ESN or MEID lengths should be expected, but we'll use 23 just 'cuz | |
validates :serial_number, presence: true, length: { maximum: 23 } | |
belongs_to :customer | |
end |
This file contains 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 'taglib' | |
arr = ["examples/toons/toki/wrongdirname/4. Cigarette Lust.mp3", | |
"examples/toons/toki/wrongdirname/wrongartistlocation/07 - Towers (Ft. Szjerdene).mp3", | |
"examples/toons/04-caspa-i_beat_my_robot-jah.mp3", | |
"TuneSort.rb"] | |
arr.each do |ele| | |
TagLib::FileRef.open ele { |e| | |
puts e |
This file contains 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
#!/usr/bin/env ruby | |
puts "Enter the tags for this post: " | |
tags = gets.chomp | |
date = Time.now.to_s.split(' ').first | |
args = ARGV | |
file_title = args.join("-") | |
post_title = args.join(" ") |
OlderNewer