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 'mongoid' | |
| require 'mechanize' | |
| Mongoid.load!("./mongoid.yml") | |
| Mongoid.configure do |config| | |
| config.master = Mongo::Connection.new.db("so_users") | |
| end | |
| class SOUser | |
| include Mongoid::Document |
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
| <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"> </script> | |
| <script language="javascript"> | |
| url = "http://twitter.com/status/user_timeline/priyaaank.json?count=10&callback=?" | |
| jQuery.getJSON(url, function(data){ | |
| console.log(eval(data)); | |
| }); | |
| </script> |
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 'http://rubygems.org' | |
| source 'http://rubyforge.org/' | |
| gem 'mechanize' | |
| gem "mongoid" | |
| gem "bson_ext" |
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
| Webapp::Application.routes.draw do | |
| get 'home' => 'home#show' | |
| # added for our cukes to run faster, | |
| # in most cases circumventing the whole | |
| # login process | |
| if Rails.env.test? | |
| devise_scope :user do | |
| get '/login' => 'backdoor#login' |
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
| Webapp::Application.routes.draw do | |
| # added for our cukes to run faster, | |
| # in most cases circumventing the whole | |
| # login process | |
| devise_scope :user do | |
| get '/login' => 'backdoor#login' | |
| get '/logout' => 'backdoor#logout' | |
| 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 :rubygems | |
| ruby "1.9.3" | |
| gem 'rails', '~> 3.2.0' | |
| gem 'mongoid', "~> 3.0.5" | |
| gem 'bson_ext' | |
| gem 'grape' |
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 ContactInfo | |
| include Mongoid::Document | |
| field :address_line, :type => String | |
| field :city, :type => String | |
| field :country, :type => String | |
| field :zipcode, :type => String | |
| field :state, :type => String | |
| embeds_many :phone_numbers |
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 API < Grape::API | |
| format :json | |
| error_format :json | |
| version 'v1', :using => :header, :vendor => "App" | |
| rescue_from Mongoid::Errors::DocumentNotFound do |error| | |
| rack_response({"error" => {"message" => "We didn't find what we were looking for"}}.to_json, 404) | |
| 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
| Vagrant::Config.run do |config| | |
| # All Vagrant configuration is done here. The most common configuration | |
| # options are documented and commented below. For a complete reference, | |
| # please see the online documentation at vagrantup.com. | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| config.vm.box = "ci" | |
| # Assign this VM to a host-only network IP, allowing you to access it | |
| # via the IP. Host-only networks can talk to the host machine as well as |
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
| #!/usr/bin/env ruby | |
| #^syntax detection | |
| site 'http://community.opscode.com/api/v1' | |
| cookbook 'apt' | |
| cookbook 'apache2' | |
| cookbook 'jenkins' |
OlderNewer