Hi there,
I'm looking for a tool that can highlight code (ruby, php, javascript...) like with an IDE and then export the code to html format so that when opening the html page the code looks just like with the IDE
Thanks.
...
I'm new to Ruby, and I've been trying to learn Rake, RSpec, and Cucumber. I found some code that will help me test my Rake tasks, but I'm having trouble getting it to work. I was told here: http://blog.codahale.com/2007/12/20/rake-vs-rspec-fight/to drop this:
def describe_rake_task(task_name, filename, &block)
require "rake"
des...
See the full error here: http://notesapp.heroku.com/
I'm using DataMapper and dm-validations 0.10.2. No matter how much I tweak my models, I get the same error, or another one. Here's how my model looks like:
class User
include DataMapper::Resource
attr_accessor :password, :password_confirmation
property :id, Serial, :req...
Hi, hereafter is my piece of code that I want to simplify in order to avoid passing an extra argument on each call. In fact, my usecase is that M is a user library without the definition of context argument on each method. check is a method that is not defined by the user.
# User code
module M
def do_something(context)
puts "Calle...
I'm creating a Rails application where users can have a first and last name. Since I'm a perfectionist, the application may not show something like Dennis's profile or Xianx's profile, but rather Dennis' profile and Xianx' profile. I use I18n, so I wanted to ask what is the shortest way of implementing this? This grammar is the same for ...
My VCR gem currently depends on FakeWeb. I have it declared as a dependency in my gemspec.
I'm working with the auther of WebMock (a library that provides similar functionality to FakeWeb) to get VCR to work with WebMock as well, so that users of VCR could use either FakeWeb or WebMock as the http stubbing library.
When it comes time ...
I have tried using a stemmer but the words it produces are just not upto the mark. It could be great if you could let me know any lemmatizer script there exists for ruby or a lemmatizer gem or an SQL query that bundles out the lemma of a word in the wordnet database.
Cheers !
...
I am using Padrino and when I try to specify my application.sass file I get this error NameError at / uninitialized constant Sass::SyntaxError
I thought I might have something missing, so I checked out the sample_blog application at their GIT to verify my SASS is working correct. It was working correct and the blog app was running fine....
I'm working on an API that accepts data from remote clients, some of which where the key in an HTTP POST almost functions as an array. In english what this means is say I have a resource on my server called "class". A class in this sense, is the type a student sits in and a teacher educates in. When the user submits an HTTP POST to creat...
I'm working on building the URLs for my REST API before I begin writing any code. Rails REST magic is fantastic, but I'm slightly bothered the formatting of a URL such as:
http://myproject/projects/5
where Project is my resource and 5 is the project_id. I think if a user is looking to retrieve all of their projects, then a respective H...
Is there a ruby gem or such for MySQL connection pooling that isn't part of rails? I simply have a ruby script (again, I don't do anything with rails).
...
I've searched and not been able to find the right way of doing what I'm trying to. I read a file line by line and want to create a new object from a regex on each line. I'm not using an XML parser because the data is not well formed and listed below is all I need to get from each line.
I can't seem to get scan to return the result of th...
I know two arrays can be zipped and the result can be iterated with #each. But how do you do it with an unknown number of enumerables?
Let's say
anand = %w(1-0 0.5-0.5 0.5-0.5 1.0)
carlsen = %w(0-1 0.5-0.5 0.5-0.5 1.0)
kramnik = %w(0.5-0.5 0.5-0.5 0.5-0.5 1.0)
players= [anand, carlsen, kramnik]
#something smart
players.each{|round|puts...
I'm having a bit of difficulty coming up with the right answer to this, so I will solicit my problem here. I'm working on a RESTFul API. Naturally, I have multiple resources, some of which consist of parent to child relationships, some of which are stand alone resources. Where I'm having a bit of difficulty is figuring out how to make th...
I'm working on creating my first plugin for rails. I'm still pretty new to ruby and I was wondering if its possible to get the inheriting class?
For example, I'm trying to create a plugin that will allow unit testing and functional testing when you are not using migrations. What I'm trying to do is initialize a class variable named cont...
I managed to make the oauth process work for PIN kind of verification. My twitter application is client type. When enter authorize url into web browser and grant the application access then I have to enter pin in my ruby application. Can I finish the process of getting access token without the pin thing?
What changes do I need to do to...
I am programmatcally accessing authenticated content in my CDN on Google App Engine, and it's returning a cookie that I'm supposed to store:
{"set-cookie"=>"ACSID=cookie-hash; expires=Mon, 12-Apr-2010 01:56:06 GMT; path=/"}
What do I do with that? This is my first time dealing with Cookies.
I can put in the header of the next reques...
I can do File.size(path) to get the size of a file in bytes. How do I get the size of an HTTP response without writing it to a tempfile?
...
There have been questions with answers on how to write rubygems, but what should you avoid in writing a rubygem? What can cause problems for people using your rubygem?
...
I am running a command to push files to Google App Engine, and it might ask me for my email and password:
$ appcfg.py update .
Application: my-cdn; version: 3. # printed out
Server: appengine.google.com. # printed out
Scanning files on local disk. # printed out
Initiating update. # printed out
Email: [email protected] # now it asks me...
...