midas-guilded 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +12 -1
- data/Manifest.txt +2 -0
- data/guilded.gemspec +3 -3
- data/lib/guilded/rails/active_record/human_attribute_hint.rb +41 -0
- data/lib/guilded/rails/active_record/human_attribute_override.rb +41 -0
- data/lib/guilded.rb +3 -1
- metadata +4 -2
data/History.txt
CHANGED
@@ -1,8 +1,19 @@
|
|
1
|
-
== 0.0.
|
1
|
+
== 0.0.8 2009-03-12
|
2
|
+
|
3
|
+
* Added attr_human_override and attr_human_hint
|
4
|
+
|
5
|
+
|
6
|
+
== 0.0.7 2009-03-11
|
7
|
+
|
8
|
+
* Bug fixes
|
9
|
+
|
10
|
+
|
11
|
+
== 0.0.6 2009-03-11
|
2
12
|
|
3
13
|
* Updated config file and Guilder to accept an :env variable. This variable will allow Guilded to know what environment
|
4
14
|
it is running in so that it knows whether to cache assets, etc.
|
5
15
|
|
16
|
+
|
6
17
|
== 0.0.1 2009-02-28
|
7
18
|
|
8
19
|
* Initial release
|
data/Manifest.txt
CHANGED
@@ -9,6 +9,8 @@ lib/guilded/component_def.rb
|
|
9
9
|
lib/guilded/exceptions.rb
|
10
10
|
lib/guilded/guilder.rb
|
11
11
|
lib/guilded/rails.rb
|
12
|
+
lib/guilded/rails/active_record/human_attribute_hint.rb
|
13
|
+
lib/guilded/rails/active_record/human_attribute_override.rb
|
12
14
|
lib/guilded/rails/view_helpers.rb
|
13
15
|
rails_generators/guilded_assets/guilded_assets_generator.rb
|
14
16
|
rails_generators/guilded_assets/templates/guilded.js
|
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.0.
|
5
|
+
s.version = "0.0.8"
|
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-
|
9
|
+
s.date = %q{2009-03-12}
|
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/guilder.rb", "lib/guilded/rails.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/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,41 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
class Base
|
3
|
+
class <<self
|
4
|
+
# Allows alternate humanized versions of attributes to be set. For example, an attribute such as 'num_employees' would be
|
5
|
+
# converted to 'Num employees' normally using <tt>human_attribute_name</tt>. More descriptive text can be set. Example:
|
6
|
+
# attr_human_name 'num_employees' => 'Number of employees'
|
7
|
+
def attr_human_hint(attributes) # :nodoc:
|
8
|
+
return unless table_exists?
|
9
|
+
|
10
|
+
attributes.stringify_keys!
|
11
|
+
write_inheritable_hash("attr_human_hint", attributes || {})
|
12
|
+
|
13
|
+
# assign the current class to each column that is being assigned a new human attribute name
|
14
|
+
self.columns.reject{|c| !attributes.has_key?(c.name)}.each{|c| c.parent_record_class = self}
|
15
|
+
end
|
16
|
+
|
17
|
+
# Returns a hash of alternate human name conversions set with <tt>attr_human_name</tt>.
|
18
|
+
def human_hint_attributes # :nodoc:
|
19
|
+
read_inheritable_attribute("attr_human_hint")
|
20
|
+
end
|
21
|
+
|
22
|
+
# Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
|
23
|
+
# Person.human_attribute_name("first_name") # => "First name"
|
24
|
+
def human_attribute_hint(attribute_key_name) #:nodoc:
|
25
|
+
(read_inheritable_attribute("attr_human_hint") || {})[attribute_key_name.to_s] || ''
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module ConnectionAdapters #:nodoc:
|
31
|
+
# An abstract definition of a column in a table.
|
32
|
+
class Column
|
33
|
+
# the active record class that this column is associated with
|
34
|
+
attr_accessor :parent_record_class
|
35
|
+
|
36
|
+
def human_hint
|
37
|
+
(@parent_record_class || Base).human_attribute_hint(@name)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
class Base
|
3
|
+
class <<self
|
4
|
+
# Allows alternate humanized versions of attributes to be set. For example, an attribute such as 'num_employees' would be
|
5
|
+
# converted to 'Num employees' normally using <tt>human_attribute_name</tt>. More descriptive text can be set. Example:
|
6
|
+
# attr_human_name 'num_employees' => 'Number of employees'
|
7
|
+
def attr_human_name(attributes) # :nodoc:
|
8
|
+
return unless table_exists?
|
9
|
+
|
10
|
+
attributes.stringify_keys!
|
11
|
+
write_inheritable_hash("attr_human_name", attributes || {})
|
12
|
+
|
13
|
+
# assign the current class to each column that is being assigned a new human attribute name
|
14
|
+
self.columns.reject{|c| !attributes.has_key?(c.name)}.each{|c| c.parent_record_class = self}
|
15
|
+
end
|
16
|
+
|
17
|
+
# Returns a hash of alternate human name conversions set with <tt>attr_human_name</tt>.
|
18
|
+
def human_name_attributes # :nodoc:
|
19
|
+
read_inheritable_attribute("attr_human_name")
|
20
|
+
end
|
21
|
+
|
22
|
+
# Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
|
23
|
+
# Person.human_attribute_name("first_name") # => "First name"
|
24
|
+
def human_attribute_name(attribute_key_name) #:nodoc:
|
25
|
+
(read_inheritable_attribute("attr_human_name") || {})[attribute_key_name.to_s] || attribute_key_name.to_s.humanize.titleize
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module ConnectionAdapters #:nodoc:
|
31
|
+
# An abstract definition of a column in a table.
|
32
|
+
class Column
|
33
|
+
# the active record class that this column is associated with
|
34
|
+
attr_accessor :parent_record_class
|
35
|
+
|
36
|
+
def human_name
|
37
|
+
(@parent_record_class || Base).human_attribute_name(@name)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/guilded.rb
CHANGED
@@ -5,6 +5,8 @@ require 'guilded/component_def'
|
|
5
5
|
require 'guilded/guilder'
|
6
6
|
require 'guilded/exceptions'
|
7
7
|
require 'guilded/rails/view_helpers'
|
8
|
+
require 'guilded/rails/active_record/human_attribute_hint'
|
9
|
+
require 'guilded/rails/active_record/human_attribute_override'
|
8
10
|
|
9
11
|
# Guilded is a framework for creating reusable UI components for web applications. Guilded provides the facilities to
|
10
12
|
# easily add components and all of their required assets to a page.
|
@@ -68,7 +70,7 @@ require 'guilded/rails/view_helpers'
|
|
68
70
|
# <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
|
69
71
|
#
|
70
72
|
module Guilded
|
71
|
-
VERSION = '0.0.
|
73
|
+
VERSION = '0.0.8'
|
72
74
|
end
|
73
75
|
|
74
76
|
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.0.
|
4
|
+
version: 0.0.8
|
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
|
+
date: 2009-03-12 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -56,6 +56,8 @@ files:
|
|
56
56
|
- lib/guilded/exceptions.rb
|
57
57
|
- lib/guilded/guilder.rb
|
58
58
|
- lib/guilded/rails.rb
|
59
|
+
- lib/guilded/rails/active_record/human_attribute_hint.rb
|
60
|
+
- lib/guilded/rails/active_record/human_attribute_override.rb
|
59
61
|
- lib/guilded/rails/view_helpers.rb
|
60
62
|
- rails_generators/guilded_assets/guilded_assets_generator.rb
|
61
63
|
- rails_generators/guilded_assets/templates/guilded.js
|