Skip to content

Commit fa4842a

Browse files
author
Jon Bringhurst
committed
Gemified.
1 parent 00d6bd2 commit fa4842a

15 files changed

+179
-52
lines changed

.document

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lib/**/*.rb
2+
bin/*
3+
-
4+
features/**/*.feature
5+
LICENSE.txt

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# rcov generated
2+
coverage
3+
4+
# rdoc generated
5+
rdoc
6+
7+
# yard generated
8+
doc
9+
.yardoc
10+
11+
# bundler
12+
.bundle
13+
14+
# jeweler generated
15+
pkg

Gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source "http://rubygems.org"
2+
# Add dependencies required to use your gem here.
3+
# Example:
4+
# gem "activesupport", ">= 2.3.5"
5+
6+
# Add dependencies to develop your gem here.
7+
# Include everything needed to run rake, tests, features, etc.
8+
group :development do
9+
gem "shoulda", ">= 0"
10+
gem "bundler", "~> 1.0.0"
11+
gem "jeweler", "~> 1.5.2"
12+
gem "rcov", ">= 0"
13+
end

Gemfile.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
git (1.2.5)
5+
jeweler (1.5.2)
6+
bundler (~> 1.0.0)
7+
git (>= 1.2.5)
8+
rake
9+
rake (0.8.7)
10+
rcov (0.9.9)
11+
shoulda (2.11.3)
12+
13+
PLATFORMS
14+
ruby
15+
16+
DEPENDENCIES
17+
bundler (~> 1.0.0)
18+
jeweler (~> 1.5.2)
19+
rcov
20+
shoulda

