Skip to content

Instantly share code, notes, and snippets.

>> content = "a string with 'single' quotes in it"
=> "a string with 'single' quotes in it"
>> content.gsub("'","\'")
=> "a string with 'single' quotes in it"
>> content.gsub("'","\\'")
=> "a string with single' quotes in itsingle quotes in it quotes in it"
>> content.gsub("'","\\\'")
=> "a string with single' quotes in itsingle quotes in it quotes in it"
>> content.gsub("'","\\\\'")
=> "a string with \\'single\\' quotes in it"
umbra:Sites ted$ merb-gen app test
Generating with app generator:
[ADDED] tasks/merb.thor
[ADDED] .gitignore
[ADDED] public/.htaccess
[ADDED] tasks/doc.thor
[ADDED] public/javascripts/jquery.js
[ADDED] doc/rdoc/generators/merb_generator.rb
[ADDED] doc/rdoc/generators/template/merb/api_grease.js
[ADDED] doc/rdoc/generators/template/merb/index.html.erb
umbra:code-nice ted$ spec spec/requests/posts_spec.rb # 10.of { Post.generate(:self_authored) }
FF..*FFFF.F
Pending:
resource(:posts) GET has a list of posts (TODO)
Called from ./spec/requests/posts_spec.rb:51
1)
Merb::Router::GenerationError in 'url(:post_category, 'category') responds successfully'
Named route post_category could not be generated with {}
Lucem ted$ irb
>> module Mod
>> def test
>>
>> puts "test"
>> end
>> end
=> nil
>> Mod.test
NoMethodError: private method `test' called for Mod:Module
Lucem:code ted$ thor -T
cnf
---
cnf:hello Say Hello
Lucem:code ted$ thor hello
The thor:runner namespace doesn't have a `hello' task
Lucem:code ted$ thor cnf:hello
There was no available namespace `cnf'.
17:09:25 <+RichOnRails> here is my merb gems
17:09:28 <+RichOnRails> merb (1.0.7.1)
17:09:28 <+RichOnRails> merb-action-args (1.0.7.1)
17:09:28 <+RichOnRails> merb-assets (1.0.7.1)
17:09:29 <+RichOnRails> merb-auth (1.0.7.1)
17:09:29 <+RichOnRails> merb-auth-core (1.0.7.1)
17:09:30 <+RichOnRails> merb-auth-more (1.0.7.1)
17:09:32 <+RichOnRails> merb-auth-slice-password (1.0.7.1)
17:09:34 <+RichOnRails> merb-cache (1.0.7.1)
17:09:36 <+RichOnRails> merb-core (1.0.7.1)
@knowtheory
knowtheory / gist:44402
Created January 7, 2009 20:23
1st Draft for a Merb Wiki Proposal
## Homepage and Information Routing
### What's Merb?
### Who's using Merb?
## Philosophy
### Public/Private API
### Agnosticism and Componentized Architecture
### Ruby is awesome, use Ruby.
### Principled Development
## Design Principles
### MVC
module Memoizer
def method_added(meth)
@_methods_to_memoize ||= []
@_methods_to_memoize << meth
end
def methods_to_memoize
@_methods_to_memoize
end
end
@knowtheory
knowtheory / gist:45654
Created January 11, 2009 06:00
My stab at fixing the Merb wiki
====== Welcome to the Merb Wiki! =======
===== Homepage and Information Routing =====
Welcome to the Merb Wiki! This wiki is set up in order to help users of all skill levels. Herein you should be able to find information about specific subjects, [[merb|learn more about Merb]] and [[development|how to use it]], and find [[further resources]].
* **__Looking for specific content__**? Or those who like to jump right in, feel free to use the table of contents to the right or [[http://wiki.Merbivore.com/?do=index|the full document index]].
* **__New user__**? We have [[articles]] about [[what Merb is]], and what it's [[history]], [[philosophy]] are, and what [[it's future]] will be (and [[the merge with Rails]]). If you are [[new to Ruby]] as well, we've got [[links for that]] too!
* **__Rails users__** may be interested in the [[differences between Merb and Rails]], and [[tutorials]] on how to get up and running with Merb.
* **__Already a Merbist__**? Looking for more info? You may be in
github.com/lritter/dm-solr-adapter
github.com/hassox/dm-polymorphic
github.com/godfat/dm-mapping
github.com/sunfmin/dm-gitdb
github.com/pius/dm-semantic
github.com/atmos/dm-references
github.com/shanna/dm-sphinx-adapter
github.com/aq1018/dm-is-taggable
github.com/dbussink/dm-constraints
github.com/krobertson/dm-paperclip