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
On RHEL 5.2, I can't do various bundler-related things under "rvm use 1.9.2-p180@rails". works fine under "rvm system". Where should I look for cause? | |
Example: | |
% rvm system | |
% gem install bundler # works | |
% rvm use 1.9.2-p180@rails | |
% gem install bundler |
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
# I'm looking for URL helpers that allow me to generate URLs from within the controller. | |
# All controllers inherit from a common base: | |
class UsersController < ApplicationController | |
… | |
end | |
# This is an API, not a web site: there are no views. Instead, controller methods | |
# use ApplicationController#render_result() to format the result in the requested |
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
# I'm trying to add HTTP BasicAuth to an existing Rails API (not app - no pages or views). | |
# | |
# At http://blog.matthodan.com/how-to-test-something-with-rspec | |
# (and a thousand or so other places) | |
# I find that it's easy to test this: | |
describe SourcesController do | |
describe "#index" do | |
before :each do | |
@request.env['HTTP_AUTHORIZATION'] |
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
# Existing requests (all working): | |
POST /1/organizations => creates a new Organization | |
GET /1/organizations => show Organizations | |
GET /1/organizations/13 => show Organizations[13] | |
# and so on. | |
# Current routes.rb: |
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
Rails::version => "4.0.2" | |
ruby --version => ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0] | |
mysql2 (0.3.16) | |
MySQL 5.5.35-0ubuntu0.12.04.2 | |
Ubuntu 12.04.4 LTS | |
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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '4.0.2' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) | |
# This connection will do for database-independent bug reports. |
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
> jekyll build --trace | |
Configuration file: /Users/Shared/AkStash/open-deployment/_config.yml | |
Deprecation: The 'pygments' configuration option has been renamed to 'highlighter'. Please update your config file accordingly. The allowed values are 'rouge', 'pygments' or null. | |
Source: /Users/Shared/AkStash/open-deployment | |
Destination: /Users/Shared/AkStash/open-deployment/_site | |
Generating... | |
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in _includes/themes/bootstrap-3/default.html, included in _layouts/page.html | |
/Users/jrepenni/.rvm/gems/ruby-2.1.2@open-deployment/gems/jekyll-2.1.1/lib/jekyll/tags/include.rb:114:in `rescue in render': incompatible character encodings: UTF-8 and ASCII-8BIT (Jekyll::Tags::IncludeTagError) | |
from /Users/jrepenni/.rvm/gems/ruby-2.1.2@open-deployment/gems/jekyll-2.1.1/lib/jekyll/tags/include.rb:106:in `render' | |
from /Users/jrepenni/.rvm/gems/ruby-2.1.2@open-deployment/gems/liquid-2.6.1/lib/liquid/block.rb:109:in `block in ren |
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 'jekyll' | |
require 'rmultimarkdown' | |
class Jekyll::Converters::Markdown::RpegMultiMarkdownParser | |
def initialize(config) | |
@site_config = config | |
end | |
def convert(content) | |
MultiMarkdown.new(content).to_html.force_encoding(Encoding::UTF_8) |
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
snowcrash blueprint.apib | |
_version: 2.1 | |
metadata: | |
- name: "FORMAT" | |
value: "1A" | |
- name: "HOST" | |
value: "https://BASE_URL/" | |
name: "MSON demo" | |
description: "# Converted to MSON and Attributes\n\nThis is an API.\n\n### GET\n\nConverted to MSON and Attributes\n\n+ Response 200 (application/json)\n\n + Attributes (object)\n + month (number) - The month we want to fetch data for.\n + Values\n + `1`\n + `2`\n + `3`\n + `4`\n + `5`\n + `6`\n + `7`\n + `8`\n + `9`\n + `10`\n + `11`\n + `12`\n + year (number) - The year we want to fetch data for.\n + reportSourceId (string)\n\n The report source ID, as returned by the reportSources service.\n\n + reportSourceType (string)\n\n The report source type, as returned by the reportSources service.\n\n + statisticType (string)\n\ |
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
FORMAT: 1A | |
# Advanced Attributes API | |
Improving the previous [Attributes](08.%20Attributes.md) description example, this API example describes the `Coupon` resource attributes (data structure) regardless of the serialization format. These attributes can be later referenced using the resource name | |
These attributes are then reused in the `Retrieve a Coupon` action. Since they describe the complete message, no explicit JSON body example is needed. | |
Moving forward, the `Coupon` resource data structure is then reused when defining the attributes of the coupons collection resource – `Coupons`. | |
The `Create a Coupon` action also demonstrate the description of request attributes – once defined, these attributes are implied on every `Create a Coupon` request unless the request specifies otherwise. Apparently, the description of action attributes is somewhat duplicate to the definition of `Coupon` resource attributes. We will address this in the next [Data Structures](10.%20Data%20Structures.md) example. |
OlderNewer