active_mocker 1.1.3 → 1.1.4

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: addb986f00f2c8a59ad022a22a1617214d46b058
4
- data.tar.gz: 9e77573e2e57c8bb14273c4715b2fd642e3022da
3
+ metadata.gz: 2a3268d9fa30c6109ba4c78ab54b492d0a8ef89e
4
+ data.tar.gz: b1ba4cf8f3f36aeb5a7fd9ed2c8adeba74658a81
5
5
  SHA512:
6
- metadata.gz: e40f73589ec2ea036b515fa33953515235be712e8793b90e3407387a0961a12fadacf81da5174b69c4709f715237f8c4e51fdf5a508892af31b2a4d63d445941
7
- data.tar.gz: a64603e11da45d5df1f6f86c1b95c37dd7274682f2fc8edce0d0425da415d7e0be837c59cdf664465a8eca69f9675cf59cb536b63f7a9681bfb84adbbb5f3693
6
+ metadata.gz: 8f3ef827652f153155be2d83947f10d256d2a7976bc12ca6fd0cc54985abe202a60ea3ce32a55b760576f8e5689e8c184d395f6c10dc4b5fb5926232085dae3a
7
+ data.tar.gz: df400dbb048cb3f4f5a5b92ea00423088156ceddf63f4c282e2a77ae07d0dcf1b8cb6a60e3be348189d0aff48c454019c0036b8deabfcb3e51f932cde6009733
@@ -3,6 +3,7 @@ require 'active_mocker/active_record/scope'
3
3
  require 'active_mocker/active_record/relationships'
4
4
  require 'active_mocker/active_record/unknown_class_method'
5
5
  require 'active_mocker/active_record/unknown_module'
6
+ require 'active_mocker/active_record/const_missing'
6
7
 
7
8
  module ActiveMocker
8
9
  module ActiveRecord
@@ -11,6 +12,7 @@ module ActiveMocker
11
12
  extend Relationships
12
13
  extend UnknownClassMethod
13
14
  extend UnknownModule
15
+ extend ConstMissing
14
16
  end
15
17
  end
16
18
  end
@@ -0,0 +1,7 @@
1
+ module ConstMissing
2
+
3
+ end
4
+
5
+ def Object.const_missing(name)
6
+ # Logger_.debug "ActiveMocker :: Can't can't find Constant #{name} from class #{}."
7
+ end
@@ -0,0 +1,24 @@
1
+ module ActiveMocker
2
+
3
+ class ConstSets
4
+
5
+ def initialize(string_of_consts, base_const=nil)
6
+
7
+ Object.const_set('Foo','Foo')
8
+
9
+
10
+ end
11
+
12
+ def self.const_exists?(class_name)
13
+ klass = Module.const_get(class_name)
14
+ return klass.is_a?(Class)
15
+ rescue NameError
16
+ return false
17
+ end
18
+
19
+ end
20
+
21
+ end
22
+
23
+
24
+
@@ -26,10 +26,11 @@ module ActiveMocker
26
26
  m = Module.new
27
27
  m.module_eval(read_file)
28
28
  rescue NameError => e
29
+ raise e
29
30
  result = e.to_s.scan /::(\w*)$/ # gets the Constant name from error
30
31
  const_name = result.flatten.first
31
32
  Logger_.debug "ActiveMocker :: Can't can't find Constant #{const_name} from class #{model_name}..\n #{caller}"
32
- Object.const_set(const_name,const_name)
33
+ # Object.const_set(const_name,const_name)
33
34
  next
34
35
  end
35
36
  failure = false
@@ -1,3 +1,3 @@
1
1
  module ActiveMocker
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -32,7 +32,7 @@ describe ActiveMocker::Base do
32
32
  #config.model_methods = true #default
33
33
  #config.mass_assignment = true #default
34
34
  # Logging
35
- config.log_level = Logger::DEBUG #default
35
+ config.log_level = Logger::WARN #default
36
36
  end
37
37
 
38
38
  end
@@ -124,7 +124,5 @@ describe ActiveMocker::ModelReader do
124
124
 
125
125
  end
126
126
 
127
- describe
128
-
129
127
  end
130
128
 
@@ -1,6 +1,9 @@
1
1
  class Model < ActiveRecord::Base
2
2
  include FooBar
3
3
  extend Baz
4
+
5
+ include ModelCore::PlanService::Dah
6
+
4
7
  belongs_to :company, class_name: 'PlanServiceCategory'
5
8
  has_many :users
6
9
  has_one :account
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.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Zeisler
@@ -116,6 +116,7 @@ files:
116
116
  - lib/active_hash/update.rb
117
117
  - lib/active_mocker.rb
118
118
  - lib/active_mocker/active_record.rb
119
+ - lib/active_mocker/active_record/const_missing.rb
119
120
  - lib/active_mocker/active_record/relationships.rb
120
121
  - lib/active_mocker/active_record/schema.rb
121
122
  - lib/active_mocker/active_record/scope.rb
@@ -123,6 +124,7 @@ files:
123
124
  - lib/active_mocker/active_record/unknown_module.rb
124
125
  - lib/active_mocker/base.rb
125
126
  - lib/active_mocker/config.rb
127
+ - lib/active_mocker/const_sets.rb
126
128
  - lib/active_mocker/field.rb
127
129
  - lib/active_mocker/logger.rb
128
130
  - lib/active_mocker/model_reader.rb