Browse files

Initial version that supports view folder structure

  • Loading branch information...
1 parent dcf28fd commit 718c8340cf88b5cf51164932439950faee7ee041 @bigjason committed Apr 16, 2012
Showing with 37 additions and 19 deletions.
  1. +1 −0 .rvmrc
  2. +2 −2 Gemfile.lock
  3. +1 −1 MIT-LICENSE
  4. +3 −0 README.md
  5. +0 −3 README.rdoc
  6. +2 −2 lib/prospecto.rb
  7. +11 −0 lib/prospecto/controller.rb
  8. +9 −0 lib/prospecto/railtie.rb
  9. +1 −1 lib/prospecto/version.rb
  10. +7 −7 prospecto.gemspec
  11. +0 −3 test/prospecto_test.rb
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.3
View
4 Gemfile.lock
@@ -1,8 +1,8 @@
PATH
remote: .
specs:
- prospecto (0.0.1)
- rails (~> 3.2.3)
+ prospecto (0.0.5)
+ rails (>= 3.1.0)
GEM
remote: http://rubygems.org/
View
2 MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright 2012 YOURNAME
+Copyright 2012 Jason Webb
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
3 README.md
@@ -0,0 +1,3 @@
+# Prospecto
+
+*Seperation of views and templates in rails.*
View
3 README.rdoc
@@ -1,3 +0,0 @@
-= Prospecto
-
-This project rocks and uses MIT-LICENSE.
View
4 lib/prospecto.rb
@@ -1,2 +1,2 @@
-module Prospecto
-end
+require 'prospecto/version'
+require 'prospecto/railtie' if defined?(Rails)
View
11 lib/prospecto/controller.rb
@@ -0,0 +1,11 @@
+require 'rails/railtie'
+
+module Prospecto
+ module ProspectoController
+ def prospecto
+ view_path = Rails.root.join("app/views")
+ resolver = ActionView::FileSystemResolver.new(view_path, ":prefix/templates/:action{.:locale,}{.:formats,}{.:handlers,}")
+ prepend_view_path(resolver)
+ end
+ end
+end
View
9 lib/prospecto/railtie.rb
@@ -0,0 +1,9 @@
+require 'prospecto/controller'
+
+module Prospecto
+ class Railtie < Rails::Railtie
+ initializer "prospecto.initialize" do |app|
+ ActionController::Base.extend(ProspectoController)
+ end
+ end
+end
View
2 lib/prospecto/version.rb
@@ -1,3 +1,3 @@
module Prospecto
- VERSION = "0.0.1"
+ VERSION = "0.0.5"
end
View
14 prospecto.gemspec
@@ -7,16 +7,16 @@ require "prospecto/version"
Gem::Specification.new do |s|
s.name = "prospecto"
s.version = Prospecto::VERSION
- s.authors = ["TODO: Your name"]
- s.email = ["TODO: Your email"]
- s.homepage = "TODO"
- s.summary = "TODO: Summary of Prospecto."
- s.description = "TODO: Description of Prospecto."
+ s.authors = ["Jason Webb"]
+ s.email = ["bigjasonwebb@gmail.com"]
+ s.homepage = "http://github.com/bigjason/prospecto"
+ s.summary = "Seperation of views and templates for rails projects."
+ s.description = ""
- s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency "rails", "~> 3.2.3"
+ s.add_dependency "rails", ">= 3.1.0"
s.add_development_dependency "sqlite3"
end
View
3 test/prospecto_test.rb
@@ -1,7 +1,4 @@
require 'test_helper'
class ProspectoTest < ActiveSupport::TestCase
- test "truth" do
- assert_kind_of Module, Prospecto
- end
end

0 comments on commit 718c834

Please sign in to comment.