kelredd-sinatra-helpers 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ spec = Gem::Specification.new do |s|
17
17
  s.files = %w(README.rdoc Rakefile) + Dir.glob("{bin,lib}/**/*")
18
18
  s.executables = ['sinatra']
19
19
 
20
- s.add_dependency('kelredd-useful', '>= 0.2.3')
20
+ s.add_dependency('kelredd-useful', '>= 0.2.6')
21
21
  end
22
22
 
23
23
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -9,6 +9,16 @@ def public_path(*args)
9
9
  root_path('public', *args)
10
10
  end
11
11
 
12
+ def load_app(files_dir)
13
+ app_dir = File.join('app', files_dir)
14
+ root_app_dir = root_path(app_dir)
15
+ if File.exists?(root_app_dir)
16
+ Dir[File.join(root_app_dir, "*.rb")].each do |file|
17
+ require "#{app_dir}/#{File.basename(file, ".rb")}"
18
+ end
19
+ end
20
+ end
21
+
12
22
  require 'config/env'
13
23
  begin
14
24
  require "config/envs/#{RACK_ENV.downcase}"
@@ -7,6 +7,10 @@ set :views, root_path("app", "views")
7
7
  set :images_path, public_path("images")
8
8
  set :environment, RACK_ENV.to_sym if defined?(RACK_ENV)
9
9
 
10
+ # load app files
11
+ load_app 'helpers'
12
+ load_app 'models'
13
+
10
14
  # TODO: set your session cookie name here
11
15
  use Rack::Session::Cookie, :key => '_sess'
12
16
  use Rack::Flash
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
3
  require 'shoulda/test_unit'
4
- require 'context'
5
4
  require 'useful/shoulda_macros/test_unit'
6
5
  require 'rack/test'
7
6
  require 'webrat'
@@ -15,18 +15,19 @@ module SinatraHelpers::Generator
15
15
  },
16
16
 
17
17
  :app => {
18
+ :helpers => {},
19
+ :models => {},
20
+ :views => {
21
+ 'layout' => 'layout.erb',
22
+ 'index.html.erb.erb' => 'index.html.erb'
23
+ },
18
24
  :javascripts => {
19
25
  'app.js.erb' => 'app.js'
20
26
  },
21
- :models => {},
22
27
  :stylesheets => {
23
28
  'reset.less.erb' => 'reset.less',
24
29
  'app.less.erb' => 'app.less'
25
- },
26
- :views => {
27
- 'layout' => 'layout.erb',
28
- 'index.html.erb.erb' => 'index.html.erb'
29
- },
30
+ }
30
31
  },
31
32
 
32
33
  :config => {
@@ -3,7 +3,7 @@ module SinatraHelpers
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 6
6
+ TINY = 7
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-sinatra-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-24 00:00:00 -06:00
12
+ date: 2009-12-28 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.2.3
23
+ version: 0.2.6
24
24
  version:
25
25
  description:
26
26
  email: kelly@kelredd.com