pie 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +4 -3
  2. data/lib/pie.rb +11 -5
  3. data/lib/pie_server.rb +4 -8
  4. metadata +3 -3
data/README.md CHANGED
@@ -41,12 +41,13 @@ I want to try to resist adding any new features until we have no bugs and kid-fr
41
41
 
42
42
  Core team (in order of appearance)
43
43
 
44
- * Sarah Allen
45
- * Sarah Mei
46
- * Rich Kilmer
44
+ * Sarah Allen @ultrasaurs
45
+ * Sarah Mei @sarahmei
46
+ * Rich Kilmer @richkilmer
47
47
 
48
48
  Contributors
49
49
 
50
+ * Matthew Bass @pelargir
50
51
  * Dan Steinicke
51
52
  * Akira Matsuda
52
53
  * Chad Fowler
data/lib/pie.rb CHANGED
@@ -53,13 +53,19 @@ module Pie
53
53
  def place(options)
54
54
  new_place = Place.new(options)
55
55
  name = new_place.name
56
- self.instance_eval %{
57
- def #{name}
58
- places[:#{name}]
59
- end
60
- }
56
+ #self.instance_eval %{
57
+ # def #{name}
58
+ # places[:#{name}]
59
+ # end
60
+ #}
61
61
  places[new_place.name] = new_place
62
62
  end
63
+
64
+ def method_missing name
65
+ place = places[name.to_sym]
66
+ raise NoMethodError if place.nil?
67
+ place
68
+ end
63
69
 
64
70
  def current_place(name=nil)
65
71
  if name
data/lib/pie_server.rb CHANGED
@@ -3,18 +3,14 @@ require 'sinatra/base'
3
3
  class Pie::WebApp < Sinatra::Base
4
4
  set :root, File.join(File.expand_path(File.dirname(__FILE__)), "..")
5
5
 
6
- get '/' do
7
- "hello"
8
- end
9
-
10
- get '/:place_name' do
6
+ get '/*' do
11
7
  puts "env= #{request.env.inspect}"
12
8
  puts "request.env[PIE_DATA]= #{request.env["PIE_DATA"].inspect}"
13
- pie ||= request.env["PIE_DATA"]
14
- pie ||= settings.pie_data if settings.respond_to? :pie_data
9
+ pie ||= request.env["PIE_DATA"] || settings.pie_data
15
10
  puts "pie = #{pie.inspect}"
16
11
  if pie
17
- name = params[:place_name].to_sym
12
+ splat = params[:splat].find { |e| e.length > 0 }
13
+ name = (splat || settings.pie_data.places.first.first).to_sym
18
14
  pie.current_place(name) unless name.nil?
19
15
  puts "current place name is #{pie.current_place.name}"
20
16
  puts "current place is #{pie.current_place.description}"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 8
9
- version: 0.2.8
8
+ - 9
9
+ version: 0.2.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sarah Allen, Sarah Mei, Rich Kilmer
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-08 00:00:00 -07:00
17
+ date: 2010-11-14 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies: []
20
20