Skip to content

Commit

Permalink
Release 0.2.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Harrelson committed Jun 18, 2009
1 parent 480a822 commit 33014f8
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 46 deletions.
5 changes: 5 additions & 0 deletions History.txt
@@ -1,3 +1,8 @@
= 0.2.9 2009-06-18

* Added rescue code if the browser name or version fails.


= 0.2.8 2009-06-12 = 0.2.8 2009-06-12


* Removed some code from the InactiveRecord:Base extension for human attrbiute hint that returns unless * Removed some code from the InactiveRecord:Base extension for human attrbiute hint that returns unless
Expand Down
4 changes: 2 additions & 2 deletions guilded.gemspec
Expand Up @@ -2,11 +2,11 @@


Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{guilded} s.name = %q{guilded}
s.version = "0.2.8" s.version = "0.2.9"


s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["C. Jason Harrelson (midas)"] s.authors = ["C. Jason Harrelson (midas)"]
s.date = %q{2009-06-12} s.date = %q{2009-06-18}
s.description = %q{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 gracefully 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 gem contains the framework to build Guilded components.} s.description = %q{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 gracefully 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 gem contains the framework to build Guilded components.}
s.email = ["jason@lookforwardenterprises.com"] s.email = ["jason@lookforwardenterprises.com"]
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"] s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
Expand Down
2 changes: 1 addition & 1 deletion lib/guilded.rb
Expand Up @@ -73,7 +73,7 @@
# <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %> # <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
# #
module Guilded module Guilded
VERSION = '0.2.8' VERSION = '0.2.9'
end end


ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView ) ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
92 changes: 52 additions & 40 deletions lib/guilded/browser_detector.rb
Expand Up @@ -34,37 +34,43 @@ def browser_is?( options={} )
# * +request+ - The request object. # * +request+ - The request object.
# #
def browser_name def browser_name
@browser_name ||= begin begin
ua = @request.env['HTTP_USER_AGENT'] @browser_name ||= begin
if ua.nil? ua = @request.env['HTTP_USER_AGENT']
'unknown' if ua.nil?
else 'unknown'
ua = ua.downcase else
ua = ua.downcase


if ua.index( 'msie' ) && !ua.index( 'opera' ) && !ua.index( 'webtv' ) if ua.index( 'msie' ) && !ua.index( 'opera' ) && !ua.index( 'webtv' )
if ua.index( 'windows ce' ) if ua.index( 'windows ce' )
'ie' + '_ce' #+ ua[ua.index( 'msie' ) + 5].chr 'ie' + '_ce' #+ ua[ua.index( 'msie' ) + 5].chr
else
'ie' # + ua[ua.index( 'msie' ) + 5].chr
end
elsif ua.include?( 'chrome' )
'chrome'
elsif ua.include?( 'netscape' )
'netscape'
elsif ua.include?( 'gecko/' )
'firefox'
elsif ua.include?( 'opera' )
'opera'
elsif ua.include?( 'konqueror' )
'konqueror'
elsif ua.include?( 'applewebkit/' )
'safari'
elsif ua.include?( 'mozilla/' )
'firefox'
elsif ua.include?( 'firefox' )
'firefox'
else else
'ie' # + ua[ua.index( 'msie' ) + 5].chr 'unknown'
end end
elsif ua.index( 'netscape' )
'netscape'
elsif ua.index( 'gecko/' )
'firefox'
elsif ua.index( 'opera' )
'opera'
elsif ua.index( 'konqueror' )
'konqueror'
elsif ua.index( 'applewebkit/' )
'safari'
elsif ua.index( 'mozilla/' )
'firefox'
elsif ua.index( 'firefox' )
'firefox'
else
'unknown'
end end
end end
rescue
'unknown'
end end
end end


Expand All @@ -83,22 +89,28 @@ def browser_full_name
# * +request+ - The request object. # * +request+ - The request object.
# #
def browser_version def browser_version
@browser_version ||= begin begin
ua = @request.env['HTTP_USER_AGENT'].downcase @browser_version ||= begin
ua = @request.env['HTTP_USER_AGENT'].downcase


if browser_name == 'opera' if browser_name == 'opera'
ua[ua.index( 'opera' ) + 6].chr ua[ua.index( 'opera' ) + 6].chr
elsif browser_name == 'firefox' elsif browser_name == 'chrome'
ua[ua.index( 'firefox' ) + 8].chr ua[ua.index( 'chrome' ) + 7].chr
elsif browser_name == 'netscape' elsif browser_name == 'firefox'
ua[ua.index( 'netscape' ) + 9].chr ua[ua.index( 'firefox' ) + 8].chr
elsif browser_name.index( 'ie' ) elsif browser_name == 'netscape'
ua[ua.index( 'msie' ) + 5].chr ua[ua.index( 'netscape' ) + 9].chr
elsif browser_name.index( 'safari' ) elsif browser_name.index( 'ie' )
ua[ua.index( 'version' ) + 8].chr ua[ua.index( 'msie' ) + 5].chr
else elsif browser_name.index( 'safari' )
'unknown' ua[ua.index( 'version' ) + 8].chr
else
'0'
end
end end
rescue
'0'
end end
end end


Expand Down
3 changes: 0 additions & 3 deletions lib/guilded/rails/inactive_record/human_attribute_hint.rb
@@ -1,9 +1,6 @@
module InactiveRecord module InactiveRecord
class Base class Base
class <<self class <<self
# Allows alternate humanized versions of attributes to be set. For example, an attribute such as 'num_employees' would be
# converted to 'Num employees' normally using <tt>human_attribute_name</tt>. More descriptive text can be set. Example:
# attr_human_name 'num_employees' => 'Number of employees'
def attr_human_hint(attributes) # :nodoc: def attr_human_hint(attributes) # :nodoc:
#return unless table_exists? #return unless table_exists?


Expand Down

0 comments on commit 33014f8

Please sign in to comment.