Skip to content

Instantly share code, notes, and snippets.

View jackdempsey's full-sized avatar

jack dempsey jackdempsey

View GitHub Profile
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
require 'pp'
url = 'http://www.apple.com/retail/iphone/feeds/3g_us_inv.json'
json = Net::HTTP.get_response(URI.parse(url)).body
diff --git a/tools/merb-dev.rake b/tools/merb-dev.rake
index 0bfca75..988bec4 100644
--- a/tools/merb-dev.rake
+++ b/tools/merb-dev.rake
@@ -83,14 +83,13 @@ namespace :merb do
# Usage: sake merb:install:all
desc 'Install merb-core, merb-more, and merb-plugins'
- task :all => ['merb:check_outside_merb_dir', 'merb:install:core', 'merb:install:more', 'merb:install:plugins', 'merb:install:extlib']
+ task :all => ['merb:check_outside_merb_dir', 'merb:install:extlib', 'merb:install:core', 'merb:install:more', 'merb:install:plugins']
<%
#locals
blog ||= @blog
post_type = blog.post_type || params[:post_type] || 'text'
channels = blog.department ? blog.department.channels.map {|channel| [channel.name, channel.id]} : {}
%>
<div id="blog">
<% less_form_for [@profile, blog], :html => {:multipart=>true} do |f| %>
<input type="hidden" name="blog[post_type]" value="<%= post_type %>" />
<select id='list_a' name='top_level'>
<option value='1'>one</option>
<option value='2'>two</option>
</select>
<selectid='list_b' name='second_level'>
</select>
<label>Department:</label>
<select id="blog_department_id" name="blog[department_id]">
<option value="1" selected="selected">My World</option>
<option value="2">Around Town</option>
<option value="3">Lifestyles &amp; Living</option>
<option value="4">Arts &amp; Entertainment</option>
<option value="5">Style &amp; Fashion</option>
<option value="6">Sports &amp; Fitness</option>
<option value="7">Business &amp; Careers</option>
<option value="8">Science &amp; Technology</option>
~/git/merb_has_flash master$ rake --trace
(in /Users/jack/git/merb_has_flash)
rake aborted!
undefined local variable or method `spec' for main:Object
/Users/jack/git/merb_has_flash/rakefile:5
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:2149:in `load'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:2149:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1897:in `load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1896:in `load_rakefile'
+spec = eval(File.read('merb_has_flash.gemspec'))
+
+Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.gem_spec = spec
+end
LONG_RE = /^(--\w+[-\w+]*)$/
SHORT_RE = /^(-\w)$/
LONG_EQ_RE = /^(--\w+[-\w+]*)=(.*?)$|(-\w?)=(.*?)$/
SHORT_SQ_RE = /^-(\w\S+?)$/ # Allow either -x -v or -xv style for single char args
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
class Foo < Thor
...
end
Foo.start
CmdUtils.CreateCommand(
{
name: "ruby",
takes: {"function": noun_arb_text},
icon: "http://ruby-doc.org/favicon.ico",
homepage: "http://jackndempsey.blogspot.com",
author: {name: "Jack Dempsey", email: "jack.dempsey@gmail.com"},
license: "MPL,GPL",
description: "Search ruby functions documentation",
help: "Select a ruby function",