dm-last 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 YOUR NAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,5 @@
1
+ dm-last
2
+ =======
3
+
4
+ A plugin for the DataMapper framework that provides a short-hand for
5
+ Model.all.last as Model.last.
@@ -0,0 +1,79 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+
4
+ require 'merb-core'
5
+ require 'merb-core/tasks/merb'
6
+
7
+ GEM_NAME = "dm-last"
8
+ GEM_VERSION = "0.0.1"
9
+ AUTHOR = "Genki Takiuchi"
10
+ EMAIL = "genki@s21g.com"
11
+ HOMEPAGE = "http://merbivore.com/"
12
+ RUBYFORGE_PROJECT = 'asakusarb'
13
+ SUMMARY = "DataMapper plugin that provides a short hand for Model.all.last as Model.last"
14
+
15
+ spec = Gem::Specification.new do |s|
16
+ s.rubyforge_project = RUBYFORGE_PROJECT
17
+ s.name = GEM_NAME
18
+ s.version = GEM_VERSION
19
+ s.platform = Gem::Platform::RUBY
20
+ s.has_rdoc = true
21
+ s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
22
+ s.summary = SUMMARY
23
+ s.description = s.summary
24
+ s.author = AUTHOR
25
+ s.email = EMAIL
26
+ s.homepage = HOMEPAGE
27
+ s.add_dependency('merb', '>= 1.0.9')
28
+ s.require_path = 'lib'
29
+ s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,spec}/**/*")
30
+
31
+ end
32
+
33
+ Rake::GemPackageTask.new(spec) do |pkg|
34
+ pkg.need_tar = true
35
+ pkg.gem_spec = spec
36
+ end
37
+
38
+ desc "install the plugin as a gem"
39
+ task :install do
40
+ Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
41
+ end
42
+
43
+ desc "Uninstall the gem"
44
+ task :uninstall do
45
+ Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
46
+ end
47
+
48
+ desc "Create a gemspec file"
49
+ task :gemspec do
50
+ File.open("#{GEM_NAME}.gemspec", "w") do |file|
51
+ file.puts spec.to_ruby
52
+ end
53
+ end
54
+
55
+ desc 'Package and upload the release to rubyforge.'
56
+ task :release => :package do |t|
57
+ require 'rubyforge'
58
+ v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
59
+ abort "Versions don't match #{v} vs #{GEM_VERSION}" unless v == GEM_VERSION
60
+ pkg = "pkg/#{GEM_NAME}-#{GEM_VERSION}"
61
+
62
+ require 'rubyforge'
63
+ rf = RubyForge.new.configure
64
+ puts "Logging in"
65
+ rf.login
66
+
67
+ c = rf.userconfig
68
+ # c["release_notes"] = description if description
69
+ # c["release_changes"] = changes if changes
70
+ c["preformatted"] = true
71
+
72
+ files = [
73
+ "#{pkg}.tgz",
74
+ "#{pkg}.gem"
75
+ ].compact
76
+
77
+ puts "Releasing #{GEM_NAME} v. #{GEM_VERSION}"
78
+ rf.add_release RUBYFORGE_PROJECT, GEM_NAME, GEM_VERSION, *files
79
+ end
data/TODO ADDED
@@ -0,0 +1,5 @@
1
+ TODO:
2
+ Fix LICENSE with your name
3
+ Fix Rakefile with your name and contact info
4
+ Add your code to lib/dm-last.rb
5
+ Add your Merb rake tasks to lib/dm-last/merbtasks.rb
@@ -0,0 +1,19 @@
1
+ # make sure we're running inside Merb
2
+ if defined?(Merb::Plugins)
3
+
4
+ # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
5
+ Merb::Plugins.config[:dm_last] = {
6
+ :chickens => false
7
+ }
8
+
9
+ Merb::BootLoader.before_app_loads do
10
+ # require code that must be loaded before the application
11
+ require 'dm-last/model_ext'
12
+ end
13
+
14
+ Merb::BootLoader.after_app_loads do
15
+ # code that can be required after the application loads
16
+ end
17
+
18
+ Merb::Plugins.add_rakefiles "dm-last/merbtasks"
19
+ end
@@ -0,0 +1,6 @@
1
+ namespace :dm_last do
2
+ desc "Do something for dm-last"
3
+ task :default do
4
+ puts "dm-last doesn't do anything"
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ module DataMapper
2
+ module Last
3
+ def last
4
+ all.last
5
+ end
6
+ end
7
+
8
+ module Resource
9
+ module ClassMethods
10
+ include ::DataMapper::Last
11
+ end
12
+ end
13
+
14
+ class Collection
15
+ extend ::DataMapper::Last
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "dm-last" do
4
+ it "should do nothing" do
5
+ true.should == true
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ $:.push File.join(File.dirname(__FILE__), '..', 'lib')
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dm-last
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Genki Takiuchi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-18 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: merb
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.0.9
24
+ version:
25
+ description: DataMapper plugin that provides a short hand for Model.all.last as Model.last
26
+ email: genki@s21g.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README
33
+ - LICENSE
34
+ - TODO
35
+ files:
36
+ - LICENSE
37
+ - README
38
+ - Rakefile
39
+ - TODO
40
+ - lib/dm-last
41
+ - lib/dm-last/merbtasks.rb
42
+ - lib/dm-last/model_ext.rb
43
+ - lib/dm-last.rb
44
+ - spec/dm-last_spec.rb
45
+ - spec/spec_helper.rb
46
+ has_rdoc: true
47
+ homepage: http://merbivore.com/
48
+ post_install_message:
49
+ rdoc_options: []
50
+
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ requirements: []
66
+
67
+ rubyforge_project: asakusarb
68
+ rubygems_version: 1.3.1
69
+ signing_key:
70
+ specification_version: 2
71
+ summary: DataMapper plugin that provides a short hand for Model.all.last as Model.last
72
+ test_files: []
73
+