sinatra-newyork 0.0.1 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sinatra/newyork.rb +13 -2
  2. metadata +2 -3
@@ -4,11 +4,22 @@ module Sinatra
4
4
  module NewYork
5
5
 
6
6
  module Helpers
7
- def partial(page, options = {})
8
- split = page.to_s.split('/')
7
+ def partial(file_name, options = {})
8
+ split = file_name.to_s.split('/')
9
9
  rejoined = (split[0..-2] << "_" + split[-1]).join('/')
10
10
  haml :"partials/#{rejoined}", options.merge!(:layout => false)
11
11
  end
12
+
13
+ def page(file_name, options = {})
14
+ split = file_name.to_s.split('/')
15
+ rejoined = (split[0..-2] << "_" + split[-1]).join('/')
16
+ haml :"pages/#{rejoined}", options.merge!(:layout => false)
17
+ end
18
+
19
+ def data
20
+ path_to_root_yaml = File.expand_path(File.join(settings.root, "data.yaml"))
21
+ @data = YAML.load_file(path_to_root_yaml)
22
+ end
12
23
  end
13
24
 
14
25
  def self.registered(app)
metadata CHANGED
@@ -4,9 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 0
8
7
  - 1
9
- version: 0.0.1
8
+ version: "0.1"
10
9
  platform: ruby
11
10
  authors:
12
11
  - Leo Herrick
@@ -14,7 +13,7 @@ autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
15
 
17
- date: 2013-03-12 00:00:00 -07:00
16
+ date: 2013-05-17 00:00:00 -07:00
18
17
  default_executable:
19
18
  dependencies: []
20
19