MIT-LICENSE renamed to LICENSE.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Copyright (c) 2009 [name of plugin creator]
1+
Copyright (c) 2010 [Phronos](http://phronos.com)
2+
Copyright (c) 2011 Jon Bringhurst <jon@bringhurst.org>
23

34
Permission is hereby granted, free of charge, to any person obtaining
45
a copy of this software and associated documentation files (the

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,4 @@ There is a more functionality offered by DataTables than this plugin currently p
136136
### Credits
137137

138138
Copyright (c) 2009 [Phronos](http://phronos.com), released under the MIT license
139+
Copyright (c) 2011 Jon Bringhurst <jon@bringhurst.org>, released under the MIT license

Rakefile

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,48 @@
1+
require 'rubygems'
2+
require 'bundler'
3+
begin
4+
Bundler.setup(:default, :development)
5+
rescue Bundler::BundlerError => e
6+
$stderr.puts e.message
7+
$stderr.puts "Run `bundle install` to install missing gems"
8+
exit e.status_code
9+
end
110
require 'rake'
11+
12+
require 'jeweler'
13+
Jeweler::Tasks.new do |gem|
14+
gem.name = "rails_datatables"
15+
gem.homepage = "http://github.com/fintler/rails_datatables"
16+
gem.license = "MIT"
17+
gem.summary = %Q{Rails plugin for the jQuery Datatables library }
18+
gem.description = %Q{A simpler, Rails-friendly interface to using the DataTables jQuery library.}
19+
gem.email = "jon@bringhurst.org"
20+
gem.authors = ["Jon Bringhurst"]
21+
end
22+
Jeweler::RubygemsDotOrgTasks.new
23+
224
require 'rake/testtask'
3-
require 'rake/rdoctask'
25+
Rake::TestTask.new(:test) do |test|
26+
test.libs << 'lib' << 'test'
27+
test.pattern = 'test/**/test_*.rb'
28+
test.verbose = true
29+
end
30+
31+
require 'rcov/rcovtask'
32+
Rcov::RcovTask.new do |test|
33+
test.libs << 'test'
34+
test.pattern = 'test/**/test_*.rb'
35+
test.verbose = true
36+
end
437

5-
desc 'Default: run unit tests.'
638
task :default => :test
739

8-
desc 'Test the rails_datatables plugin.'
9-
Rake::TestTask.new(:test) do |t|
10-
t.libs << 'lib'
11-
t.libs << 'test'
12-
t.pattern = 'test/**/*_test.rb'
13-
t.verbose = true
14-
end
40+
require 'rake/rdoctask'
41+
Rake::RDocTask.new do |rdoc|
42+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
1543

16-
desc 'Generate documentation for the rails_datatables plugin.'
17-
Rake::RDocTask.new(:rdoc) do |rdoc|
1844
rdoc.rdoc_dir = 'rdoc'
19-
rdoc.title = 'RailsDatatables'
20-
rdoc.options << '--line-numbers' << '--inline-source'
21-
rdoc.rdoc_files.include('README')
45+
rdoc.title = "rails_datatables #{version}"
46+
rdoc.rdoc_files.include('README*')
2247
rdoc.rdoc_files.include('lib/**/*.rb')
2348
end

init.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

install.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/rails_datatables.rb

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,33 @@ def datatable(columns, opts={})
2727
<script type="text/javascript">
2828
$(function() {
2929
$('#{table_dom_id}').dataTable({
30-
"oLanguage": {
31-
"sSearch": "#{search_label}",
32-
#{"'sZeroRecords': '#{no_records_message}'," if no_records_message}
33-
"sProcessing": '#{processing}'
34-
},
35-
"sPaginationType": "full_numbers",
36-
"iDisplayLength": #{per_page},
37-
"bProcessing": true,
38-
"bServerSide": #{server_side},
39-
"bLengthChange": false,
40-
"bStateSave": #{persist_state},
41-
"bFilter": #{search},
42-
"bAutoWidth": #{auto_width},
43-
#{"'aaSorting': [#{sort_by}]," if sort_by}
44-
#{"'sAjaxSource': '#{ajax_source}'," if ajax_source}
45-
"aoColumns": [
46-
#{formatted_columns(columns)}
47-
],
48-
#{"'fnRowCallback': function( nRow, aData, iDisplayIndex ) { #{row_callback} }," if row_callback}
49-
"fnServerData": function ( sSource, aoData, fnCallback ) {
50-
aoData.push( #{additional_data_string} );
51-
$.getJSON( sSource, aoData, function (json) {
52-
fnCallback(json);
53-
} );
54-
}
30+
"oLanguage": {
31+
"sSearch": "#{search_label}",
32+
#{"'sZeroRecords': '#{no_records_message}'," if no_records_message}
33+
"sProcessing": '#{processing}'
34+
},
35+
"sPaginationType": "full_numbers",
36+
"iDisplayLength": #{per_page},
37+
"bProcessing": true,
38+
"bServerSide": #{server_side},
39+
"bLengthChange": false,
40+
"bStateSave": #{persist_state},
41+
"bFilter": #{search},
42+
"bAutoWidth": #{auto_width},
43+
#{"'aaSorting': [#{sort_by}]," if sort_by}
44+
#{"'sAjaxSource': '#{ajax_source}'," if ajax_source}
45+
"aoColumns": [
46+
#{formatted_columns(columns)}
47+
],
48+
#{"'fnRowCallback': function( nRow, aData, iDisplayIndex ) {
49+
#{row_callback}
50+
}," if row_callback}
51+
"fnServerData": function ( sSource, aoData, fnCallback ) {
52+
aoData.push( #{additional_data_string} );
53+
$.getJSON( sSource, aoData, function (json) {
54+
fnCallback(json);
55+
});
56+
}
5557
})#{append};
5658
});
5759
</script>
@@ -78,4 +80,4 @@ def formatted_columns(columns)
7880
end
7981
}.join(",")
8082
end
81-
end
83+
end

rails_datatables.gemspec

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Generated by jeweler
2+
# DO NOT EDIT THIS FILE DIRECTLY
3+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4+
# -*- encoding: utf-8 -*-
5+
6+
Gem::Specification.new do |s|
7+
s.name = %q{rails_datatables}
8+
s.version = "0.0.0"
9+
10+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11+
s.authors = ["Jon Bringhurst"]
12+
s.date = %q{2011-04-22}
13+
s.description = %q{A simpler, Rails-friendly interface to using the DataTables jQuery library.}
14+
s.email = %q{jon@bringhurst.org}
15+
s.extra_rdoc_files = [
16+
"LICENSE.txt",
17+
"README.md"
18+
]
19+
s.files = [
20+
"README.md",
21+
"Rakefile",
22+
"VERSION",
23+
"lib/rails_datatables.rb"
24+
]
25+
s.homepage = %q{http://github.com/fintler/rails_datatables}
26+
s.licenses = ["MIT"]
27+
s.require_paths = ["lib"]
28+
s.rubygems_version = %q{1.6.2}
29+
s.summary = %q{Rails plugin for the jQuery Datatables library}
30+
s.test_files = [
31+
"test/helper.rb",
32+
"test/test_rails_datatables.rb"
33+
]
34+
35+
if s.respond_to? :specification_version then
36+
s.specification_version = 3
37+
38+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
39+
s.add_development_dependency(%q<shoulda>, [">= 0"])
40+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
41+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
42+
s.add_development_dependency(%q<rcov>, [">= 0"])
43+
else
44+
s.add_dependency(%q<shoulda>, [">= 0"])
45+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
46+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
47+
s.add_dependency(%q<rcov>, [">= 0"])
48+
end
49+
else
50+
s.add_dependency(%q<shoulda>, [">= 0"])
51+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
52+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
53+
s.add_dependency(%q<rcov>, [">= 0"])
54+
end
55+
end
56+
File renamed without changes.

test/rails_datatables_test.rb

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/test_rails_datatables.rb

Whitespace-only changes.

uninstall.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)