Skip to content

Commit

Permalink
Many changes including removing vendor/hobo /vendor/hobo13
Browse files Browse the repository at this point in the history
  • Loading branch information
bsleys committed Jun 21, 2011
1 parent b8b7aee commit b4c7045
Show file tree
Hide file tree
Showing 72 changed files with 2,919 additions and 201 deletions.
18 changes: 18 additions & 0 deletions .project
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>hobocookbook</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.radrails.rails.core.railsnature</nature>
<nature>com.aptana.ruby.core.rubynature</nature>
</natures>
</projectDescription>
18 changes: 16 additions & 2 deletions Gemfile
Expand Up @@ -32,7 +32,21 @@ gem 'yard'
# group :development, :test do
# gem 'webrat'
# end
group :development do
# set to 0.43 due to problem with .45 see https://github.com/rails/rails/pull/1671
# gem 'ruby-debug'
# gem 'ruby-debug-ide'
# gem 'linecache', '0.43'
end

gem "maruku"

#temp workaround for hash_secret issue see https://groups.google.com/forum/#!topic/hobousers/dS4VT_lyVIY
#gem "paperclip", "~> 2.3"
gem 'paperclip', :git => "git://github.com/jeanmartin/paperclip.git", :branch => "master"
#required by paperclip
gem "cocaine"

gem "hobo", "1.3.0.RC1", :git => "git://github.com/tablatom/hobo.git", :branch => "rails3"

gem 'maruku'

gem "hobo", "1.3.0.RC"
48 changes: 33 additions & 15 deletions Gemfile.lock
@@ -1,3 +1,30 @@
GIT
remote: git://github.com/jeanmartin/paperclip.git
revision: 4095e07adaace2a123cbd031fa268928f3b0ce87
branch: master
specs:
paperclip (2.3.10)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)

GIT
remote: git://github.com/tablatom/hobo.git
revision: 2c604814478baad1557e95a335ee1da0ce9d3b05
branch: rails3
specs:
dryml (1.3.0.RC1)
actionpack (~> 3.0.0)
hobo_support (= 1.3.0.RC1)
hobo (1.3.0.RC1)
dryml (= 1.3.0.RC1)
hobo_fields (= 1.3.0.RC1)
hobo_support (= 1.3.0.RC1)
will_paginate (>= 3.0.pre)
hobo_fields (1.3.0.RC1)
hobo_support (= 1.3.0.RC1)
hobo_support (1.3.0.RC1)
rails (~> 3.0.0)

GEM
remote: http://rubygems.org/
specs:
Expand Down Expand Up @@ -30,20 +57,9 @@ GEM
activesupport (3.0.8)
arel (2.0.10)
builder (2.1.2)
dryml (1.3.0.RC)
actionpack (~> 3.0.0)
hobo_support (= 1.3.0.RC)
cocaine (0.1.0)
erubis (2.6.6)
abstract (>= 1.0.0)
hobo (1.3.0.RC)
dryml (= 1.3.0.RC)
hobo_fields (= 1.3.0.RC)
hobo_support (= 1.3.0.RC)
will_paginate (>= 3.0.pre)
hobo_fields (1.3.0.RC)
hobo_support (= 1.3.0.RC)
hobo_support (1.3.0.RC)
rails (~> 3.0.0)
i18n (0.5.0)
mail (2.2.19)
activesupport (>= 2.3.6)
Expand Down Expand Up @@ -79,17 +95,19 @@ GEM
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.27)
tzinfo (0.3.28)
will_paginate (3.0.pre2)
yard (0.7.1)
yard (0.7.2)

PLATFORMS
ruby

DEPENDENCIES
hobo (= 1.3.0.RC)
cocaine
hobo (= 1.3.0.RC1)!
maruku
mysql
paperclip!
rails (= 3.0.8)
rake (= 0.8.7)
sqlite3
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/application_controller.rb
Expand Up @@ -9,11 +9,12 @@ class ApplicationController < ActionController::Base
private

