midas-guilded 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/guilded.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{guilded}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["C. Jason Harrelson (midas)"]
9
- s.date = %q{2009-03-12}
9
+ s.date = %q{2009-03-13}
10
10
  s.description = %q{Warning: This project just started and there are no stable releases available yet. Guilded is a framework for building web based components centered around current web standards and best practices. The current framework is written in ruby, but could be ported to other languages. Guilded intends to provide a toolset for creating and consuming reusable web components. Currently, this problem domain is filled with JavaScript frameworks. These frameworks are wonderful and work very well. However, they do not degrade and are not accessible. Guilded seeks to provide the same level of "componentization" and ease of use without sacrificing degradability and accessibility. Guilded will achieve these goals by applying each technology at our disposal to do what it was intended. XHTML will be employed for content. CSS used for layout and styling. Behavior will be added to a component with JavaScript through progressive enhancement. The user will have the best experience with a Guilded component when CSS and JavaScript are enabled in their browser, but will still be able to use the component when CSS and JavaScript are disabled. Guilded will use jQuery as it's base JavaScript framework. jQuery was chosen because it lends itself to progressive enhancement due to the way it was authored. In addition, the tight integration of jQuery's selectors with CSS selectors is also highly desirable. When authoring a Guilded component, it is encouraged to write the behavior code as a jQuery plugin. This will allow the jQuery plugin to be used outside of the Guilded project, if desired. Guilded also seeks to provide a standardized CSS framework for creating layouts that are reusable and predictable. Guilded will utilize the currently existing RubyGems system to package its components. A new Guilded component will be packaged in a Gem and have a dependency on the guilded gem. The Guilded-Base gem contains the framework to build Guilded components.}
11
11
  s.email = ["jason@lookforwardenterprises.com"]
12
12
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
13
- s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "guilded.gemspec", "lib/guilded.rb", "lib/guilded/component_def.rb", "lib/guilded/exceptions.rb", "lib/guilded/guilded_helpers.rb", "lib/guilded/guilder.rb", "lib/guilded/rails.rb", "lib/guilded/rails/active_record/human_attribute_hint.rb", "lib/guilded/rails/active_record/human_attribute_override.rb", "lib/guilded/rails/view_helpers.rb", "rails_generators/guilded_assets/guilded_assets_generator.rb", "rails_generators/guilded_assets/templates/guilded.js", "rails_generators/guilded_assets/templates/guilded.min.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.min.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.min.js", "rails_generators/guilded_assets/templates/reset-min.css", "rails_generators/guilded_config/guilded_config_generator.rb", "rails_generators/guilded_config/templates/load_guilded_settings.rb", "script/console", "script/destroy", "script/generate", "spec/guilded/component_def_spec.rb", "spec/guilded/guilder_spec.rb", "spec/guilded_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rails.rake", "tasks/rspec.rake"]
13
+ s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "guilded.gemspec", "lib/guilded.rb", "lib/guilded/component_def.rb", "lib/guilded/exceptions.rb", "lib/guilded/guilder.rb", "lib/guilded/rails.rb", "lib/guilded/rails/active_record/human_attribute_hint.rb", "lib/guilded/rails/active_record/human_attribute_override.rb", "lib/guilded/rails/helpers.rb", "lib/guilded/rails/view_helpers.rb", "rails_generators/guilded_assets/guilded_assets_generator.rb", "rails_generators/guilded_assets/templates/guilded.js", "rails_generators/guilded_assets/templates/guilded.min.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.js", "rails_generators/guilded_assets/templates/jquery-1.2.6.min.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.js", "rails_generators/guilded_assets/templates/jquery-1.3.2.min.js", "rails_generators/guilded_assets/templates/reset-min.css", "rails_generators/guilded_config/guilded_config_generator.rb", "rails_generators/guilded_config/templates/load_guilded_settings.rb", "script/console", "script/destroy", "script/generate", "spec/guilded/component_def_spec.rb", "spec/guilded/guilder_spec.rb", "spec/guilded_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rails.rake", "tasks/rspec.rake"]
14
14
  s.has_rdoc = true
15
15
  s.homepage = %q{http://github.com/midas/guilded-base/tree/master}
16
16
  s.post_install_message = %q{PostInstall.txt}
@@ -0,0 +1,62 @@
1
+ module Guilded
2
+ module Rails
3
+
4
+ # Common functionality that Rails Guilded components may need to use.
5
+ #
6
+ class Helpers
7
+
8
+ # Helper method that generates a path from an item. If item is :home then this method
9
+ # will call the home_path method to generate a link
10
+ #
11
+ def self.generate_link( item )
12
+ begin
13
+ link_path = @controller.send( "#{item.to_s}_path" )
14
+ rescue => e
15
+ if e.is_a? NoMethodError
16
+ link_path = ''
17
+ else
18
+ throw e
19
+ end
20
+ end
21
+ link_path
22
+ end
23
+
24
+ # Helper method that takes an array of choices, each being a string, symbol or hash,
25
+ # and resolves it into two arrays, one being an array of method names to get a fields
26
+ # value and the other being an array of titles to display the field as.
27
+ #
28
+ def self.resolve_field_methods_and_titles( choices, ar_obj )
29
+ titles = Array.new
30
+ methods = Array.new
31
+
32
+ choices.each do |choice|
33
+ if choice.is_a? Hash
34
+ if choice.to_a[0][1].is_a? Symbol
35
+ titles.push( choice.to_a[0][1].to_s.humanize.titleize )
36
+ else
37
+ titles.push( choice.to_a[0][1] )
38
+ end
39
+ if choice.to_a[0][0].is_a? Symbol
40
+ methods.push( choice.to_a[0][0].to_s )
41
+ else
42
+ methods.push( choice.to_a[0][0] )
43
+ end
44
+ else
45
+ title = nil
46
+ begin
47
+ title = ar_obj.class.human_attribute_name( choice )
48
+ rescue => ex
49
+ title = choice.to_s.humanize.titleize if ex.is_a?( NoMethodError )
50
+ end
51
+ titles.push( title )
52
+ methods.push( choice.to_s )
53
+ end
54
+ end
55
+
56
+ return methods, titles
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+ end
data/lib/guilded.rb CHANGED
@@ -71,7 +71,7 @@ require 'guilded/rails/active_record/human_attribute_override'
71
71
  # <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
72
72
  #
73
73
  module Guilded
74
- VERSION = '0.1.0'
74
+ VERSION = '0.1.1'
75
75
  end
76
76
 
77
77
  ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas-guilded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas)
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-12 00:00:00 -07:00
12
+ date: 2009-03-13 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -54,11 +54,11 @@ files:
54
54
  - lib/guilded.rb
55
55
  - lib/guilded/component_def.rb
56
56
  - lib/guilded/exceptions.rb
57
- - lib/guilded/guilded_helpers.rb
58
57
  - lib/guilded/guilder.rb
59
58
  - lib/guilded/rails.rb
60
59
  - lib/guilded/rails/active_record/human_attribute_hint.rb
61
60
  - lib/guilded/rails/active_record/human_attribute_override.rb
61
+ - lib/guilded/rails/helpers.rb
62
62
  - lib/guilded/rails/view_helpers.rb
63
63
  - rails_generators/guilded_assets/guilded_assets_generator.rb
64
64
  - rails_generators/guilded_assets/templates/guilded.js