ccls-common_lib 4.0.0 → 4.0.1

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: 3ba43f8548fc4e50bb17c2f7cce4990d2863cc2d
4
- data.tar.gz: 8abcfd6ff8049605454d8951db29b37fbdf3abef
3
+ metadata.gz: 9c5934e4ece97a6567e092bd547b2ae3e44e7303
4
+ data.tar.gz: 26589f9dabf0336ef79fbb0655c2a3dca0955f5e
5
5
  SHA512:
6
- metadata.gz: b5c2153aab51c048d49fbf225f4c142faec6513c19a5fee7329c4e924aae1bb096821a0bb7caf9e1df9f293c1649cb8c2bcbdb1649ceae4974fb831bc6a9dcc6
7
- data.tar.gz: 46ec281c2a4f962b8347b46af658d24989c10865eb189f0a52f727eab73cba699d37c5e692646e39ace16ed1cc513c9604922069bd619f4bc2b406a50d7f50a8
6
+ metadata.gz: f67d10bd315d3516b0d68fe55e4b9143bb1973a94c75b80c349d4f5a2a8651453a73adbe59631176681a3391257ce54fcc3a84bd22bc714c686b42370718e51f
7
+ data.tar.gz: fdb94ec90840ac18c67b5e4f5a461654dc2f7838a883045ceab501b4939b98dd66340fe10315eea8d01169b06a092c507f440f4fd961d6901028d96ef6520ac6
data/README.rdoc CHANGED
@@ -95,7 +95,7 @@ Or ...
95
95
 
96
96
  sudo /opt/local/share/mariadb/support-files/mysql.server start
97
97
 
98
- c ; /bin/rm -rf coverage* ; bundle exec rake ; mv coverage coverage-one-run ; open coverage-one-run/index.html ; nice +20 bundle exec autotest
98
+ c ; /bin/rm -rf coverage* ; bundle exec rake ; mv coverage coverage-one-run ; open coverage-one-run/index.html ; nice +20 bundle exec autotest -v --no-full-after-failed
99
99
 
100
100
 
101
101
  ---
@@ -191,7 +191,8 @@ module CommonLib::ActionViewExtension::Base
191
191
 
192
192
  def aws_image_tag(image,options={})
193
193
  # in console @controller is nil
194
- protocol = @controller.try(:request).try(:protocol) || 'http://'
194
+ # rails 4 this seems to be controller not @controller now
195
+ protocol = controller.try(:request).try(:protocol) || 'http://'
195
196
  host = 's3.amazonaws.com/'
196
197
  # bucket = ( defined?(RAILS_APP_NAME) && RAILS_APP_NAME ) || 'ccls'
197
198
  bucket = ( defined?(RAILS_APP_NAME) && RAILS_APP_NAME ) ||
@@ -1,5 +1,26 @@
1
1
  class ActiveRecord::Base
2
2
 
3
+ # def self.inherited(subclass)
4
+ # subclass.class_eval do
5
+ # validation_file = File.join(Rails.root,"config/validations/#{self.to_s.underscore}.yml")
6
+ # if File.exists?(validation_file)
7
+ # h = YAML::load( ERB.new( IO.read( validation_file )).result)
8
+ #
9
+ # # if the yml file is empty, h is false ( added "if h" condition )
10
+ # h.each do |validation|
11
+ # attributes=[validation.delete(:attributes), validation.delete(:attribute)
12
+ # ].compact.flatten
13
+ # self.validates *attributes, validation
14
+ # end if h
15
+ # end
16
+ # end
17
+ # super
18
+ # end
19
+ #
20
+ # This will need some thought. Some of my models define things that are called
21
+ # from within these validations, so need to be defined first. Not sure how to do that.
22
+ #
23
+
3
24
  #
4
25
  # I have found that the validations are really cluttering up the models.
5
26
  # Moving them into a yml file and pulling them in like so seems to
@@ -20,6 +41,7 @@ class ActiveRecord::Base
20
41
  # I really like this and I may very well make it a default at some point.
21
42
  #
22
43
  def self.validations_from_yaml_file
44
+ # warn "validations_from_yaml_file is now a default from common_lib. You can remove the call from your model."
23
45
  validation_file = File.join(Rails.root,"config/validations/#{self.to_s.underscore}.yml")
24
46
  if File.exists?(validation_file)
25
47
  h = YAML::load( ERB.new( IO.read( validation_file )).result)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ccls-common_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - George 'Jake' Wendt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-18 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: CCLS Common Lib gem
14
14
  email: github@jakewendt.com