def last_update(filename)
Dir.chdir(File.open("#{RAILS_ROOT}/git-path").read.chomp) do
head = File.open("#{RAILS_ROOT}/git-version").read.chomp
Dir.chdir(File.open("#{Rails.root}/git-path").read.chomp) do
head = File.open("#{Rails.root}/git-version").read.chomp
commit = `git rev-list #{head} #{filename} | head -n 1`
date_s = `git show --pretty=format:%cD #{commit} | head -n 1`
date_s ? Date.parse(date_s) : ""
end
end
end

102 changes: 51 additions & 51 deletions app/controllers/manual_controller.rb
@@ -1,7 +1,6 @@
class ManualController < ApplicationController

caches_page :manual_section, :manual_subsection

def self.create_ordered_hash(llist)
hash = ActiveSupport::OrderedHash.new
llist.each do |key, value|
Expand All @@ -11,59 +10,59 @@ def self.create_ordered_hash(llist)
end

TITLES = self.create_ordered_hash([# ['to-do', "To Do List"],
['toc', "Table of Contents"],
['download', "Download and Install"],
['hobo_support', 'Hobo Support'],
['hobo_fields', 'Hobo Fields'],
['scopes', 'Automatic Named Scopes'],
['permissions', "The Permission System"],
['multi_model_forms', 'Accessible Associations'],
['users_and_authentication', 'Users and Authentication'],
['model', 'Miscellaneous Model Extensions'],
['controllers', "Controllers and Routing"],
['dryml-guide', "The DRYML Guide"],
['ajax', 'Ajax in Hobo'],
['lifecycles', 'Lifecycles'],
['viewhints', 'View Hints'],
['generators', 'Generators'],
['i18n', 'Internationalization'],
])
['toc', "Table of Contents"],
['download', "Download and Install"],
['hobo_support', 'Hobo Support'],
['hobo_fields', 'Hobo Fields'],
['scopes', 'Automatic Named Scopes'],
['permissions', "The Permission System"],
['multi_model_forms', 'Accessible Associations'],
['users_and_authentication', 'Users and Authentication'],
['model', 'Miscellaneous Model Extensions'],
['controllers', "Controllers and Routing"],
['dryml-guide', "The DRYML Guide"],
['ajax', 'Ajax in Hobo'],
['lifecycles', 'Lifecycles'],
['viewhints', 'View Hints'],
['generators', 'Generators'],
['i18n', 'Internationalization'],
])

SUBTITLES = {
'hobo_fields' => self.create_ordered_hash([['rich_types', 'Rich Types'],
['api', 'API'],
['migration_generator','Migration Generator'],
# ['generators', 'Generators'],
# ['interactive_primary_key', 'Interactive Primary Key'],
['migration_generator_comments', 'Migration Generator Comments']
]),
['api', 'API'],
['migration_generator','Migration Generator'],
# ['generators', 'Generators'],
# ['interactive_primary_key', 'Interactive Primary Key'],
['migration_generator_comments', 'Migration Generator Comments']
]),
'hobo_support' => self.create_ordered_hash([['chronic', 'Chronic'],
['enumerable', 'Enumerable'],
['hash', 'Hash'],
['implies', 'Implies'],
['metaid', 'Metaid'],
['methodphitamine', 'Methodphitamine'],
['module', 'Module'],
['xss', 'XSS'],
]),
['enumerable', 'Enumerable'],
['hash', 'Hash'],
['implies', 'Implies'],
['metaid', 'Metaid'],
['methodphitamine', 'Methodphitamine'],
['module', 'Module'],
['xss', 'XSS'],
]),
'generators' => self.create_ordered_hash([['admin_subsite', 'admin_subsite'],
['assets', 'assets'],
['controller', 'controller'],
['front_controller', 'front_controller'],
['i18n', 'i18n'],
['migration', 'migration'],
['model', 'model'],
['rapid', 'rapid'],
['resource', 'resource'],
['routes', 'routes'],
['setup_wizard', 'setup_wizard'],
['subsite', 'subsite'],
['subsite_taglib', 'subsite_taglib'],
['test_framework', 'test_framework'],
['user_controller', 'user_controller'],
['user_mailer', 'user_mailer'],
['user_model', 'user_model'],
['user_resource', 'user_resource']])
['assets', 'assets'],
['controller', 'controller'],
['front_controller', 'front_controller'],
['i18n', 'i18n'],
['migration', 'migration'],
['model', 'model'],
['rapid', 'rapid'],
['resource', 'resource'],
['routes', 'routes'],
['setup_wizard', 'setup_wizard'],
['subsite', 'subsite'],
['subsite_taglib', 'subsite_taglib'],
['test_framework', 'test_framework'],
['user_controller', 'user_controller'],
['user_mailer', 'user_mailer'],
['user_model', 'user_model'],
['user_resource', 'user_resource']])

}

