fencepost 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fencepost.rb +1 -0
- data/lib/fencepost/fencepost.rb +2 -2
- data/lib/fencepost/railtie.rb +10 -0
- data/lib/fencepost/version.rb +1 -1
- data/lib/generators/fencepost_config_generator.rb +9 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32aa88c58507d1b19b55a5f37499b9801e056f0a
|
4
|
+
data.tar.gz: cc0677ff01d5c093807e5eb60a5694dbc05ac08c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1e84a8cff07a1cbe154beed1fb8f5015fcec72934a6464cfa475dc0740bf47e9c374e8290d5ada8a5d04a90bc37d7c5a403037a0d27dc88fb8b45e2de4e24c5
|
7
|
+
data.tar.gz: 7682cb9853fa97d35cbc3399ae8c64fbc67261df3d69efc96c9b18a59da182e1c93ff67cbda37e62b20cc8c28e40d421d4a7385111176885f41e29d73fbe8476
|
data/lib/fencepost.rb
CHANGED
data/lib/fencepost/fencepost.rb
CHANGED
@@ -35,9 +35,9 @@ module Fencepost
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def ensure_models
|
38
|
-
Rails.application.eager_load!
|
39
38
|
klass = self.class
|
40
39
|
if ::Fencepost.configuration.dev_mode
|
40
|
+
Rails.application.eager_load!
|
41
41
|
klass.model_list = klass.generate_model_list
|
42
42
|
end
|
43
43
|
end
|
@@ -81,7 +81,7 @@ module Fencepost
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def self.always_forbidden_attributes
|
84
|
-
[:
|
84
|
+
[:created_at, :updated_at]
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.attribute_keys(model)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
module Fencepost
|
3
|
+
class Railtie < ::Rails::Railtie
|
4
|
+
config.after_initialize do
|
5
|
+
Rails.application.eager_load!
|
6
|
+
file_name = "#{Rails.root}/config/fencepost.yml"
|
7
|
+
Fencepost.model_list = YAML.load_file(file_name) if File.exists?(file_name)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/lib/fencepost/version.rb
CHANGED
@@ -3,12 +3,12 @@ require 'yaml'
|
|
3
3
|
class FencepostConfigGenerator < Rails::Generators::Base
|
4
4
|
def create_initializer_file
|
5
5
|
Rails.application.eager_load!
|
6
|
-
create_file "config/initializers/fencepost.rb",
|
7
|
-
|
6
|
+
create_file "config/initializers/fencepost.rb", config_contents
|
7
|
+
create_file "config/fencepost.yml", yaml_contents
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
<<-
|
10
|
+
def config_contents
|
11
|
+
<<-config
|
12
12
|
Rails.application.eager_load!
|
13
13
|
Fencepost.configure do |config|
|
14
14
|
# dev_mode true means that the Fencepost model_list is created every time
|
@@ -20,11 +20,12 @@ Fencepost.configure do |config|
|
|
20
20
|
# creating it from scratch every time)
|
21
21
|
config.dev_mode = false
|
22
22
|
end
|
23
|
-
|
24
|
-
|
23
|
+
config
|
24
|
+
end
|
25
|
+
|
26
|
+
def yaml_contents
|
27
|
+
<<-yaml
|
25
28
|
#{Fencepost::Fencepost.generate_model_list.to_yaml}
|
26
|
-
contents
|
27
|
-
)
|
28
29
|
yaml
|
29
30
|
end
|
30
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fencepost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Helm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/fencepost/configuration.rb
|
92
92
|
- lib/fencepost/fencepost.rb
|
93
93
|
- lib/fencepost/gate.rb
|
94
|
+
- lib/fencepost/railtie.rb
|
94
95
|
- lib/fencepost/version.rb
|
95
96
|
- lib/fencepost.rb
|
96
97
|
- lib/generators/fencepost_config_generator.rb
|