midas-g_nested_select 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Manifest.txt +19 -0
- data/PostInstall.txt +5 -0
- data/README.rdoc +101 -0
- data/Rakefile +30 -0
- data/lib/g_nested_select.rb +12 -0
- data/lib/g_nested_select/view_helpers.rb +46 -0
- data/rails_generators/nested_select_assets/nested_select_assets_generator.rb +15 -0
- data/rails_generators/nested_select_assets/templates/guilded.nested_select.js +41 -0
- data/rails_generators/nested_select_assets/templates/guilded.nested_select.min.js +4 -0
- data/rails_generators/nested_select_assets/templates/jquery-nested_select.js +80 -0
- data/rails_generators/nested_select_assets/templates/jquery-nested_select.min.js +5 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/g_nested_select_spec.rb +11 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +10 -0
- data/tasks/rspec.rake +21 -0
- metadata +172 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
PostInstall.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
lib/g_nested_select.rb
|
7
|
+
lib/g_nested_select/view_helpers.rb
|
8
|
+
rails_generators/nested_select_assets/nested_select_assets_generator.rb
|
9
|
+
rails_generators/nested_select_assets/templates/guilded.nested_select.js
|
10
|
+
rails_generators/nested_select_assets/templates/guilded.nested_select.min.js
|
11
|
+
rails_generators/nested_select_assets/templates/jquery-nested_select.js
|
12
|
+
rails_generators/nested_select_assets/templates/jquery-nested_select.min.js
|
13
|
+
script/console
|
14
|
+
script/destroy
|
15
|
+
script/generate
|
16
|
+
spec/g_nested_select_spec.rb
|
17
|
+
spec/spec.opts
|
18
|
+
spec/spec_helper.rb
|
19
|
+
tasks/rspec.rake
|
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
= g_auto_completer
|
2
|
+
|
3
|
+
http://github.com/midas/g_nested_select/tree/master
|
4
|
+
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
A Guilded (http://github.com/midas/guilded/tree/master) Rails component that generates a select box and connects it to a parent
|
9
|
+
select box to facilitate a parent child relationship.
|
10
|
+
|
11
|
+
|
12
|
+
== FEATURES:
|
13
|
+
|
14
|
+
|
15
|
+
== INSTALL:
|
16
|
+
|
17
|
+
sudo gem install midas-g_nested_select
|
18
|
+
|
19
|
+
|
20
|
+
== USAGE:
|
21
|
+
|
22
|
+
<% form_for @car do |f| %>
|
23
|
+
...
|
24
|
+
|
25
|
+
<%= f.select :vehicle_make_id, VehicleMake.to_select_collection, :id => 'car_vehicle_make_id' %>
|
26
|
+
|
27
|
+
<%= g_nested_select f, :vehicle_model_id, :mappings => VehicleModel.to_select_collection, :include_blank => true,
|
28
|
+
:parent_id => 'car_vehicle_make_id', :mapping_type => :html
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
Where VehicleModel.to_select_collection returns either:
|
32
|
+
|
33
|
+
[
|
34
|
+
['Toyota', [['Camry',1],['Corola',2]]], ['Volvo', [['S40',3],['S60',4]]]
|
35
|
+
]
|
36
|
+
|
37
|
+
or
|
38
|
+
|
39
|
+
{
|
40
|
+
'Toyota' => [['Camry',1],['Corola',2]], 'Volvo' => [['S40',3],['S60',4]]
|
41
|
+
}
|
42
|
+
|
43
|
+
When JavaScript is disabled, the above will result in:
|
44
|
+
|
45
|
+
<select id="ticket_vehicle_model_id" name="ticket[vehicle_model_id]">
|
46
|
+
<option value=""/>
|
47
|
+
<optgroup label="Toyota">
|
48
|
+
<option value="1">Camry</option>
|
49
|
+
<option value="2">Corola</option>
|
50
|
+
</optgroup>
|
51
|
+
<optgroup label="Volvo">
|
52
|
+
<option value="3">S40</option>
|
53
|
+
<option value="4">S60</option>
|
54
|
+
</optgroup>
|
55
|
+
</select>
|
56
|
+
|
57
|
+
When JavaScript is enabled the vehicle model id select control will be loaded with the vehicle models that are related to
|
58
|
+
what is currently selected in the vehicle make id select box. If there is nothing selected yet, then the vehicle model id
|
59
|
+
select box will be empty and will not populate until the vehicle make is selected.
|
60
|
+
|
61
|
+
If you open an edit view and there is already a value selected for both the vehicle make and vehicle model the vehicle model
|
62
|
+
selection will automatically select the correct value once it has loaded the nested options.
|
63
|
+
|
64
|
+
|
65
|
+
== OPTIONS:
|
66
|
+
|
67
|
+
* :mappings (required) - A collection suitable for creating a nested drop down (see example usage above for details).
|
68
|
+
* :include_blank - When true, includes an empty option at top of select box, otherwise does not. Defaults to false.
|
69
|
+
* :parent_id (required) - The id of the parent select box that the nested select box's values will be loaded based on.
|
70
|
+
* :mapping_type -
|
71
|
+
|
72
|
+
== REQUIREMENTS:
|
73
|
+
|
74
|
+
* Rails >= 2.2.0
|
75
|
+
* Guilded >= 0.2.0 (http://github.com/midas/guilded/tree/master)
|
76
|
+
|
77
|
+
|
78
|
+
== LICENSE:
|
79
|
+
|
80
|
+
(The MIT License)
|
81
|
+
|
82
|
+
Copyright (c) 2009 C. Jason Harrelson (midas)
|
83
|
+
|
84
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
85
|
+
a copy of this software and associated documentation files (the
|
86
|
+
'Software'), to deal in the Software without restriction, including
|
87
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
88
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
89
|
+
permit persons to whom the Software is furnished to do so, subject to
|
90
|
+
the following conditions:
|
91
|
+
|
92
|
+
The above copyright notice and this permission notice shall be
|
93
|
+
included in all copies or substantial portions of the Software.
|
94
|
+
|
95
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
96
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
97
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
98
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
99
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
100
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
101
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
|
2
|
+
require File.dirname(__FILE__) + '/lib/g_nested_select'
|
3
|
+
|
4
|
+
# Generate all the Rake tasks
|
5
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
6
|
+
$hoe = Hoe.new('g_nested_select', GNestedSelect::VERSION) do |p|
|
7
|
+
p.developer('C. Jason Harrelson', 'jason@lookforwardenterprises.com')
|
8
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
9
|
+
p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
10
|
+
p.rubyforge_name = p.name # TODO this is default value
|
11
|
+
# p.extra_deps = [
|
12
|
+
# ['activesupport','>= 2.0.2'],
|
13
|
+
# ]
|
14
|
+
p.extra_dev_deps = [
|
15
|
+
['newgem', ">= #{::Newgem::VERSION}"],
|
16
|
+
['rails', ">= 2.2.0"],
|
17
|
+
['midas-guilded', ">=0.2.0"]
|
18
|
+
]
|
19
|
+
|
20
|
+
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
21
|
+
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
22
|
+
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
23
|
+
p.rsync_args = '-av --delete --ignore-errors'
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'newgem/tasks' # load /tasks/*.rake
|
27
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
28
|
+
|
29
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
30
|
+
# task :default => [:spec, :features]
|
@@ -0,0 +1,12 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
require 'g_nested_select/view_helpers'
|
5
|
+
|
6
|
+
module GNestedSelect
|
7
|
+
VERSION = '1.0.0'
|
8
|
+
end
|
9
|
+
|
10
|
+
if defined?( ActionView::Base )
|
11
|
+
ActionView::Base.send( :include, GNestedSelect::ViewHelpers ) unless ActionView::Base.include?( GNestedSelect::ViewHelpers )
|
12
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module GNestedSelect
|
2
|
+
module ViewHelpers
|
3
|
+
|
4
|
+
def g_nested_select( form, field, *args )
|
5
|
+
options = args.extract_options!
|
6
|
+
raise "You must include a 'parent_id' option for a nested select to render" unless options.has_key?( :parent_id )
|
7
|
+
options[:class] ||= ''
|
8
|
+
options[:ajax] ||= false
|
9
|
+
options[:mapping_type] ||= :lookup
|
10
|
+
options[:selected_value] = form.object.send( field.to_sym )
|
11
|
+
select_options = Hash.new
|
12
|
+
select_options[:include_blank] = (options.delete( :include_blank ) || false)
|
13
|
+
klass = form.object.class.name.underscore
|
14
|
+
options[:id] ||= "#{klass}_#{field.to_s}"
|
15
|
+
html = ''
|
16
|
+
|
17
|
+
Guilded::Guilder.instance.add( :nested_select, options, ['jquery/jquery-nested_select.min.js'] )
|
18
|
+
|
19
|
+
if options.has_key?( :collection )
|
20
|
+
collection = options.delete( :collection )
|
21
|
+
html << form.select( field, collection, select_options )
|
22
|
+
elsif options.has_key?( :mappings )
|
23
|
+
mappings = options.delete( :mappings )
|
24
|
+
html << "<select name=\"#{klass}[#{field.to_s}]\" id=\"#{klass}_#{field.to_s}\" class=\"#{options[:class].to_s}\">"
|
25
|
+
html << "<option value=\"\"></option>" if select_options[:include_blank]
|
26
|
+
html << grouped_options_for_select( mappings, options[:selected_value] )
|
27
|
+
html << "</select>"
|
28
|
+
|
29
|
+
if options[:mapping_type].to_s == 'lookup'
|
30
|
+
options[:mappings] = mappings.to_json
|
31
|
+
elsif options[:mapping_type].to_s == 'html'
|
32
|
+
html_mappings = Hash.new
|
33
|
+
mappings.each { |key, mapping| html_mappings[key] = options_for_select( mapping ) }
|
34
|
+
options[:mappings] = html_mappings.to_json
|
35
|
+
else
|
36
|
+
raise "The g_nested_select's 'mapping_type' option's value is not valid. Please specify on of 'lookup' or 'html.'"
|
37
|
+
end
|
38
|
+
else
|
39
|
+
throw "You must include either a 'collection' or 'mappings' option to render a g_nested_select"
|
40
|
+
end
|
41
|
+
|
42
|
+
return html
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class NestedSelectAssetsGenerator < Rails::Generator::Base
|
2
|
+
def initialize(runtime_args, runtime_options = {})
|
3
|
+
super
|
4
|
+
end
|
5
|
+
|
6
|
+
def manifest
|
7
|
+
record do |m|
|
8
|
+
m.file "guilded.nested_select.js", "public/javascripts/guilded.nested_select.js"
|
9
|
+
m.file "guilded.nested_select.min.js", "public/javascripts/guilded.nested_select.min.js"
|
10
|
+
m.directory "public/javascripts/jquery"
|
11
|
+
m.file "jquery-nested_select.js", "public/javascripts/jquery-nested_select.js"
|
12
|
+
m.file "jquery-nested_select.min.js", "public/javascripts/jquery-nested_select.min.js"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/* Guilded Nested Select 1.0.0
|
2
|
+
* Copyright (c) 2009 C. Jason Harrelson (midas)
|
3
|
+
* Guilded Nested Select is licensed under the terms of the MIT License */
|
4
|
+
|
5
|
+
g.nestedSelectInit = function( options )
|
6
|
+
{
|
7
|
+
if( !options )
|
8
|
+
options = {};
|
9
|
+
|
10
|
+
if( g.beforeNestedSelectInit )
|
11
|
+
{
|
12
|
+
g.beforeNestedSelectInit( options );
|
13
|
+
}
|
14
|
+
|
15
|
+
/* Setup a table to lookup nested selects for each nested select
|
16
|
+
* control on this page */
|
17
|
+
if( !g.nestedSelectRelations )
|
18
|
+
g.nestedSelectRelations = {};
|
19
|
+
|
20
|
+
if( !g.nestedSelectedValues )
|
21
|
+
g.nestedSelectedValues = {};
|
22
|
+
|
23
|
+
if( !g.nestedSelectMappings )
|
24
|
+
g.nestedSelectMappings = {};
|
25
|
+
|
26
|
+
g.nestedSelectRelations[options.parent_id] = options.id;
|
27
|
+
g.nestedSelectedValues[options.id] = options.selected_value;
|
28
|
+
|
29
|
+
if( !options.ajax )
|
30
|
+
g.nestedSelectMappings[options.id] = eval( '(' + options.mappings + ')' );
|
31
|
+
|
32
|
+
options['nsRelations'] = g.nestedSelectRelations;
|
33
|
+
options['nsMappings'] = g.nestedSelectMappings;
|
34
|
+
options['nsSelectedValues'] = g.nestedSelectedValues;
|
35
|
+
$jid( options.id ).nestedSelect( options );
|
36
|
+
|
37
|
+
if( g.afterNestedSelectInit )
|
38
|
+
{
|
39
|
+
g.afterNestedSelectInit( options );
|
40
|
+
}
|
41
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/* Guilded Nested Select 1.0.0
|
2
|
+
* Copyright (c) 2009 C. Jason Harrelson (midas)
|
3
|
+
* Guilded Nested Select is licensed under the terms of the MIT License */
|
4
|
+
g.nestedSelectInit=function(options){if(!options)options={};if(g.beforeNestedSelectInit){g.beforeNestedSelectInit(options)}if(!g.nestedSelectRelations)g.nestedSelectRelations={};if(!g.nestedSelectedValues)g.nestedSelectedValues={};if(!g.nestedSelectMappings)g.nestedSelectMappings={};g.nestedSelectRelations[options.parent_id]=options.id;g.nestedSelectedValues[options.id]=options.selected_value;if(!options.ajax)g.nestedSelectMappings[options.id]=eval('('+options.mappings+')');options['nsRelations']=g.nestedSelectRelations;options['nsMappings']=g.nestedSelectMappings;options['nsSelectedValues']=g.nestedSelectedValues;$jid(options.id).nestedSelect(options);if(g.afterNestedSelectInit){g.afterNestedSelectInit(options)}};
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/*
|
2
|
+
* jquery Nested Select plugin
|
3
|
+
* by Jason Harrelson 2009-03-27
|
4
|
+
*/
|
5
|
+
(function($)
|
6
|
+
{
|
7
|
+
/* ************************************************************************** */
|
8
|
+
var options = null;
|
9
|
+
var afterNestedLoad = null; // Event that is fired after a nested select is loaded
|
10
|
+
|
11
|
+
jQuery.fn.nestedSelect = function( opts )
|
12
|
+
{
|
13
|
+
options = $.extend( jQuery.fn.nestedSelect.defaults, opts );
|
14
|
+
setUpNestedSelect( this );
|
15
|
+
return jQuery;
|
16
|
+
};
|
17
|
+
|
18
|
+
/* *************** public *************** */
|
19
|
+
|
20
|
+
jQuery.fn.nestedSelect.defaults =
|
21
|
+
{
|
22
|
+
|
23
|
+
};
|
24
|
+
|
25
|
+
/* *************** private *************** */
|
26
|
+
|
27
|
+
setUpNestedSelect = function( /* jquery Collection */ t )
|
28
|
+
{
|
29
|
+
var select = $( '#' + options.id );
|
30
|
+
var parent = $( '#' + options.parent_id );
|
31
|
+
select.empty();
|
32
|
+
parent.change( handleParentChange );
|
33
|
+
if( $( '#' + options.parent_id + ' :selected' ).text() != "" )
|
34
|
+
{
|
35
|
+
afterNestedLoad = selectInitialValue;
|
36
|
+
parent.change();
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
selectInitialValue = function( loadedId )
|
41
|
+
{
|
42
|
+
afterNestedLoad = null;
|
43
|
+
$( '#' + loadedId ).val( options['nsSelectedValues'][loadedId] )
|
44
|
+
};
|
45
|
+
|
46
|
+
handleParentChange = function( e )
|
47
|
+
{
|
48
|
+
var nsId = options['nsRelations'][e.target.id];
|
49
|
+
$( '#' + nsId ).empty();
|
50
|
+
selectedText = $( '#' + e.target.id + ' :selected' ).text();
|
51
|
+
nsMappings = options['nsMappings'];
|
52
|
+
var html = null;
|
53
|
+
|
54
|
+
if( options.mapping_type == 'lookup' )
|
55
|
+
{
|
56
|
+
if( nsMappings[nsId][selectedText] == null )
|
57
|
+
return;
|
58
|
+
|
59
|
+
html = "<option value=\"\"></option>";
|
60
|
+
$.each( nsMappings[nsId][selectedText], function( i, mapping )
|
61
|
+
{
|
62
|
+
html += "<option value=\"" + mapping[1] + "\">" + mapping[0] + "</option>"
|
63
|
+
});
|
64
|
+
}
|
65
|
+
else // mapping type = html
|
66
|
+
{
|
67
|
+
if( nsMappings[nsId][selectedText] == null )
|
68
|
+
return;
|
69
|
+
|
70
|
+
html = "<option value=\"\"></option>" + nsMappings[nsId][selectedText];
|
71
|
+
}
|
72
|
+
|
73
|
+
$( '#' + nsId ).append( html );
|
74
|
+
|
75
|
+
if( afterNestedLoad )
|
76
|
+
afterNestedLoad( nsId );
|
77
|
+
};
|
78
|
+
|
79
|
+
/* ************************************************************************** */
|
80
|
+
})(jQuery);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/*
|
2
|
+
* jquery Nested Select plugin
|
3
|
+
* by Jason Harrelson 2009-03-27
|
4
|
+
*/
|
5
|
+
(function($){var options=null;var afterNestedLoad=null;jQuery.fn.nestedSelect=function(opts){options=$.extend(jQuery.fn.nestedSelect.defaults,opts);setUpNestedSelect(this);return jQuery};jQuery.fn.nestedSelect.defaults={};setUpNestedSelect=function(t){var select=$('#'+options.id);var parent=$('#'+options.parent_id);select.empty();parent.change(handleParentChange);if($('#'+options.parent_id+' :selected').text()!=""){afterNestedLoad=selectInitialValue;parent.change()}};selectInitialValue=function(loadedId){afterNestedLoad=null;$('#'+loadedId).val(options['nsSelectedValues'][loadedId])};handleParentChange=function(e){var nsId=options['nsRelations'][e.target.id];$('#'+nsId).empty();selectedText=$('#'+e.target.id+' :selected').text();nsMappings=options['nsMappings'];var html=null;if(options.mapping_type=='lookup'){if(nsMappings[nsId][selectedText]==null)return;html="<option value=\"\"></option>";$.each(nsMappings[nsId][selectedText],function(i,mapping){html+="<option value=\""+mapping[1]+"\">"+mapping[0]+"</option>"})}else{if(nsMappings[nsId][selectedText]==null)return;html="<option value=\"\"></option>"+nsMappings[nsId][selectedText]}$('#'+nsId).append(html);if(afterNestedLoad)afterNestedLoad(nsId)}})(jQuery);
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/g_nested_select.rb'}"
|
9
|
+
puts "Loading g_nested_select gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: midas-g_nested_select
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- C. Jason Harrelson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-30 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: newgem
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.3
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.2.0
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: midas-guilded
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.2.0
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: hoe
|
47
|
+
type: :development
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.8.0
|
54
|
+
version:
|
55
|
+
description: A Guilded (http://github.com/midas/guilded/tree/master) Rails component that generates a select box and connects it to a parent select box to facilitate a parent child relationship.
|
56
|
+
email:
|
57
|
+
- jason@lookforwardenterprises.com
|
58
|
+
executables: []
|
59
|
+
|
60
|
+
extensions: []
|
61
|
+
|
62
|
+
extra_rdoc_files:
|
63
|
+
- History.txt
|
64
|
+
- Manifest.txt
|
65
|
+
- PostInstall.txt
|
66
|
+
- README.rdoc
|
67
|
+
files:
|
68
|
+
- .git/COMMIT_EDITMSG
|
69
|
+
- .git/HEAD
|
70
|
+
- .git/config
|
71
|
+
- .git/description
|
72
|
+
- .git/hooks/applypatch-msg.sample
|
73
|
+
- .git/hooks/commit-msg.sample
|
74
|
+
- .git/hooks/post-commit.sample
|
75
|
+
- .git/hooks/post-receive.sample
|
76
|
+
- .git/hooks/post-update.sample
|
77
|
+
- .git/hooks/pre-applypatch.sample
|
78
|
+
- .git/hooks/pre-commit.sample
|
79
|
+
- .git/hooks/pre-rebase.sample
|
80
|
+
- .git/hooks/prepare-commit-msg.sample
|
81
|
+
- .git/hooks/update.sample
|
82
|
+
- .git/index
|
83
|
+
- .git/info/exclude
|
84
|
+
- .git/logs/HEAD
|
85
|
+
- .git/logs/refs/heads/master
|
86
|
+
- .git/logs/refs/remotes/origin/master
|
87
|
+
- .git/objects/01/d96a7e5c0a09a41d0dda1cbb961b236a2564a8
|
88
|
+
- .git/objects/03/8839990d8f83d5abe56f79280ea07872232cde
|
89
|
+
- .git/objects/07/905e147380a08c68e24335998de97e02929c95
|
90
|
+
- .git/objects/0a/2865c6d980b7aef584a0d8944c68564a31466b
|
91
|
+
- .git/objects/0c/76865799841137c9778004ca17925ea8c55518
|
92
|
+
- .git/objects/0f/6181a89d73a714113011c9e29886930d9dcb01
|
93
|
+
- .git/objects/15/d15e670a6617774b7bc8583d02909e8234e1a1
|
94
|
+
- .git/objects/23/be2fb9ec080443aeca37619cc72bfd600f8e8b
|
95
|
+
- .git/objects/24/15fa49cb1d3d84a29d0fa0c7ac098cb759977a
|
96
|
+
- .git/objects/34/1667b73a8a8c7113ab79c09e8aaf97bd4668ba
|
97
|
+
- .git/objects/3c/63520ed652f36b994796949fe911a69094dd0c
|
98
|
+
- .git/objects/40/fc96eff8150a8fb68872b9dc3b60cb4e0e1490
|
99
|
+
- .git/objects/42/2b697a12538e8cb9790964be2638a6fe40f95f
|
100
|
+
- .git/objects/52/b955d31b5d52462cf81a50d95c565dfb52cf10
|
101
|
+
- .git/objects/53/4d87c13df66351b857299cfc92449745043078
|
102
|
+
- .git/objects/53/b5186fd0bf292c0bb14f51c32507ade54ba48d
|
103
|
+
- .git/objects/5c/20d2b2c643e54bd64ac98e9ca6f7326b6deb93
|
104
|
+
- .git/objects/62/02b7ed056d4cd9025bdd1420c62406c908ead3
|
105
|
+
- .git/objects/63/1b09ac5892037453aa96c0f75fa28b36bdf161
|
106
|
+
- .git/objects/70/fe3ef894f9d9e489aa2f474a421c55c2c59775
|
107
|
+
- .git/objects/72/4c34cb3a566a4a114b7ac09e6b1ab80d1e8784
|
108
|
+
- .git/objects/77/78a561745349b3c546c90802cabfb6f2cbdc37
|
109
|
+
- .git/objects/7f/b045a9a66e00daabaddcefe332537daba4a40e
|
110
|
+
- .git/objects/a1/8a40e6d17abcfc419c321494d874c4ef9b109e
|
111
|
+
- .git/objects/a5/2055a59d0d28cb88c2e41c92753aa73ff67b3b
|
112
|
+
- .git/objects/ab/019b7804ba000e2861b27c52a13b20775bdea6
|
113
|
+
- .git/objects/ab/e9b588bacc4cdc7c7269244ee43b4740c304e3
|
114
|
+
- .git/objects/b6/87fc4d5c7993024e7baa75ea665d87e694e51d
|
115
|
+
- .git/objects/b7/763794a9ae518526b9162e47dabea1ea5c7d0b
|
116
|
+
- .git/objects/ba/489b909eaffe87d803663bc429bbe53128ac4d
|
117
|
+
- .git/objects/c2/7f6559350f7adb19d43742b55b2f91d07b6550
|
118
|
+
- .git/objects/cf/6add7ea568d3d90d6a1f8afb0898b0119b14ff
|
119
|
+
- .git/objects/e4/8464df56bf487e96e21ea99487330266dae3c9
|
120
|
+
- .git/objects/f8/1035ce52ed1448385badc8cccef62da38cd0fb
|
121
|
+
- .git/objects/fa/729053ee06fad7b044df1102960bf78b0bbf67
|
122
|
+
- .git/objects/ff/abaa7df8499c88f849ae6cfe8697994b41d030
|
123
|
+
- .git/refs/heads/master
|
124
|
+
- .git/refs/remotes/origin/master
|
125
|
+
- History.txt
|
126
|
+
- Manifest.txt
|
127
|
+
- PostInstall.txt
|
128
|
+
- README.rdoc
|
129
|
+
- Rakefile
|
130
|
+
- lib/g_nested_select.rb
|
131
|
+
- lib/g_nested_select/view_helpers.rb
|
132
|
+
- rails_generators/nested_select_assets/nested_select_assets_generator.rb
|
133
|
+
- rails_generators/nested_select_assets/templates/guilded.nested_select.js
|
134
|
+
- rails_generators/nested_select_assets/templates/guilded.nested_select.min.js
|
135
|
+
- rails_generators/nested_select_assets/templates/jquery-nested_select.js
|
136
|
+
- rails_generators/nested_select_assets/templates/jquery-nested_select.min.js
|
137
|
+
- script/console
|
138
|
+
- script/destroy
|
139
|
+
- script/generate
|
140
|
+
- spec/g_nested_select_spec.rb
|
141
|
+
- spec/spec.opts
|
142
|
+
- spec/spec_helper.rb
|
143
|
+
- tasks/rspec.rake
|
144
|
+
has_rdoc: true
|
145
|
+
homepage: http://github.com/midas/g_nested_select/tree/master
|
146
|
+
post_install_message: PostInstall.txt
|
147
|
+
rdoc_options:
|
148
|
+
- --main
|
149
|
+
- README.rdoc
|
150
|
+
require_paths:
|
151
|
+
- lib
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: "0"
|
157
|
+
version:
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: "0"
|
163
|
+
version:
|
164
|
+
requirements: []
|
165
|
+
|
166
|
+
rubyforge_project: g_nested_select
|
167
|
+
rubygems_version: 1.2.0
|
168
|
+
signing_key:
|
169
|
+
specification_version: 2
|
170
|
+
summary: A Guilded (http://github.com/midas/guilded/tree/master) Rails component that generates a select box and connects it to a parent select box to facilitate a parent child relationship.
|
171
|
+
test_files: []
|
172
|
+
|