Expand All @@ -72,8 +71,9 @@ def manual_section
filename = "manual/#{section}.markdown"
@title = TITLES[section]
@subtitles = SUBTITLES[section]
@content = HoboFields::Types::MarkdownString.new(File.read("#{RAILS_ROOT}/#{filename}"))
@content = HoboFields::Types::MarkdownString.new(File.read("#{Rails.root}/#{filename}"))
@last_update = last_update filename

end

def manual_subsection
Expand All @@ -83,7 +83,7 @@ def manual_subsection
@title = TITLES[section]
@subtitles = SUBTITLES[section]
@current_subtitle = SUBTITLES[section][subsection]
@content = HoboFields::Types::MarkdownString.new(File.read("#{RAILS_ROOT}/#{filename}"))
@content = HoboFields::Types::MarkdownString.new(File.read("#{Rails.root}/#{filename}"))
@last_update = last_update filename
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/plugins_controller.rb
Expand Up @@ -19,7 +19,7 @@ def show
end
filename = "#{RAILS_ROOT}/taglibs/#{plugin}/README.markdown"
@title = TITLES[plugin]
@content = HoboFields::MarkdownString.new(File.read(filename))
@content = HoboFields::Types::MarkdownString.new(File.read(filename))
@libs = ApiTaglib.library_is(plugin)
@last_update = last_update filename
end
Expand Down
28 changes: 15 additions & 13 deletions app/models/api_tag_def.rb
Expand Up @@ -7,58 +7,59 @@ class ApiTagDef < ActiveRecord::Base
def to_param
to_s
end

fields do
tag :string, :name => true
extension :boolean
polymorphic :boolean
for_type :string

short_description :html
description :html
tag_attributes :serialized, :class => Array
tag_parameters :serialized, :class => Array

merge_attrs :string
merge_params :string

source :text

timestamps
end

belongs_to :taglib, :class_name => "ApiTaglib"
has_many :comments, :class_name => "ApiTagComment", :dependent => :destroy

named_scope :no_for_type, :conditions => "for_type is null"

#named_scope :no_for_type, :conditions => "for_type is null"
scope :no_for_type, where("for_type is null")

children :comments

def def_line
"<#{extension? ? 'extend' : 'def'} tag='#{tag}'#{' polymorphic' if polymorphic?}#{' for=\'' + for_type + '\'' if for_type}>"
end

def short_def_line
"<#{tag}#{' for=\'' + for_type + '\'' if for_type}>"
end

def typed_variants
return [] if for_type
ApiTagDef.find :all, :conditions => ["tag = ? AND (for_type is not null)", tag]
end

def all_attributes
tag_attributes | merged_attributes
end

def merge_attrs_tagdef
@merged_attrs_tagdef ||= ApiTagDef.find_by_tag(merge_attrs)
end

def merge_params_tagdef
@merged_attrs_tagdef ||= ApiTagDef.find_by_tag(merge_attrs)
end

def merged_attributes
merge_attrs_tagdef._?.all_attributes || []
end
Expand Down Expand Up @@ -86,3 +87,4 @@ def view_permitted?(attribute)
end

end

8 changes: 5 additions & 3 deletions app/models/tag.rb
@@ -1,4 +1,4 @@
# NOTE- Tagging is not implemnted
# NOTE- Tagging is not implemnted

class Tag < ActiveRecord::Base

Expand All @@ -11,9 +11,10 @@ class Tag < ActiveRecord::Base

has_many :taggings
has_many :recipes, :through => :taggings

named_scope :popular, :limit => "20" # To Do!

#named_scope :popular, :limit => "20" # To Do!

scope :popular, limit(20)

# --- Hobo Permissions --- #

Expand All @@ -34,3 +35,4 @@ def view_permitted?(attribute)
end

end

0 comments on commit b4c7045

Please sign in to comment.