forged_model 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb204a9f577830f252c3dc65d22af04b712679dc
4
- data.tar.gz: 95b06993ad876c18bd8c08dcea522bbfdd48b007
3
+ metadata.gz: 47ba5b732181bc27cee18637a46a6854f1ca8ecc
4
+ data.tar.gz: 4a79b8a2676a71fe111fc4b538b7efe29d0efaa5
5
5
  SHA512:
6
- metadata.gz: e57117ccbeebcc46452d0f3ec021ee680281d940ab0930bd9170c56d6041fb3f0e01aa8a18b39d21f7f6bf9661ac76bb59012013f72270d64f38d1f8387eb8df
7
- data.tar.gz: 078ad3686359c81f64dcf2aef29d92991f48f612da192cd742a0faf25cac068b4bc0b4836ca600b4ce2aa6e352e2308bb292a8eebd15c0cefa4ac9d0fc7e8e92
6
+ metadata.gz: b620b5240e310329a9205af735a0c7e907ac0c318bc81f4e5fe2d4a42b931b032ed9385ead0145a8f137623fcd0a6f1f58f3a512dd39804d4a9787a64af879c1
7
+ data.tar.gz: 34420d0f87c91f238086fcb668f75403830cf9c8e14d6f48f713f3610d7a6c4addab2bddff02ba43085607b3f95171627a5944dc913b0478fdcada34477a3566
data/README.md CHANGED
@@ -9,7 +9,7 @@ Adds a generator for instance attributes.
9
9
 
10
10
  Add this line to your application's Gemfile:
11
11
 
12
- gem 'fake_model'
12
+ gem 'forged_model'
13
13
 
14
14
  And then execute:
15
15
 
@@ -17,7 +17,7 @@ And then execute:
17
17
 
18
18
  Or install it yourself as:
19
19
 
20
- $ gem install fake_model
20
+ $ gem install forged_model
21
21
 
22
22
  ## Usage
23
23
 
data/forged_model.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "activemodel", "~> 4.0"
21
+ spec.add_dependency "activemodel", "~> 4.0", ">= 3.2"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
@@ -0,0 +1,25 @@
1
+ module ActiveModel
2
+ module Model
3
+
4
+ def self.included(base) #:nodoc:
5
+ base.class_eval do
6
+ extend ActiveModel::Naming
7
+ extend ActiveModel::Translation
8
+ include ActiveModel::Validations
9
+ include ActiveModel::Conversion
10
+ end
11
+ end
12
+
13
+ def initialize(params={})
14
+ params.each do |attr, value|
15
+ self.public_send("#{attr}=", value)
16
+ end if params
17
+ super()
18
+ end
19
+
20
+ def persisted?
21
+ false
22
+ end
23
+
24
+ end
25
+ end
@@ -1,4 +1,5 @@
1
1
  require "active_model"
2
+ require "active_model/model" if ActiveModel::VERSION::MAJOR < 4
2
3
 
3
4
  module ForgedModel
4
5
  class Model
@@ -22,7 +23,7 @@ module ForgedModel
22
23
  end
23
24
  EOS
24
25
  end
25
- define_attribute_methods *methods
26
+ define_attribute_methods methods
26
27
  end
27
28
 
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module ForgedModel
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forged_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Munteanu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: '3.2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '4.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '3.2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -82,6 +88,7 @@ files:
82
88
  - README.md
83
89
  - Rakefile
84
90
  - forged_model.gemspec
91
+ - lib/active_model/model.rb
85
92
  - lib/forged_model.rb
86
93
  - lib/forged_model/model.rb
87
94
  - lib/forged_model/version.rb