muck-engine 3.0.6 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/app/helpers/muck_engine_helper.rb +6 -6
- data/app/views/shared/_flash_error_box.erb +1 -1
- data/lib/muck_test_helper.rb +1 -2
- data/muck-engine.gemspec +4 -2
- data/public/javascripts/jquery/jquery.autocomplete.min.js +15 -0
- data/public/stylesheets/jquery.autocomplete.css +15 -0
- data/test/rails_test/Gemfile +2 -2
- data/test/rails_test/Gemfile.lock +30 -23
- data/test/rails_test/spec/helpers/muck_engine_helper_spec.rb +22 -0
- metadata +6 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.7
|
@@ -213,17 +213,17 @@ module MuckEngineHelper
|
|
213
213
|
end
|
214
214
|
|
215
215
|
def truncate_on_word(text, length = 270, end_string = ' ...')
|
216
|
-
return if text.blank?
|
217
|
-
if text.length > length
|
218
|
-
stop_index = text.rindex(' ', length)
|
219
|
-
stop_index
|
220
|
-
text[0,stop_index] + (text.length > 260 ? end_string : '')
|
216
|
+
return '' if text.blank?
|
217
|
+
if text.length > length + end_string.length
|
218
|
+
stop_index = text.rindex(' ', length - end_string.length)
|
219
|
+
text[0,stop_index] + end_string
|
221
220
|
else
|
222
|
-
text
|
221
|
+
text + end_string
|
223
222
|
end
|
224
223
|
end
|
225
224
|
|
226
225
|
def truncate_words(text, length = 40, end_string = ' ...')
|
226
|
+
return '' if text.blank?
|
227
227
|
words = text.split()
|
228
228
|
words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')
|
229
229
|
end
|
data/lib/muck_test_helper.rb
CHANGED
data/muck-engine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-engine}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-01}
|
13
13
|
s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -559,6 +559,7 @@ Gem::Specification.new do |s|
|
|
559
559
|
"public/javascripts/jquery/fg.menu.js",
|
560
560
|
"public/javascripts/jquery/jquery-ui-1.8.4.custom.min.js",
|
561
561
|
"public/javascripts/jquery/jquery-ui.js",
|
562
|
+
"public/javascripts/jquery/jquery.autocomplete.min.js",
|
562
563
|
"public/javascripts/jquery/jquery.easing.js",
|
563
564
|
"public/javascripts/jquery/jquery.fancybox.js",
|
564
565
|
"public/javascripts/jquery/jquery.form.js",
|
@@ -627,6 +628,7 @@ Gem::Specification.new do |s|
|
|
627
628
|
"public/stylesheets/flick/images/ui-icons_ff0084_256x240.png",
|
628
629
|
"public/stylesheets/flick/images/ui-icons_ffffff_256x240.png",
|
629
630
|
"public/stylesheets/flick/jquery-ui-1.8.1.custom.css",
|
631
|
+
"public/stylesheets/jquery.autocomplete.css",
|
630
632
|
"public/stylesheets/jquery/jquery.fancybox.css",
|
631
633
|
"public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png",
|
632
634
|
"public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png",
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* Autocomplete - jQuery plugin 1.0.2
|
3
|
+
*
|
4
|
+
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
|
5
|
+
*
|
6
|
+
* Dual licensed under the MIT and GPL licenses:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* http://www.gnu.org/licenses/gpl.html
|
9
|
+
*
|
10
|
+
* Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
|
11
|
+
*
|
12
|
+
*/;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else
|
13
|
+
$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
|
14
|
+
if(data[q]){return data[q];}else
|
15
|
+
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.ac_results{padding:0px;border:1px solid black;background-color:white;overflow:hidden;z-index:99999;color:#555;}
|
2
|
+
.ac_results ul{width:100%;list-style-position:outside;list-style:none;padding:0;margin:0;}
|
3
|
+
.ac_results li{margin:0px;padding:2px 5px;cursor:default;display:block;/*
|
4
|
+
if width will be 100% horizontal scrollbar will apear
|
5
|
+
when scroll mode will be used
|
6
|
+
*/
|
7
|
+
/*width:100%;*/
|
8
|
+
font:menu;font-size:12px;/*
|
9
|
+
it is very important,if line-height not setted or setted
|
10
|
+
in relative units scroll will be broken in firefox
|
11
|
+
*/
|
12
|
+
line-height:16px;overflow:hidden;}
|
13
|
+
.ac_loading{background:white url('/images/spinner.gif') right center no-repeat;}
|
14
|
+
.ac_odd{background-color:#eee;}
|
15
|
+
.ac_over{background-color:#0A246A;color:white;}
|
data/test/rails_test/Gemfile
CHANGED
@@ -19,7 +19,7 @@ if RUBY_VERSION < "1.9"
|
|
19
19
|
end
|
20
20
|
|
21
21
|
group :test, :development do
|
22
|
-
gem "rspec-rails", ">=2.0.
|
22
|
+
gem "rspec-rails", ">=2.0.1"
|
23
23
|
gem "cucumber-rails"
|
24
24
|
end
|
25
25
|
|
@@ -31,7 +31,7 @@ group :test do
|
|
31
31
|
gem "factory_girl"
|
32
32
|
gem "cucumber"
|
33
33
|
gem "rcov"
|
34
|
-
gem "rspec", ">=2.0.
|
34
|
+
gem "rspec", ">=2.0.1"
|
35
35
|
gem "database_cleaner"
|
36
36
|
gem "spork"
|
37
37
|
gem "launchy"
|
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: /Users/jbasdf/projects/muck-engine
|
11
11
|
specs:
|
12
|
-
muck-engine (3.0.
|
12
|
+
muck-engine (3.0.6)
|
13
13
|
overlord
|
14
14
|
validation_reflection
|
15
15
|
will_paginate (~> 3.0.beta)
|
@@ -17,7 +17,7 @@ PATH
|
|
17
17
|
PATH
|
18
18
|
remote: /Users/jbasdf/projects/muck-users
|
19
19
|
specs:
|
20
|
-
muck-users (3.0.
|
20
|
+
muck-users (3.0.5)
|
21
21
|
authlogic
|
22
22
|
bcrypt-ruby
|
23
23
|
friendly_id
|
@@ -64,28 +64,31 @@ GEM
|
|
64
64
|
babosa (0.2.0)
|
65
65
|
bcrypt-ruby (2.1.2)
|
66
66
|
builder (2.1.2)
|
67
|
-
capybara (0.
|
67
|
+
capybara (0.4.0)
|
68
|
+
celerity (>= 0.7.9)
|
68
69
|
culerity (>= 0.2.4)
|
69
70
|
mime-types (>= 1.16)
|
70
71
|
nokogiri (>= 1.3.3)
|
71
72
|
rack (>= 1.0.0)
|
72
73
|
rack-test (>= 0.5.4)
|
73
|
-
selenium-webdriver (>= 0.0.
|
74
|
+
selenium-webdriver (>= 0.0.27)
|
75
|
+
xpath (~> 0.1.2)
|
76
|
+
celerity (0.8.2)
|
74
77
|
childprocess (0.1.3)
|
75
78
|
ffi (~> 0.6.3)
|
76
79
|
columnize (0.3.1)
|
77
80
|
configuration (1.1.0)
|
78
81
|
crack (0.1.8)
|
79
|
-
cucumber (0.9.
|
82
|
+
cucumber (0.9.3)
|
80
83
|
builder (~> 2.1.2)
|
81
84
|
diff-lcs (~> 1.1.2)
|
82
|
-
gherkin (~> 2.2.
|
85
|
+
gherkin (~> 2.2.9)
|
83
86
|
json (~> 1.4.6)
|
84
87
|
term-ansicolor (~> 1.0.5)
|
85
88
|
cucumber-rails (0.3.2)
|
86
89
|
cucumber (>= 0.8.0)
|
87
90
|
culerity (0.2.12)
|
88
|
-
database_cleaner (0.
|
91
|
+
database_cleaner (0.6.0)
|
89
92
|
diff-lcs (1.1.2)
|
90
93
|
disguise (3.0.2)
|
91
94
|
erubis (2.6.6)
|
@@ -100,22 +103,24 @@ GEM
|
|
100
103
|
term-ansicolor (~> 1.0.5)
|
101
104
|
httparty (0.6.1)
|
102
105
|
crack (= 0.1.8)
|
103
|
-
i18n (0.4.
|
106
|
+
i18n (0.4.2)
|
104
107
|
json (1.4.6)
|
105
108
|
json_pure (1.4.6)
|
106
109
|
launchy (0.3.7)
|
107
110
|
configuration (>= 0.0.5)
|
108
111
|
rake (>= 0.8.1)
|
109
112
|
linecache (0.43)
|
110
|
-
mail (2.2.
|
113
|
+
mail (2.2.9)
|
111
114
|
activesupport (>= 2.3.6)
|
112
|
-
|
113
|
-
|
115
|
+
i18n (~> 0.4.1)
|
116
|
+
mime-types (~> 1.16)
|
117
|
+
treetop (~> 1.4.8)
|
114
118
|
mime-types (1.16)
|
115
119
|
mysql (2.8.1)
|
116
120
|
nokogiri (1.4.3.1)
|
117
|
-
overlord (3.0.
|
121
|
+
overlord (3.0.2)
|
118
122
|
httparty
|
123
|
+
json
|
119
124
|
polyglot (0.3.1)
|
120
125
|
rack (1.2.1)
|
121
126
|
rack-mount (0.6.13)
|
@@ -137,16 +142,16 @@ GEM
|
|
137
142
|
thor (~> 0.14.0)
|
138
143
|
rake (0.8.7)
|
139
144
|
rcov (0.9.9)
|
140
|
-
rspec (2.0.
|
141
|
-
rspec-core (
|
142
|
-
rspec-expectations (
|
143
|
-
rspec-mocks (
|
144
|
-
rspec-core (2.0.
|
145
|
-
rspec-expectations (2.0.
|
145
|
+
rspec (2.0.1)
|
146
|
+
rspec-core (~> 2.0.1)
|
147
|
+
rspec-expectations (~> 2.0.1)
|
148
|
+
rspec-mocks (~> 2.0.1)
|
149
|
+
rspec-core (2.0.1)
|
150
|
+
rspec-expectations (2.0.1)
|
146
151
|
diff-lcs (>= 1.1.2)
|
147
|
-
rspec-mocks (2.0.
|
148
|
-
rspec-core (
|
149
|
-
rspec-expectations (
|
152
|
+
rspec-mocks (2.0.1)
|
153
|
+
rspec-core (~> 2.0.1)
|
154
|
+
rspec-expectations (~> 2.0.1)
|
150
155
|
rspec-rails (2.0.1)
|
151
156
|
rspec (~> 2.0.0)
|
152
157
|
ruby-debug (0.10.3)
|
@@ -168,6 +173,8 @@ GEM
|
|
168
173
|
tzinfo (0.3.23)
|
169
174
|
validation_reflection (1.0.0)
|
170
175
|
will_paginate (3.0.pre2)
|
176
|
+
xpath (0.1.2)
|
177
|
+
nokogiri (~> 1.3)
|
171
178
|
|
172
179
|
PLATFORMS
|
173
180
|
ruby
|
@@ -189,8 +196,8 @@ DEPENDENCIES
|
|
189
196
|
overlord
|
190
197
|
rails (= 3.0.1)
|
191
198
|
rcov
|
192
|
-
rspec (>= 2.0.
|
193
|
-
rspec-rails (>= 2.0.
|
199
|
+
rspec (>= 2.0.1)
|
200
|
+
rspec-rails (>= 2.0.1)
|
194
201
|
ruby-debug
|
195
202
|
shoulda!
|
196
203
|
spork
|
@@ -57,6 +57,28 @@ describe MuckEngineHelper do
|
|
57
57
|
# end
|
58
58
|
# end
|
59
59
|
|
60
|
+
describe "truncate_words" do
|
61
|
+
it "should build a string 157 chars long" do
|
62
|
+
text = "Kimball was born to Solomon Farnham Kimball and Anna Spaulding in Sheldon, Franklin County, Vermont. Kimball's forefathers arrived in America from England and started"
|
63
|
+
helper.truncate_words(text, 5, ' ...').length.should == "Kimball was born to Solomon ...".length
|
64
|
+
end
|
65
|
+
it "should not crash if string is nil" do
|
66
|
+
text = nil
|
67
|
+
helper.truncate_words(text, 5, ' ...').length.should == 0
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "truncate_on_word" do
|
72
|
+
it "should build a string 157 chars long" do
|
73
|
+
text = "Kimball was born to Solomon Farnham Kimball and Anna Spaulding in Sheldon, Franklin County, Vermont. Kimball's forefathers arrived in America from England and started"
|
74
|
+
helper.truncate_on_word(text, 160, ' ...').length.should == 158
|
75
|
+
end
|
76
|
+
it "should not crash if string is nil" do
|
77
|
+
text = nil
|
78
|
+
helper.truncate_on_word(text, 160, ' ...').length.should == 0
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
60
82
|
describe "locale_link" do
|
61
83
|
it "should prepend the locale to a domain without a subdomain" do
|
62
84
|
helper.request.stub(:host).and_return('folksemantic.com')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 7
|
10
|
+
version: 3.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ball
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-11-01 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -831,6 +831,7 @@ files:
|
|
831
831
|
- public/javascripts/jquery/fg.menu.js
|
832
832
|
- public/javascripts/jquery/jquery-ui-1.8.4.custom.min.js
|
833
833
|
- public/javascripts/jquery/jquery-ui.js
|
834
|
+
- public/javascripts/jquery/jquery.autocomplete.min.js
|
834
835
|
- public/javascripts/jquery/jquery.easing.js
|
835
836
|
- public/javascripts/jquery/jquery.fancybox.js
|
836
837
|
- public/javascripts/jquery/jquery.form.js
|
@@ -899,6 +900,7 @@ files:
|
|
899
900
|
- public/stylesheets/flick/images/ui-icons_ff0084_256x240.png
|
900
901
|
- public/stylesheets/flick/images/ui-icons_ffffff_256x240.png
|
901
902
|
- public/stylesheets/flick/jquery-ui-1.8.1.custom.css
|
903
|
+
- public/stylesheets/jquery.autocomplete.css
|
902
904
|
- public/stylesheets/jquery/jquery.fancybox.css
|
903
905
|
- public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
|
904
906
|
- public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
|