Skip to content

Instantly share code, notes, and snippets.

View ujihisa's full-sized avatar

ujihisa ujihisa

View GitHub Profile
aaa
this is a test for gist.vim
:-)
" textobj-ruby - Text objects for Ruby
" Version: 0.0.1
" Copyright (C) 2008 ujihisa <http://ujihisa.nowa.jp/>
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" settings {{{
filetype plugin indent on
set encoding=utf-8
set termencoding=utf-8
set fileencodings=euc-jp,cp932,iso-2022-jp
set fileformats=unix,dos,mac
set ignorecase
set smartcase
set number
set ruler
module SelfStorage
# get :: IO [String]
def self.get
raise unless defined? DATA
DATA.readlines.map(&:chomp)
end
# append :: [String] -> IO ()
def self.append(ss)
raise unless defined? DATA
abstract (1.0.0)
actionmailer (2.3.2, 2.2.2, 2.1.2)
actionpack (2.3.2, 2.2.2, 2.1.2)
actionwebservice (1.2.6)
activerecord (2.3.2, 2.2.2, 2.1.2)
activeresource (2.3.2, 2.2.2, 2.1.2)
activesupport (2.3.2, 2.2.2, 2.1.2)
addressable (2.0.2)
andand (1.3.1)
ap4r (0.3.7, 0.3.6)
class Array
def change!
self << 1
end
end
a = [1, 2, 3]
p a.change! == a
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: README.md
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .README.md.swp
diff --git a/app/controllers/comments.rb b/app/controllers/comments.rb
index 531ea2f..7c59fab 100644
--- a/app/controllers/comments.rb
+++ b/app/controllers/comments.rb
@@ -26,9 +26,10 @@ class Comments < Application
end
def create(comment)
- @comment = Comment.new(comment)
+ @post = Post.get(params[:post_id])
diff --git a/hash.c b/hash.c
index e80051e..9de7b8b 100644
--- a/hash.c
+++ b/hash.c
@@ -2624,8 +2624,8 @@ Init_Hash(void)
rb_define_method(rb_cHash,"to_hash", rb_hash_to_hash, 0);
rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0);
- rb_define_method(rb_cHash,"to_s", rb_hash_inspect, 0);
rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);