active_mocker 1.2.pre.6 → 1.2.pre.7

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: c7f3415a7c6d4afd5d48bd065aa392c1000204e3
4
- data.tar.gz: 3400e4350fd4ebad56df688996d423cf354e5a61
3
+ metadata.gz: 5c5ae070a394af78e5ef29cb2aca45e533a563d9
4
+ data.tar.gz: 43bd1f13cadc658c3cd239982ec0afac2366ea27
5
5
  SHA512:
6
- metadata.gz: 6388bf35664471b9704596dd8be5668425ca3cbc5e7d6f70f4d8959d3eec9d1e017b872656bea090cb0bb6002e9f97116cdf6750cdea18a39b38acabb1cf6fca
7
- data.tar.gz: 879eceeb2ae425f53aa88aa6ec8fcb31f289d5bf48b37c92f0cfdd4a30620b326692bc01fb32353e56ee3482bbf4dd93a5cc4019219c5a507b2495a0163d56bf
6
+ metadata.gz: bcbb42e246ec580c8d89715e517f76a30a6f0e956442f0a10237ee57655f56d78c53c151bfe0237c791f5e0a88eb01c73939aa873368a70eaab135c4119b0a3f
7
+ data.tar.gz: f79d2dd0efc6d711f4a7f2ac797a232c5418b066a14f079884567d108aea18c131fd299bc08808b862d19f141cf7f3db5bcdaa34b2b85906494e5545ebe740ee
@@ -25,21 +25,19 @@ class Generate
25
25
  load_mock(model_name, force_reload: force_reload)
26
26
  end
27
27
 
28
+ def self.class_exists?(class_name)
29
+ klass = Module.const_get(class_name)
30
+ return klass.is_a?(Class)
31
+ rescue NameError
32
+ return false
33
+ end
34
+
28
35
  def self.load_mock(model_name, force_reload: false)
29
- Object.send(:remove_const, model_name) if class_exists? model_name if force_reload
36
+ Object.send(:remove_const, model_name) if force_reload && class_exists?(model_name)
30
37
  load File.join(mock_dir, "#{model_name.tableize.singularize}_mock.rb")
31
38
  "#{model_name}Mock".constantize
32
39
  end
33
40
 
34
- def class_exists?(class_name)
35
- begin
36
- klass = Module.const_get(class_name)
37
- return klass.is_a?(Class)
38
- rescue NameError
39
- return false
40
- end
41
- end
42
-
43
41
  def model_definition(table)
44
42
  return @model_definition if @model_definition_table == table
45
43
  @model_definition_table = table
@@ -2,11 +2,4 @@ require 'active_mocker/collection_association'
2
2
  require 'active_mocker/mock_class_methods'
3
3
  require 'active_mocker/mock_instance_methods'
4
4
  require 'active_hash'
5
- require 'active_hash/ar_api'
6
-
7
- def class_exists?(class_name)
8
- klass = Module.const_get(class_name)
9
- return klass.is_a?(Class)
10
- rescue NameError
11
- return false
12
- end
5
+ require 'active_hash/ar_api'
@@ -1,3 +1,3 @@
1
1
  module ActiveMocker
2
- VERSION = "1.2.pre.6"
2
+ VERSION = "1.2.pre.7"
3
3
  end
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.6
4
+ version: 1.2.pre.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Zeisler