active_mocker 1.2.pre.9 → 1.2.pre.10

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: 45b9761bc197c76245e94949a8d83eef8cadda09
4
- data.tar.gz: 83aaf699ed9bb9afe879055470a8bb1f650fd9f1
3
+ metadata.gz: b4714d7ff79296aea01e1b4f408cded30243ba4f
4
+ data.tar.gz: 80a17102f27b2bebb21628e7047856fd91653096
5
5
  SHA512:
6
- metadata.gz: b9f48e3db7282327427d44d45564c3b7d32f82601130eca8abad7ae3c7d7ad57430691f2dcb4fe1a093c01dea5000ca611d2faada240d8411f0027b889dcf307
7
- data.tar.gz: c44db1fe886afcee86a70edb21ba1d47d703331e23a1d4a2a6ac1986d588375d6b6ec4d244ff3b5449d34fe53d9e976caf9afadfb3a06a1e9cb5116b9276c878
6
+ metadata.gz: e3257d142ee5150575d9ca0de79eb6c9bbe74570449867dd8a536d1dd62f0f9eaaceb06530bebb5b43741e150771b7641c7bc3942bdb9433e227cac857b64d32
7
+ data.tar.gz: e93ef0984489dc89ff11d52f8bc31e029433be6f6d0f11116a56d5ab77ebef6d0ad53b401f351a403d95143fb8d4d7450b4b49f1116ef7e48e59bf741be8ada1
@@ -0,0 +1,12 @@
1
+ module ActiveMocker
2
+
3
+ def self.class_exists?(class_name)
4
+ klass = Module.const_get(class_name)
5
+ return klass.is_a?(Class)
6
+ rescue NameError
7
+ return false
8
+ end
9
+
10
+ end
11
+
12
+
@@ -1,5 +1,5 @@
1
1
  require 'active_mocker/mock_requires'
2
- Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker::Generate.class_exists?("#{model_name}Mock")
2
+ Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker.class_exists?("#{model_name}Mock")
3
3
 
4
4
  class <%= class_name %> < ::ActiveHash::Base
5
5
  include ActiveMocker::ActiveHash::ARApi
@@ -1,3 +1,3 @@
1
1
  module ActiveMocker
2
- VERSION = "1.2.pre.9"
2
+ VERSION = "1.2.pre.10"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'active_mocker/mock_requires'
2
- Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker::Generate.class_exists?("#{model_name}Mock")
2
+ Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker.class_exists?("#{model_name}Mock")
3
3
 
4
4
  class MicropostMock < ::ActiveHash::Base
5
5
  include ActiveMocker::ActiveHash::ARApi
@@ -1,5 +1,5 @@
1
1
  require 'active_mocker/mock_requires'
2
- Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker::Generate.class_exists?("#{model_name}Mock")
2
+ Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker.class_exists?("#{model_name}Mock")
3
3
 
4
4
  class RelationshipMock < ::ActiveHash::Base
5
5
  include ActiveMocker::ActiveHash::ARApi
@@ -1,5 +1,5 @@
1
1
  require 'active_mocker/mock_requires'
2
- Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker::Generate.class_exists?("#{model_name}Mock")
2
+ Object.send(:remove_const, "#{model_name}Mock") if false && ActiveMocker.class_exists?("#{model_name}Mock")
3
3
 
4
4
  class UserMock < ::ActiveHash::Base
5
5
  include ActiveMocker::ActiveHash::ARApi
@@ -1,6 +1,6 @@
1
1
  require 'active_mocker/mock_requires'
2
2
 
3
- Object.send(:remove_const, 'UserMock') if class_exists? 'UserMock'
3
+ Object.send(:remove_const, 'UserMock') if ActiveMocker.class_exists? 'UserMock'
4
4
 
5
5
  class UserMock < ::ActiveHash::Base
6
6
  include ActiveMocker::ActiveHash::ARApi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_mocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.pre.9
4
+ version: 1.2.pre.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Zeisler
@@ -152,6 +152,7 @@ files:
152
152
  - lib/active_mocker/active_record/scope.rb
153
153
  - lib/active_mocker/active_record/unknown_class_method.rb
154
154
  - lib/active_mocker/active_record/unknown_module.rb
155
+ - lib/active_mocker/class_exists.rb
155
156
  - lib/active_mocker/collection_association.rb
156
157
  - lib/active_mocker/config.rb
157
158
  - lib/active_mocker/const_sets.rb