Permalink
Browse files

Kiss merb_datamapper goodbye: it is now maintained by Datamapper comm…

…unity.

Datamapper community recently decided to maintain Merb plugin and
even renamed it to merb_datamapper so this one we have in merb-plugins
is obsolete.
  • Loading branch information...
1 parent 1b7fe32 commit 5159bb3ad894fdd8bb26ede96fb70d75ba63ef97 @michaelklishin michaelklishin committed May 4, 2008
Showing with 3 additions and 615 deletions.
  1. +2 −2 Rakefile
  2. +0 −20 merb_datamapper/LICENSE
  3. +0 −10 merb_datamapper/README
  4. +0 −46 merb_datamapper/Rakefile
  5. +0 −4 merb_datamapper/TODO
  6. +0 −5 merb_datamapper/datamapper_generators/migration/USAGE
  7. +0 −64 merb_datamapper/datamapper_generators/migration/migration_generator.rb
  8. +0 −7 merb_datamapper/datamapper_generators/migration/templates/new_migration.erb
  9. 0 merb_datamapper/datamapper_generators/model/USAGE
  10. +0 −38 merb_datamapper/datamapper_generators/model/model_generator.rb
  11. +0 −5 merb_datamapper/datamapper_generators/model/templates/app/models/%model_file_name%.rb
  12. 0 merb_datamapper/datamapper_generators/resource_controller/USAGE
  13. +0 −74 merb_datamapper/datamapper_generators/resource_controller/resource_controller_generator.rb
  14. +0 −68 ...per/datamapper_generators/resource_controller/templates/app/controllers/%controller_file_name%.rb
  15. +0 −16 .../datamapper_generators/resource_controller/templates/app/helpers/%controller_file_name%_helper.rb
  16. +0 −3 ...atamapper_generators/resource_controller/templates/app/views/%controller_file_name%/edit.html.erb
  17. +0 −3 ...tamapper_generators/resource_controller/templates/app/views/%controller_file_name%/index.html.erb
  18. +0 −3 ...datamapper_generators/resource_controller/templates/app/views/%controller_file_name%/new.html.erb
  19. +0 −3 ...atamapper_generators/resource_controller/templates/app/views/%controller_file_name%/show.html.erb
  20. +0 −6 merb_datamapper/lib/merb/orms/data_mapper/base.rb
  21. +0 −60 merb_datamapper/lib/merb/orms/data_mapper/connection.rb
  22. +0 −16 merb_datamapper/lib/merb/orms/data_mapper/database.yml.sample
  23. +0 −112 merb_datamapper/lib/merb/session/data_mapper_session.rb
  24. +0 −16 merb_datamapper/lib/merb_datamapper.rb
  25. +0 −31 merb_datamapper/lib/merb_datamapper/merbtasks.rb
  26. 0 merb_datamapper/specs/merb_sequel_spec.rb
  27. +0 −2 merb_datamapper/specs/spec_helper.rb
  28. +1 −1 release_plugins
