Skip to content

Commit

Permalink
tweaks to boson commands for rails3
Browse files Browse the repository at this point in the history
  • Loading branch information
cldwalker committed Aug 19, 2010
1 parent 3123b22 commit 223906b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config/hirb.yml
Expand Up @@ -24,7 +24,7 @@
- predicate
- filter
MachineTagTree:
:class: TagTree
:class: TagTreeHelper
:options:
:fields:
- id
Expand Down
4 changes: 2 additions & 2 deletions lib/boson/commands/delicious.rb
Expand Up @@ -129,11 +129,11 @@ def delicious_hash(url)
end

def write_config(hash)
File.open(::RAILS_ROOT + '/config/delicious.yml', 'w') {|f| f.write(hash.to_yaml) }
File.open(Rails.root + 'config/delicious.yml', 'w') {|f| f.write(hash.to_yaml) }
end

def store
@config ||= YAML::load_file(::RAILS_ROOT + '/config/delicious.yml') rescue {}
@config ||= YAML::load_file(Rails.root + 'config/delicious.yml') rescue {}
end

def client
Expand Down
5 changes: 2 additions & 3 deletions lib/boson/commands/start_rails.rb
Expand Up @@ -4,8 +4,7 @@ def self.config
end

def self.after_included
ENV['RAILS_ENV'] ||= 'local'
require File.dirname(__FILE__) + '/../../../config/boot'
require ::RAILS_ROOT + '/config/environment'
Rails.env = 'local' if ENV['RAILS_ENV'] == 'local'
require File.dirname(__FILE__) + '/../../../config/environment'
end
end
12 changes: 7 additions & 5 deletions lib/boson/commands/tag_tree_core.rb
@@ -1,7 +1,9 @@
module TagTreeCore
def self.included(mod)
# require 'tag_tree'
# require 'machine_tag_tree'
def self.after_included
require 'tag_tree_helper'
require 'machine_tag'
require 'default_predicate'
require 'machine_tag_tree'
end

# @config :option_command=>true
Expand Down Expand Up @@ -51,8 +53,8 @@ def url_tagged_with(*mtags)
Url.super_tagged_with(mtags, options)
end

# @render_options :class=>TagTree, [:view, :w]=>{:type=>:string, :values=>TagTree::VIEWS, :default=>:table},
# :fields=>TagTree::FIELDS
# @render_options :class=>TagTreeHelper, [:view, :w]=>{:type=>:string, :values=>TagTreeHelper::VIEWS, :default=>:table},
# :fields=>TagTreeHelper::FIELDS
# @options [:set_tags_from_tagged,:t]=>:boolean, :regexp_tags=>:boolean,
# :namespace=>:string, :predicate=>:string, :value=>:string, :context=>:string
# @config :menu_action=>{:multi_action=>false}
Expand Down
2 changes: 1 addition & 1 deletion lib/default_predicate.rb
@@ -1,7 +1,7 @@
# Determines default predicates for machine tags by generating filters (regexs) from rules in config/machine_tags.yml
# Note: This class doesn't consistently build machine tags with Tag.build_machine_tag()
class DefaultPredicate
CONFIG_FILE = RAILS_ROOT + '/config/machine_tags.yml'
CONFIG_FILE = Rails.root + 'config/machine_tags.yml'

attr_accessor :rule, :global, :predicate
def initialize(rule)
Expand Down
2 changes: 1 addition & 1 deletion lib/tag_tree.rb → lib/tag_tree_helper.rb
@@ -1,5 +1,5 @@
# Displays tagged urls under a machine tag tree with branches at these levels
class TagTree < Hirb::Helpers::Tree
class TagTreeHelper < Hirb::Helpers::Tree
VIEWS = [:result, :group, :count, :description_result, :tag_result, :value_description, :table, :basic]
FIELDS = [:id, :name, :description, :quick_mode_tag_list]

Expand Down

0 comments on commit 223906b

Please sign in to comment.