sinatra-newyork 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/sinatra/newyork.rb +19 -0
  2. metadata +62 -0
@@ -0,0 +1,19 @@
1
+ require 'sinatra/base'
2
+
3
+ module Sinatra
4
+ module NewYork
5
+
6
+ module Helpers
7
+ def partial(page, options = {})
8
+ split = page.to_s.split('/')
9
+ rejoined = (split[0..-2] << "_" + split[-1]).join('/')
10
+ haml :"partials/#{rejoined}", options.merge!(:layout => false)
11
+ end
12
+ end
13
+
14
+ def self.registered(app)
15
+ app.helpers NewYork::Helpers
16
+ app.set :haml, { :format => :html5, :layout => :'layouts/application' }
17
+ end
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sinatra-newyork
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Leo Herrick
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2013-03-12 00:00:00 -07:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Sinatra extension to add some of my commonly used methods
22
+ email: leoherrick@gmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - lib/sinatra/newyork.rb
31
+ has_rdoc: true
32
+ homepage:
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ requirements: []
55
+
56
+ rubyforge_project:
57
+ rubygems_version: 1.3.6
58
+ signing_key:
59
+ specification_version: 3
60
+ summary: Great Sinatra Song
61
+ test_files: []
62
+