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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>nginx</string> | |
| <key>Program</key> | |
| <string>/opt/nginx/sbin/nginx</string> | |
| <key>KeepAlive</key> | |
| <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
| # post.rb | |
| class Post | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :title, String, :required => true | |
| property :body, Text, :required => true | |
| property :slug, String | |
| before :save, :make_slug |
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
| Then /^I should see the assigned to my students$/ do | |
| @user.students.map(&:notes).flatten.each do |note| | |
| have_note_content(note, :should) | |
| end | |
| end | |
| # @user.students.map(&:notes).flatten is equivalent to | |
| students = @user.students | |
| note_arrays = students.map { |student| student.notes } #shorthand: .map(&:notes) | |
| notes = note_arrays.flatten |
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
| note_ids = NotesStudent.where(student_id: current_user.student_ids).select(:note_id).map {|n| n.note_id } | |
| user_id = current_user.id | |
| @notes = Note.accessible_by(current_ability).where{ (id >> note_ids) | (counselor_id == user_id) } |
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
| module Rack | |
| module Utils | |
| def escape(s) | |
| CGI.escape(s.to_s) | |
| end | |
| def unescape(s) | |
| CGI.unescape(s) | |
| end | |
| end | |
| 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
| source ~/.bashrc > /dev/null | |
| cd . | |
| cp ~/example-database.yml config/database.yml | |
| [ -d jenkins ] && rm -rf jenkins | |
| mkdir jenkins | |
| rake db:schema:load > jenkins/schema_load.txt | |
| bundle install > jenkins/bundler.txt | |
| echo Rspec results available at http://example.com/job/Ducky-develop/ws/jenkins/rspec.html | |
| rake rspec_html > jenkins/rspec.html | |
| echo Cucumber results available at http://example.com/job/Ducky-develop/ws/jenkins/cucumber.html |
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::Core::RakeTask.new(:rspec_html) do |t| | |
| t.pattern = 'spec/**/*_spec.rb' | |
| t.rspec_opts = '--format html' | |
| 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
| module Rubyoverflow | |
| class Base | |
| def initialize(client) | |
| @client = client | |
| end | |
| def fetch(params = {}) | |
| ids = params.delete(:id) if params[:id] | |
| ids = ids.join(';') if ids and ids.kind_of? Array | |
| hash,url = @client.request "#{@path}#{"/#{ids}" if ids}", params |
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
| module Rubyoverflow | |
| class Users < Rubyoverflow::Base | |
| #... | |
| end | |
| 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
| RSpec.configure do |config| | |
| config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
| config.use_transactional_fixtures = true | |
| config.include Rails.application.routes.url_helpers, :type => :request | |
| config.include EmailSpec::Helpers | |
| config.include EmailSpec::Matchers | |
| config.extend VCR::RSpec::Macros | |
| end |