Skip to content

Commit

Permalink
Merging drnic/hobo_the_gem
Browse files Browse the repository at this point in the history
  • Loading branch information
tslocke committed May 19, 2008
2 parents e0fe146 + e498b65 commit 3950abe
Show file tree
Hide file tree
Showing 23 changed files with 1,177 additions and 886 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ doc/agility-tutorial/agility/db/*

hobo/taglib-docs

hobo/pkg
hobosupport/pkg

hobofields/pkg
154 changes: 154 additions & 0 deletions hobo/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
bin/hobo
CHANGES.txt
generators/hobo/hobo_generator.rb
generators/hobo/templates/application.dryml
generators/hobo/templates/dryml-support.js
generators/hobo/templates/guest.rb
generators/hobo_front_controller/hobo_front_controller_generator.rb
generators/hobo_front_controller/templates/controller.rb
generators/hobo_front_controller/templates/functional_test.rb
generators/hobo_front_controller/templates/helper.rb
generators/hobo_front_controller/templates/index.dryml
generators/hobo_front_controller/templates/search.dryml
generators/hobo_front_controller/USAGE
generators/hobo_model/hobo_model_generator.rb
generators/hobo_model/templates/fixtures.yml
generators/hobo_model/templates/model.rb
generators/hobo_model/templates/unit_test.rb
generators/hobo_model/USAGE
generators/hobo_model_controller/hobo_model_controller_generator.rb
generators/hobo_model_controller/templates/controller.rb
generators/hobo_model_controller/templates/functional_test.rb
generators/hobo_model_controller/templates/helper.rb
generators/hobo_model_controller/USAGE
generators/hobo_model_resource/hobo_model_resource_generator.rb
generators/hobo_model_resource/templates/controller.rb
generators/hobo_model_resource/templates/functional_test.rb
generators/hobo_model_resource/templates/helper.rb
generators/hobo_rapid/hobo_rapid_generator.rb
generators/hobo_rapid/templates/hobo-rapid.css
generators/hobo_rapid/templates/hobo-rapid.js
generators/hobo_rapid/templates/IE7.js
generators/hobo_rapid/templates/lowpro.js
generators/hobo_rapid/templates/reset.css
generators/hobo_rapid/templates/themes/clean/public/images/fieldbg.gif
generators/hobo_rapid/templates/themes/clean/public/images/pencil.png
generators/hobo_rapid/templates/themes/clean/public/images/small_close.png
generators/hobo_rapid/templates/themes/clean/public/images/spinner.gif
generators/hobo_rapid/templates/themes/clean/public/stylesheets/clean.css
generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css
generators/hobo_rapid/templates/themes/clean/views/clean.dryml
generators/hobo_rapid/templates/themes/default/public/images/banner.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-bodytop.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-01.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-02.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-03.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-04.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-bottom.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-left.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-right.gif
generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-top.gif
generators/hobo_rapid/templates/themes/default/public/images/header-blue.gif
generators/hobo_rapid/templates/themes/default/public/images/header-dblue.gif
generators/hobo_rapid/templates/themes/default/public/images/header-green.gif
generators/hobo_rapid/templates/themes/default/public/images/header-purple.gif
generators/hobo_rapid/templates/themes/default/public/images/header-red.gif
generators/hobo_rapid/templates/themes/default/public/images/logo.gif
generators/hobo_rapid/templates/themes/default/public/images/plus.png
generators/hobo_rapid/templates/themes/default/public/images/spinner.gif
generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-dblue.gif
generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-green.gif
generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-purple.gif
generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-red.gif
generators/hobo_rapid/templates/themes/default/public/images/window-corner-01.gif
generators/hobo_rapid/templates/themes/default/public/images/window-corner-02.gif
generators/hobo_rapid/templates/themes/default/public/images/window-corner-03.gif
generators/hobo_rapid/templates/themes/default/public/images/window-corner-04.gif
generators/hobo_rapid/templates/themes/default/public/images/window-shadow-bottom.gif
generators/hobo_rapid/templates/themes/default/public/images/window-shadow-left.gif
generators/hobo_rapid/templates/themes/default/public/images/window-shadow-right.gif
generators/hobo_rapid/templates/themes/default/public/images/window-shadow-top.gif
generators/hobo_rapid/templates/themes/default/public/stylesheets/application.css
generators/hobo_rapid/templates/themes/default/views/application.dryml
generators/hobo_user_controller/hobo_user_controller_generator.rb
generators/hobo_user_controller/templates/controller.rb
generators/hobo_user_controller/templates/functional_test.rb
generators/hobo_user_controller/templates/helper.rb
generators/hobo_user_controller/USAGE
generators/hobo_user_model/hobo_user_model_generator.rb
generators/hobo_user_model/templates/fixtures.yml
generators/hobo_user_model/templates/model.rb
generators/hobo_user_model/templates/unit_test.rb
generators/hobo_user_model/USAGE
init.rb
lib/action_view_extensions/base.rb
lib/active_record/association_proxy.rb
lib/active_record/association_reflection.rb
lib/active_record/has_many_association.rb
lib/active_record/has_many_through_association.rb
lib/extensions/test_case.rb
lib/hobo/authentication_support.rb
lib/hobo/bundle.rb
lib/hobo/composite_model.rb
lib/hobo/controller.rb
lib/hobo/dev_controller.rb
lib/hobo/dryml/dryml_builder.rb
lib/hobo/dryml/dryml_support_controller.rb
lib/hobo/dryml/parser/attribute.rb
lib/hobo/dryml/parser/base_parser.rb
lib/hobo/dryml/parser/document.rb
lib/hobo/dryml/parser/element.rb
lib/hobo/dryml/parser/elements.rb
lib/hobo/dryml/parser/source.rb
lib/hobo/dryml/parser/text.rb
lib/hobo/dryml/parser/tree_parser.rb
lib/hobo/dryml/parser.rb
lib/hobo/dryml/part_context.rb
lib/hobo/dryml/scoped_variables.rb
lib/hobo/dryml/tag_parameters.rb
lib/hobo/dryml/taglib.rb
lib/hobo/dryml/template.rb
lib/hobo/dryml/template_environment.rb
lib/hobo/dryml/template_handler.rb
lib/hobo/dryml.rb
lib/hobo/generator.rb
lib/hobo/guest.rb
lib/hobo/hobo_helper.rb
lib/hobo/model.rb
lib/hobo/model_controller.rb
lib/hobo/model_router.rb
lib/hobo/model_support.rb
lib/hobo/rapid_helper.rb
lib/hobo/scopes/apply_scopes.rb
lib/hobo/scopes/association_proxy_extensions.rb
lib/hobo/scopes/automatic_scopes.rb
lib/hobo/scopes/defined_scope_proxy_extender.rb
lib/hobo/scopes/scope_reflection.rb
lib/hobo/scopes/scoped_proxy.rb
lib/hobo/scopes.rb
lib/hobo/static_tags
lib/hobo/undefined.rb
lib/hobo/undefined_access_error.rb
lib/hobo/user.rb
lib/hobo/user_controller.rb
lib/hobo.rb
LICENSE.txt
Manifest
README
taglibs/core.dryml
taglibs/rapid.dryml
taglibs/rapid_document_tags.dryml
taglibs/rapid_editing.dryml
taglibs/rapid_forms.dryml
taglibs/rapid_generics.dryml
taglibs/rapid_navigation.dryml
taglibs/rapid_pages.dryml
taglibs/rapid_plus.dryml
taglibs/rapid_support.dryml
taglibs/rapid_user_pages.dryml
tasks/dump_fixtures.rake
tasks/environments.rake
tasks/fix_dryml.rake
tasks/generate_tag_reference.rb
tasks/hobo_tasks.rake
uninstall.rb
20 changes: 20 additions & 0 deletions hobo/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end

require 'echoe'

Echoe.new('hobo') do |p|
p.author = "Tom Locke"
p.email = "tom@tomlocke.com"
p.summary = "The web app builder for Rails"
p.url = "http://hobocentral.net/"
p.project = "hobo"

p.changelog = "CHANGES.txt"
p.version = "0.7.5"

p.dependencies = [
'hobosupport >=0.7.5',
'hobofields >=0.7.5',
'rails =2.0.2',
'will_paginate >= 2.2.1']
end




# --- RSpec --- #
Expand Down
33 changes: 10 additions & 23 deletions hobo/bin/hobo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
#!/usr/bin/env ruby

require 'fileutils'
Signal.trap("INT") { puts; exit }
Expand All @@ -9,14 +9,11 @@ USAGE = "USAGE: hobo <options> <app-path>
Options:
--user-model <model-name-or-false>
--svn # Use 'svn co' to checkout Hobo trunk
--create-dbs # Run rake db:create:all
--db-create # Run rake db:create:all
--hobo-src <path to hobo src>
-d | --database <database> # e.g. mysql, sqlite
"

HOBO_REPO = "svn://hobocentral.net/hobo/trunk/hobo"


### Nasty stuff needed for Windows :-( ###
require 'rbconfig'
Expand All @@ -26,7 +23,7 @@ if Config::CONFIG["arch"] =~ /win32/
def system(command)
win = Win32API.new("crtdll", "system", ['P'], 'L').Call(command)
end
end
end
### end nasty stuff ###


Expand All @@ -44,17 +41,15 @@ end

app_path = ARGV.pop

user_model = "user"
hobo_svn = create_db = false
user_model = "user"
create_db = false

until ARGV.empty?
case ARGV.shift
when "--user-model"
arg = ARGV.shift
user_model = arg == "false" ? nil : arg
when "--svn"
hobo_svn = true
when "--create-dbs"
when "--db-create"
create_db = true
when "--hobo-src"
hobo_src = "../" + ARGV.shift
Expand All @@ -63,7 +58,7 @@ until ARGV.empty?
else
puts USAGE
exit 1
end
end
end

puts "\nGenerating Rails app...\n"
Expand All @@ -78,15 +73,7 @@ Dir.chdir(app_path) do

FileUtils.touch("public/stylesheets/application.css")

if hobo_svn
puts "\nInstalling Hobo plugin via svn checkout...\n"
command("svn co #{HOBO_REPO} vendor/plugins/hobo")
else
puts "\nInstalling Hobo plugin...\n"
FileUtils.cp_r hobo_src, "vendor/plugins/hobo"
end

puts "\nInitialising Hobo...\n"
puts "\nInitialising Hobo...\n"
command(gen, "hobo --add-routes")

puts "\nInstalling Hobo Rapid and default theme...\n"
Expand All @@ -97,10 +84,10 @@ Dir.chdir(app_path) do
command("#{gen} hobo_user_model #{user_model}")
command("#{gen} hobo_user_controller #{user_model}")
end

puts "\nCreating standard pages...\n"
command("#{gen} hobo_front_controller front --delete-index --add-routes")

if create_db
puts "\nCreating databases"
command("rake db:create:all")
Expand Down
5 changes: 3 additions & 2 deletions hobo/generators/hobo/hobo_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ def manifest
if options[:add_routes]
routes_path = File.join(RAILS_ROOT, "config/routes.rb")

hobo_require = "gem 'hobo'\nrequire 'hobo'\n"
route = " Hobo.add_routes(map)\n"

route_src = File.read(routes_path)

unless route_src.include?(route)
head = "ActionController::Routing::Routes.draw do |map|"
route_src.sub!(head, head + "\n\n" + route)
route_src.sub!(head, hobo_require + head + "\n\n" + route)
File.open(routes_path, 'w') {|f| f.write(route_src) }
end
end
Expand Down

0 comments on commit 3950abe

Please sign in to comment.