muck-engine 0.1.24 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -65,33 +65,9 @@ begin
65
65
  lib/**/*
66
66
  public/javascripts/* )
67
67
  end
68
+ Jeweler::RubyforgeTasks.new do |rubyforge|
69
+ rubyforge.doc_task = "rdoc"
70
+ end
68
71
  rescue LoadError
69
72
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
70
73
  end
71
-
72
- # rubyforge tasks
73
- begin
74
- require 'rake/contrib/sshpublisher'
75
- namespace :rubyforge do
76
-
77
- desc "Release gem and RDoc documentation to RubyForge"
78
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
79
-
80
- namespace :release do
81
- desc "Publish RDoc to RubyForge."
82
- task :docs => [:rdoc] do
83
- config = YAML.load(
84
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
85
- )
86
-
87
- host = "#{config['username']}@rubyforge.org"
88
- remote_dir = "/var/www/gforge-projects/muck-engine/"
89
- local_dir = 'rdoc'
90
-
91
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
92
- end
93
- end
94
- end
95
- rescue LoadError
96
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
97
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.24
1
+ 0.1.25
@@ -120,4 +120,23 @@ module MuckEngineHelper
120
120
  text.split[0..(wordcount-1)].join(" ") + (text.split.size > wordcount ? " " + omission : "")
121
121
  end
122
122
 
123
+ def round(flt)
124
+ return (((flt.to_f*100).to_i.round).to_f)/100.0
125
+ end
126
+
127
+ def truncate_on_word(text, length = 270, end_string = ' ...')
128
+ if text.length > length
129
+ stop_index = text.rindex(' ', length)
130
+ stop_index = length - 10 if stop_index < length-10
131
+ text[0,stop_index] + (text.length > 260 ? end_string : '')
132
+ else
133
+ text
134
+ end
135
+ end
136
+
137
+ def truncate_words(text, length = 40, end_string = ' ...')
138
+ words = text.split()
139
+ words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')
140
+ end
141
+
123
142
  end
data/muck-engine.gemspec CHANGED
@@ -1,12 +1,15 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{muck-engine}
5
- s.version = "0.1.24"
8
+ s.version = "0.1.25"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Justin Ball"]
9
- s.date = %q{2009-08-08}
12
+ s.date = %q{2009-08-12}
10
13
  s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
11
14
  s.email = %q{justinball@gmail.com}
12
15
  s.extra_rdoc_files = [
@@ -580,7 +583,6 @@ Gem::Specification.new do |s|
580
583
  "test/rails_root/config/routes.rb",
581
584
  "test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb",
582
585
  "test/rails_root/db/migrate/20090602041838_create_users.rb",
583
- "test/rails_root/db/schema.rb",
584
586
  "test/rails_root/features/step_definitions/webrat_steps.rb",
585
587
  "test/rails_root/features/support/env.rb",
586
588
  "test/rails_root/public/dispatch.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-08 00:00:00 -06:00
12
+ date: 2009-08-12 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -529,7 +529,6 @@ test_files:
529
529
  - test/rails_root/config/routes.rb
530
530
  - test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb
531
531
  - test/rails_root/db/migrate/20090602041838_create_users.rb
532
- - test/rails_root/db/schema.rb
533
532
  - test/rails_root/features/step_definitions/webrat_steps.rb
534
533
  - test/rails_root/features/support/env.rb
535
534
  - test/rails_root/public/dispatch.rb