Ultraviolet gem issues resolved!
Posted by jacqui maher on December 30, 2007 at 01:19 PM
I finally figured out what the problem was with Ultraviolet. If you get this error message:
1 Textpow::ParsingError
2 (Parsing error in ^to \w+: wrong number of arguments (2 for 0)):
It is probably due to incompatibilities among some combination of your oniguruma C library, oniguruma, textpow, and ultraviolet gems, rubygems, and ruby the language itself.
Here’s my setup, running in Ubuntu, that works:
1 jacqui@brighter~ $ ruby -v
2 ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
3 jacqui@brighter~ $ gem -v
4 1.0.1
5 jacqui@brighter~ $ gem list # snippet
6 oniguruma (1.1.0)
7 textpow (0.10.0)
8 ultraviolet (0.10.1)
9 jacqui@brighter~ $ onig-config --version
10 5.9.1
I’ll fix the overflow problem (related to code spilling out behind the sidebar) later.
ultraviolet
Posted by jacqui maher on December 28, 2007 at 11:28 PM
No one knows how to fix my ultraviolet/simple highlight issues? Really?
Ugh!
hello to my non-techie friends!
Posted by jacqui maher on December 28, 2007 at 11:04 PM
I was hanging out with my friend Kerry a few days ago when she mentioned reading this blog and not really knowing what the hell I was talking about in all of the posts.
So…
I thought I’d write to say hi to my friends who aren’t programmers or in a similar line of work. I like keeping this blog technical as delving into other areas (read: personal) of my life is a bit… well, I’d just rather not write about it in a public forum. It gets complicated really quickly. Plus, I think it’s tacky.
Anyway, the readers who remember my “some girls wander by mistake” blog might be bored with this one, but that just means you should hang out with me in person and stop being so freaking creepy and voyeuristic :) *
Til then, yours in ruby, rails, and testing,
Jacqui
* Of course even then you wouldn’t know the half of it, but…
quick script to move your test::units to specs
Posted by jacqui maher on December 25, 2007 at 01:25 AM
this isn’t drop dead gorgeous or anything, but it worked ok for what i needed to do in the amount of time i felt like spending on it. i’d love to see how someone would make it better though, as usual.
and argh, i really need to spend some time on the css here. it’s hard to read code i post, and i apologize about that. lame!
download it: teststospecs.rb
problems getting ultraviolet syntax highlighting working
Posted by jacqui maher on December 24, 2007 at 06:17 PM
I thought some syntax highlighting on the code I post in this blog would be nice. So, when I found the SimpleHighlight plugin for Simplelog I was happy - now I wouldn’t even have to write any CSS for it:)
It’s not that simple, apparently.
I thought I’d post this in the hopes that someone recognizes the error. I’ve googled and poked around in the code and as far as I can tell it’s due to an incompatibility between the gems (namely textpow) and the oniguruma gem/c library.
For what it’s worth, I ended up following along with these instructions in my attempt to get it all working; I still get the same error.
Rails trace (the top few lines at least):
1 Textpow::ParsingError (Parsing error in ^to \w+: wrong number of arguments (2 for 0)): 2 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:92:in `initialize' 3 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:86:in `initialize' 4 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:75:in `load' 5 /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:23:in `init_syntaxes' 6 /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:22:in `init_syntaxes' 7 /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:67:in `parse' 8 /vendor/plugins/simple_highlight/lib/simple_highlight.rb:40:in `create_clean_content' 9 /vendor/plugins/simple_highlight/lib/simple_highlight.rb:22:in `create_clean_content' 10 /app/models/post.rb:247:in `before_validation_on_create' 11 /app/models/post.rb:267:in `before_validation_on_update'
irb after reinstalling everything again:
1 irb(main):011:0> puts Uv.parse( input, "xhtml", "html", true, "slush_poppies") 2 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:92:in `initialize': Parsing error in ^to \w+: wrong number of arguments (2 for 0) (Textpow::ParsingError) 3 from /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:86:in `initialize' 4 from /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:75:in `load' 5 from /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:23:in `init_syntaxes' 6 from /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:22:in `init_syntaxes' 7 from /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:67:in `parse'
making a clean break
Posted by jacqui maher on December 19, 2007 at 12:42 AM
I was upgrading our rspec to v1.1 when my friend Josh suggested chided me for using script/plugin install. Yeah, I had heard of piston, but it was one of the many things on that imaginary list of things to learn and do. If he hadn’t done that, I wouldn’t have done this:
1 tinsel:trunk jm$ sudo gem install piston -y 2 Need to update 18 gems from http://gems.rubyforge.org 3 complete 4 Successfully installed piston-1.3.3
Of course, after I typed the last command out I realized that I was in the svn checkout, and we’re using git. Err… and Josh mentioned one other thing - giston.
Wtf is giston?
Well, apparently Christi, aka evil chelu, wrote it. I met him in Vienna at Euruko, and he is not only a cool guy who writes neat stuff like giston, he’s also really funny. But, I’m digressing. Giston is a git version of piston, basically. It lets you manage revisions of your plugins just like piston does, only now you can do it in git instead of svn.
Neat. Christi has instructions on how to install it on his page that I already linked to, so I’ll skip that here.
I installed rspec and rspec_on_rails with giston. Damn, git is fast, so much faster than svn. I could get used to this, once I finally RTFM :)
1 tinsel:workspace jm$ giston add http://rspec.rubyforge.org/svn/trunk/rspec vendor/plugins/rspec 2 giston: Adding mirror for http://rspec.rubyforge.org/svn/trunk/rspec in vendor/plugins/rspec. You must call giston update vendor/plugins/rspec to fetch the data. 3 tinsel:workspace jm$ giston update vendor/plugins/rspec 4 giston: Updating vendor/plugins/rspec from http://rspec.rubyforge.org/svn/trunk/rspec 5 giston: Local revision: 3189. Remote revision: 3189 6 tinsel:workspace jm$ giston add http://rspec.rubyforge.org/svn/trunk/rspec_on_rails vendor/plugins/rspec_on_rails 7 giston: Adding mirror for http://rspec.rubyforge.org/svn/trunk/rspec_on_rails in vendor/plugins/rspec_on_rails. You must call giston update vendor/plugins/rspec_on_rails to fetch the data. 8 tinsel:workspace jm$ giston update vendor/plugins/rspec_on_rails 9 giston: Updating vendor/plugins/rspec_on_rails from http://rspec.rubyforge.org/svn/trunk/rspec_on_rails 10 giston: Local revision: 3176. Remote revision: 3176
Now… do my tests pass?
upping your test coverage: rspec 1.1 + test unit
Posted by jacqui maher on December 18, 2007 at 10:50 AM
I am going to be looking into RSpec 1.1 in the next couple of days. While we haven’t upgraded our application to run on Rails 2 yet, I am really interested in RSpec’s new integration with Test::Unit.
Right now, we have two rake tasks for ascertaining test coverage using rcov: rake spec:rcov and rake test:rcov. Since one runs our Test::Unit tests, and one runs our RSpec tests, the outcome is far from accurate.
My plan is to hopefully use RSpec’s new integration with Test::Unit to convert all our Test::Unit tests to RSpec - this was, after all, my Big Plan from the beginning. It’s just a lot of work and I dont have that much time. I think this will allow me to move them all into the spec directory and get the total test coverage much more accurately.
I’ll be posting my progress here.
In other news, I’m almost done with the initial version of my automated mock framework plugin - nelson. More on that later as well.
ID, please?
Posted by jacqui maher on December 04, 2007 at 09:57 AM
This is apparently old news to most people living in NYC, but it was brand new news to me. I am once again sick with a cold - my third since moving back to NYC, which is a topic for another post - and so I stopped at the pharmacy on my way to work this morning.
I knew that I wouldn’t be able to get the same type of drugs over-the-counter that I was getting in Europe, but I thought I would be able to find something and make a simple transaction resulting in me leaving the pharmacy with medicine that would make me feel better.
Not really. Sure, I sit here at work with a box of pills that hopefully will do something to stop this illness from completely knocking me on my ass, but the experience I just had was… bizarre.
After looking over the rows of cold medicines I noticed that several were missing with placeholder cards describing what used to be found in that spot. At first I thought they were just out of the particular meds, which is kind of weird as there were quite a few missing! I picked up a card for one that sounded like it might be good for me and asked the pharmacist about it.
Turns out that they have these medicines, they just keep them behind the counter. I didn’t ask why at this point ecause I figured it was an attempt at reducing theft. It wasn’t until he asked me for my identification that I asked him, “why?”
Apparently people make amphetamines out of cold medicines that contain pseudo ephedrine. OK, congrats to them on their chemistry skills, but how the hell does keeping the medicine in the back of the pharmacist’s area and requiring ID help to stop this?
He wrote down my name, driver’s license state & number, and what I bought along with the date. What do they do with this information? Is it used in court if someone is charged with making meth?
I’m so confused. It seemed like a rather blatant invasion of privacy. Sure, the fact that I bought “MucinexD Extended Release” cold medicine is innocent enough (although I admit the name sounds a bit gross!) but this is a slippery slope. I was reminded of the first time in California that I was asked for my driver’s license when buying cigarettes and the cashier swiped it in a machine. I was alarmed and asked her, “why did you do that?” She insisted that it only calculated my DOB for her - and really, since when is it that hard to figure out if someone is over 18 - but honestly, I don’t buy it.
I’m not that paranoid, but I would bet that the cigarette sale records are saved somewhere. Now I am known for smoking and having a cold; maybe they’ll draw the obvious conclusion that smoking isn’t so good for your health?
:)
I’ll make a post about technology and ruby on rails soon, I promise. Life’s been busy. Take care.