View
@@ -5,9 +5,9 @@ windows = (PLATFORM =~ /win32|cygwin/) rescue nil
SUDO = windows ? "" : "sudo"
-gems = %w[merb_activerecord merb_datamapper merb_helpers merb_sequel merb_param_protection merb_test_unit merb_stories]
+gems = %w[merb_activerecord merb_helpers merb_sequel merb_param_protection merb_test_unit merb_stories]
-orm_gems = %w[merb_activerecord merb_datamapper merb_sequel]
+orm_gems = %w[merb_activerecord merb_sequel]
desc "Install it all"
task :install => "install:gems"
View
@@ -1,20 +0,0 @@
-Copyright (c) 2007 Jason Toy
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,10 +0,0 @@
-merb_datamapper
-=================
-
-A plugin for the Merb framework that provides DataMapper access
-
-To use sessions:
-1. set the session store to datamapper in merb.yml:
- :session_store: datamapper
-2. add the dependency in dependencies.rb:
- use_orm :datamapper
View
@@ -1,46 +0,0 @@
-require 'rubygems'
-require 'rake/gempackagetask'
-
-PLUGIN = "merb_datamapper"
-NAME = "merb_datamapper"
-VERSION = "0.9.3"
-AUTHOR = "Jason Toy"
-EMAIL = "jtoy@rubynow.com"
-HOMEPAGE = "http://merbivore.com"
-SUMMARY = "Merb plugin that provides DataMapper support for Merb"
-
-spec = Gem::Specification.new do |s|
- s.name = NAME
- s.version = VERSION
- s.platform = Gem::Platform::RUBY
- s.has_rdoc = true
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
- s.summary = SUMMARY
- s.description = s.summary
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
- s.add_dependency('merb-core', '>= 0.9.3')
- s.add_dependency('datamapper', '>= 0.2.3')
- s.require_path = 'lib'
- s.autorequire = PLUGIN
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,datamapper_generators}/**/*")
-end
-
-windows = (PLATFORM =~ /win32|cygwin/) rescue nil
-
-SUDO = windows ? "" : "sudo"
-
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
-end
-
-desc "Install merb_datamapper"
-task :install => :package do
- sh %{#{SUDO} gem install pkg/#{NAME}-#{VERSION} --no-rdoc --no-ri --no-update-sources}
-end
-
-desc 'Release the current version on rubyforge'
-task :release => :package do
- sh %{rubyforge add_release merb #{PLUGIN} #{VERSION} pkg/#{NAME}-#{VERSION}.gem}
-end
View
@@ -1,4 +0,0 @@
-TODO:
-Add proper migration support as soon as its released
-Fix session support
-finish rake tasks
@@ -1,5 +0,0 @@
-Description:
-
-
-Usage:
-
@@ -1,64 +0,0 @@
-# require 'merb'
-class MigrationGenerator < RubiGen::Base
-
- default_options :author => nil
-
- attr_reader :name
-
- def initialize(runtime_args, runtime_options = {})
- super
- usage if args.empty?
- @name = args.shift
- extract_options
- end
-
- def manifest
- unless @name
- puts banner
- exit 1
- end
- record do |m|
- # Ensure appropriate folder(s) exists
- m.directory 'schema/migrations'
-
- # Create stubs
- highest_migration = Dir[Dir.pwd+'/schema/migrations/*'].map{|f| File.basename(f) =~ /^(\d+)/; $1}.max
- filename = format("%03d_%s", (highest_migration.to_i+1), @name.snake_case)
- m.template "new_migration.erb", "schema/migrations/#{filename}.rb", :assigns => { :class_name => @name }
-
- end
- end
-
- protected
- def banner
- <<-EOS
-Creates a new migration for merb using DataMapper
-
-USAGE: #{$0} #{spec.name} NameOfMigration
-
-Example:
- #{$0} #{spec.name} AddPeople
-
- If you already have 3 migrations, this will create the AddPeople migration in
- schema/migration/004_add_people.rb
-EOS
- end
-
- def add_options!(opts)
- # opts.separator ''
- # opts.separator 'Options:'
- # For each option below, place the default
- # at the top of the file next to "default_options"
- # opts.on("-a", "--author=\"Your Name\"", String,
- # "Some comment about this option",
- # "Default: none") { |options[:author]| }
- # opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
- end
-
- def extract_options
- # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
- # Templates can access these value via the attr_reader-generated methods, but not the
- # raw instance variable value.
- # @author = options[:author]
- end
-end
@@ -1,7 +0,0 @@
-class <%= class_name.snake_case.camel_case %> < DataMapper::Migration
- def self.up
- end
-
- def self.down
- end
-end
@@ -1,38 +0,0 @@
-class ModelGenerator < Merb::GeneratorBase
- attr_reader :model_attributes, :model_class_name, :model_file_name
-
- def initialize(args, runtime_args = {})
- @base = File.dirname(__FILE__)
- super
- @model_file_name = args.shift.snake_case
- @model_class_name = @model_file_name.to_const_string
- @model_attributes = Hash[*(args.map{|a| a.split(":") }.flatten)]
- @model_file_name = "#{@model_class_name.snake_case}"
-
- end
-
- def manifest
- record do |m|
- @m = m
-
- @assigns = { :model_file_name => model_file_name,
- :model_attributes => model_attributes,
- :model_class_name => model_class_name
- }
- copy_dirs
- copy_files
-
- m.dependency "merb_model_test", [model_file_name], @assigns
- end
- end
-
- protected
- def banner
- <<-EOS.split("\n").map{|x| x.strip}.join("\n")
- Creates a Datamapper Model stub..
-
- USAGE: #{spec.name}"
- EOS
- end
-
-end
@@ -1,5 +0,0 @@
-class <%= model_class_name %> < DataMapper::Base
-<% model_attributes.each do |attr| -%>
- <%= "property :#{attr.first}, :#{attr.last}" %>
-<% end -%>
-end
@@ -1,74 +0,0 @@
-class ResourceControllerGenerator < Merb::GeneratorBase
-
- attr_reader :controller_class_name,
- :controller_file_name,
- :controller_base_path,
- :controller_modules,
- :model_class_name,
- :full_controller_const,
- :singular_model,
- :plural_model
-
- def initialize(args, runtime_args = {})
- @base = File.dirname(__FILE__)
-
- super
- name = args.shift
- nfp = name.snake_case.gsub("::", "/")
- nfp = nfp.split("/")
- @model_class_name = nfp.pop.singularize.to_const_string
- @model_class_name = runtime_args[:model_class_name] if runtime_args[:model_class_name]
- @singular_model = @model_class_name.snake_case
- @plural_model = @singular_model.pluralize
-
- nfp << @plural_model
-
- @controller_file_name = nfp.join("/")
-
- # Need to setup the directories
- unless @controller_file_name == File.basename(@controller_file_name)
- @controller_base_path = controller_file_name.split("/")[0..-2].join("/")
- end
-
- @controller_modules = @controller_file_name.to_const_string.split("::")[0..-2]
- @controller_class_name = @controller_file_name.to_const_string.split("::").last
-
- @full_controller_const = ((@controller_modules.dup || []) << @controller_class_name).join("::")
- end
-
- def manifest
- record do |m|
- @m = m
-
- # Create the controller directory
- m.directory File.join("app/controllers", controller_base_path) if controller_base_path
-
- # Create the helpers directory
- m.directory File.join("app/helpers", controller_base_path) if controller_base_path
-
- @assigns = {
- :controller_modules => controller_modules,
- :controller_class_name => controller_class_name,
- :controller_file_name => controller_file_name,
- :controller_base_path => controller_base_path,
- :full_controller_const => full_controller_const,
- :model_class_name => model_class_name,
- :singular_model => singular_model,
- :plural_model => plural_model
- }
- copy_dirs
- copy_files
-
- m.dependency "merb_resource_controller_test", [@controller_class_name], @assigns
- end
- end
-
- protected
- def banner
- <<-EOS.split("\n").map{|x| x.strip}.join("\n")
- Creates a basic Merb resource controller.
-
- USAGE: #{spec.name} my_resource
- EOS
- end
-end
@@ -1,68 +0,0 @@
-<% counter = 0 -%>
-<% controller_modules.each_with_index do |mod, i| -%>
-<%= " " * i %>module <%= mod %>
-<% counter = i -%>
-<% end -%>
-<% counter = counter == 0 ? 0 : (counter + 1) -%>
-<%= " " * counter %>class <%= controller_class_name %> < Application
-<%= " " * counter %> # provides :xml, :yaml, :js
-
-<%= " " * counter %> def index
-<%= " " * counter %> @<%= plural_model %> = <%= model_class_name %>.all
-<%= " " * counter %> display @<%= plural_model %>
-<%= " " * counter %> end
-
-<%= " " * counter %> def show
-<%= " " * counter %> @<%= singular_model %> = <%= model_class_name %>.first(params[:id])
-<%= " " * counter %> raise NotFound unless @<%= singular_model %>
-<%= " " * counter %> display @<%= singular_model %>
-<%= " " * counter %> end
-
-<%= " " * counter %> def new
-<%= " " * counter %> only_provides :html
-<%= " " * counter %> @<%= singular_model %> = <%= model_class_name %>.new
-<%= " " * counter %> render
-<%= " " * counter %> end
-
-<%= " " * counter %> def edit
-<%= " " * counter %> only_provides :html
-<%= " " * counter %> @<%= singular_model %> = <%= model_class_name %>.first(params[:id])
-<%= " " * counter %> raise NotFound unless @<%= singular_model %>
-<%= " " * counter %> render
-<%= " " * counter %> end
-
-<%= " " * counter %> def create
-<%= " " * counter %> @<%= singular_model %> = <%= model_class_name %>.new(params[:<%= singular_model %>])
-<%= " " * counter %> if @<%= singular_model %>.save
-<%= " " * counter %> redirect url(:<%= (controller_modules.collect{|m| m.downcase} << singular_model).join("_") %>, @<%= singular_model %>)
-<%= " " * counter %> else
-<%= " " * counter %> render :new
-<%= " " * counter %> end
-<%= " " * counter %> end
-
-<%= " " * counter %> def update
-<%= " " * counter %> @<%= singular_model %> = <%= model_class_name %>.first(params[:id])
-<%= " " * counter %> raise NotFound unless @<%= singular_model %>
-<%= " " * counter %> if @<%= singular_model %>.update_attributes(params[:<%= singular_model %>])
-<%= " " * counter %> redirect url(:<%= (controller_modules.collect{|m| m.downcase} << singular_model).join("_") %>, @<%= singular_model %>)
-<%= " " * counter %> else
-<%= " " * counter %> raise BadRequest
-<%= " " * counter %> end
-<%= " " * counter %> end
-
-<%= " " * counter %> def destroy
-<%= " " * counter %> @<%= singular_model %> = <%= model_class_name %>.first(params[:id])
-<%= " " * counter %> raise NotFound unless @<%= singular_model %>
-<%= " " * counter %> if @<%= singular_model %>.destroy!
-<%= " " * counter %> redirect url(:<%= (controller_modules.collect{|m| m.downcase} << singular_model).join("_") %>)
-<%= " " * counter %> else
-<%= " " * counter %> raise BadRequest
-<%= " " * counter %> end
-<%= " " * counter %> end
-
-<%= " " * counter %>end
-<% counter = counter == 0 ? 0 : (counter - 1) -%>
-<% controller_modules.reverse.each_with_index do |mod, i| -%>
-<%= " " * counter %>end # <%= mod %>
-<% counter = counter - 1 -%>
-<% end -%>
@@ -1,16 +0,0 @@
-<% counter = 1 -%>
-module Merb
-<% controller_modules.each_with_index do |mod, i| -%>
-<%= " " * i %>module <%= mod %>
-<% counter = i -%>
-<% end -%>
-<% counter = counter == 0 ? 0 : (counter + 1) -%>
-<%= " " * counter %>module <%= controller_class_name %>Helper
-
-<%= " " * counter %>end
-<% counter = counter == 0 ? 0 : (counter - 1) -%>
-<% controller_modules.reverse.each_with_index do |mod, i| -%>
-<%= " " * counter %>end # <%= mod %>
-<% counter = counter - 1 -%>
-<% end -%>
-end
@@ -1,3 +0,0 @@
-<h1><%= full_controller_const %> controller, edit action</h1>
-
-<p>Edit this file in <tt>app/views/<%= controller_file_name %>/edit.html.erb</tt></p>
@@ -1,3 +0,0 @@
-<h1><%= full_controller_const %> controller, index action</h1>
-
-<p>Edit this file in <tt>app/views/<%= controller_file_name %>/index.html.erb</tt></p>
Oops, something went wrong.

2 comments on commit 5159bb3

Where can we find the new plugin?

Collaborator

michaelklishin replied May 10, 2008

@jherdman

Look to sam/dm-more/merb_datamapper and use it like this:

use_orm :datamapper

This is now true for 0.9 :)

Please sign in to comment.