Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Renamed to modest_model to prevent conflict with an existing simple_m…

…odel gem
  • Loading branch information...
commit d7ae34d73d048c6ec31eaa9c25652a14e8ba8465 1 parent 3c0e013
Mike Fulcher authored
2  Rakefile
@@ -15,7 +15,7 @@ end
15 15
16 16 RDoc::Task.new(:rdoc) do |rdoc|
17 17 rdoc.rdoc_dir = 'rdoc'
18   - rdoc.title = 'SimpleModel'
  18 + rdoc.title = 'ModestModel'
19 19 rdoc.options << '--line-numbers'
20 20 rdoc.rdoc_files.include('README.md')
21 21 rdoc.rdoc_files.include('lib/**/*.rb')
4 lib/model_model.rb
... ... @@ -0,0 +1,4 @@
  1 +module ModestModel
  2 + autoload :Base, 'modest_model/base'
  3 + autoload :Validators, 'modest_model/validators'
  4 +end
4 lib/simple_model/base.rb → lib/modest_model/base.rb
... ... @@ -1,4 +1,4 @@
1   -module SimpleModel
  1 +module ModestModel
2 2 class Base
3 3 include ActiveModel::Conversion
4 4 extend ActiveModel::Naming
@@ -6,7 +6,7 @@ class Base
6 6 include ActiveModel::Validations
7 7 include ActiveModel::AttributeMethods
8 8
9   - include SimpleModel::Validators
  9 + include ModestModel::Validators
10 10
11 11 def initialize(attributes = {})
12 12 attributes.each do |attr, value|
2  lib/simple_model/validators.rb → lib/modest_model/validators.rb
... ... @@ -1,4 +1,4 @@
1   -module SimpleModel
  1 +module ModestModel
2 2 module Validators
3 3 class AbsenceValidator < ActiveModel::EachValidator
4 4 def validate_each(record, attribute, value)
4 lib/simple_model.rb
... ... @@ -1,4 +0,0 @@
1   -module SimpleModel
2   - autoload :Base, 'simple_model/base'
3   - autoload :Validators, 'simple_model/validators'
4   -end
4 lib/tasks/simple_model_tasks.rake
... ... @@ -1,4 +0,0 @@
1   -# desc "Explaining what the task does"
2   -# task :simple_model do
3   -# # Task goes here
4   -# end
6 simple_model.gemspec → modest_model.gemspec
... ... @@ -1,8 +1,8 @@
1 1 Gem::Specification.new do |s|
2   - s.name = "simple_model"
  2 + s.name = "modest_model"
3 3 s.authors = ["Mike Fulcher"]
4   - s.summary = "Simple, ActiveModel-compliant models"
5   - s.description = "Simple, ActiveModel-compliant models. Like Structs, but better!"
  4 + s.summary = "Simple, tableless ActiveModel-compliant models"
  5 + s.description = "Simple, tableless ActiveModel-compliant models. Like ActiveRecord models without the database."
6 6 s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
7 7 s.test_files = Dir["test/**/*"]
8 8 s.version = "0.0.1"
2  test/dummy/config/application.rb
@@ -3,7 +3,7 @@
3 3 require 'rails/all'
4 4
5 5 Bundler.require
6   -require "simple_model"
  6 +require "modest_model"
7 7
8 8 module Dummy
9 9 class Application < Rails::Application
2  test/fixtures/sample_model.rb
... ... @@ -1,4 +1,4 @@
1   -class SampleModel < SimpleModel::Base
  1 +class SampleModel < ModestModel::Base
2 2 attributes :name, :email
3 3 attributes :nickname
4 4 validates :nickname, :absence => true
2  test/simple_model_test.rb → test/modest_model_test.rb
... ... @@ -1,7 +1,7 @@
1 1 require 'test_helper'
2 2 require 'fixtures/sample_model'
3 3
4   -class SimpleModelTest < ActiveSupport::TestCase
  4 +class ModestModelTest < ActiveSupport::TestCase
5 5 test "validates absence of nickname" do
6 6 sample = SampleModel.new(:nickname => "Spam")
7 7 assert !sample.valid?

0 comments on commit d7ae34d

Please sign in to comment.
Something went wrong with that request. Please try again.