ccls-common_lib 1.4.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/lib/common_lib.rb +4 -1
- data/lib/common_lib/action_controller_extension/routing.rb +2 -1
- data/lib/common_lib/action_view_extension/base.rb +1 -1
- data/lib/common_lib/action_view_extension/form_builder.rb +1 -0
- data/lib/common_lib/active_record/base.rb +1 -1
- data/lib/common_lib/active_support_extension/pending.rb +2 -1
- data/lib/common_lib/engine.rb +9 -0
- data/lib/common_lib/railtie.rb +2 -2
- 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: 3ba43f8548fc4e50bb17c2f7cce4990d2863cc2d
|
4
|
+
data.tar.gz: 8abcfd6ff8049605454d8951db29b37fbdf3abef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5c2153aab51c048d49fbf225f4c142faec6513c19a5fee7329c4e924aae1bb096821a0bb7caf9e1df9f293c1649cb8c2bcbdb1649ceae4974fb831bc6a9dcc6
|
7
|
+
data.tar.gz: 46ec281c2a4f962b8347b46af658d24989c10865eb189f0a52f727eab73cba699d37c5e692646e39ace16ed1cc513c9604922069bd619f4bc2b406a50d7f50a8
|
data/README.rdoc
CHANGED
@@ -93,7 +93,7 @@ Or ...
|
|
93
93
|
== Testing
|
94
94
|
---
|
95
95
|
|
96
|
-
sudo /opt/local/share/mariadb/support-files/mysql.server start
|
96
|
+
sudo /opt/local/share/mariadb/support-files/mysql.server start
|
97
97
|
|
98
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
|
99
99
|
|
data/lib/common_lib.rb
CHANGED
@@ -18,7 +18,10 @@ require 'common_lib/action_view_extension'
|
|
18
18
|
|
19
19
|
|
20
20
|
# pretty much always as don't expect this to be used outside of a rails app
|
21
|
-
|
21
|
+
if defined?(Rails)
|
22
|
+
require 'common_lib/railtie'
|
23
|
+
require 'common_lib/engine'
|
24
|
+
end
|
22
25
|
|
23
26
|
|
24
27
|
|
@@ -8,7 +8,8 @@ module CommonLib::ActionControllerExtension::Routing
|
|
8
8
|
|
9
9
|
def assert_no_route(verb,action,args={})
|
10
10
|
test "#{brand}no route to #{verb} #{action} #{args.inspect}" do
|
11
|
-
assert_raise(ActionController::RoutingError){
|
11
|
+
# assert_raise(ActionController::RoutingError){ # rails 3
|
12
|
+
assert_raise(ActionController::UrlGenerationError){ # rails 4
|
12
13
|
send(verb,action,args)
|
13
14
|
}
|
14
15
|
end
|
@@ -229,7 +229,7 @@ module CommonLib::ActionViewExtension::Base
|
|
229
229
|
args.each do |javascript|
|
230
230
|
unless @javascripts.include?(javascript.to_s)
|
231
231
|
@javascripts.push(javascript.to_s)
|
232
|
-
content_for(:head,javascript_include_tag(javascript).to_s)
|
232
|
+
content_for(:head,javascript_include_tag(javascript, :type => 'text/javascript').to_s)
|
233
233
|
end
|
234
234
|
end
|
235
235
|
end
|
@@ -172,6 +172,7 @@ module CommonLib::ActionViewExtension::FormBuilder
|
|
172
172
|
|
173
173
|
s = self.label( method, label_text )
|
174
174
|
s << send(unwrapped_method_name,*args,&block)
|
175
|
+
|
175
176
|
# s << (( block )? block.call : '')
|
176
177
|
# s << (( block_given? )? @template.capture(&block) : '')
|
177
178
|
# the new way won't work with block_given?, but template.capture still does.
|
@@ -88,7 +88,7 @@ class ActiveRecord::Base
|
|
88
88
|
# Treats the class a bit like a Hash and
|
89
89
|
# searches for a record with a matching key.
|
90
90
|
def self.[](key)
|
91
|
-
self.acts_like_a_hash_memory[key.downcase.to_s] ||=
|
91
|
+
self.acts_like_a_hash_memory[key.to_s.downcase.to_s] ||=
|
92
92
|
where(self.arel_table[self.acts_like_a_hash_options[:key]].matches(key)).first
|
93
93
|
end
|
94
94
|
|
@@ -71,7 +71,8 @@ module ActiveSupport
|
|
71
71
|
|
72
72
|
# @@pending_cases << "#{$3} at #{$1}, line #{$2}"
|
73
73
|
# @@pending_cases << ["#{self.to_s} [#{$1}:#{$2}]",description]
|
74
|
-
@@pending_cases << [self.to_s,"[#{$1}:#{$2}]",description]
|
74
|
+
# @@pending_cases << [self.to_s,"[#{$1}:#{$2}]",description] # rails 3
|
75
|
+
@@pending_cases << ["#{self.method_name}(#{self.class})","[#{$1}:#{$2}]",description] # rails 4
|
75
76
|
|
76
77
|
# 1) Skipped:
|
77
78
|
#test_should_not_update_attribute_if_new_data_is_blank(BcInfoTest) [/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/pending.rb:15]:
|
data/lib/common_lib/railtie.rb
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
# I would be nice to share my locales as well
|
6
6
|
#
|
7
7
|
module CommonLib
|
8
|
-
require 'rails'
|
8
|
+
# require 'rails'
|
9
9
|
|
10
|
-
class Railtie < Rails::Railtie
|
10
|
+
class Railtie < ::Rails::Railtie
|
11
11
|
# initializer 'paperclip.insert_into_active_record' do |app|
|
12
12
|
# ActiveSupport.on_load :active_record do
|
13
13
|
# Paperclip::Railtie.insert
|
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
|
+
version: 4.0.0
|
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:
|
11
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: CCLS Common Lib gem
|
14
14
|
email: github@jakewendt.com
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- lib/common_lib/active_support_extension/attributes.rb
|
41
41
|
- lib/common_lib/active_support_extension/pending.rb
|
42
42
|
- lib/common_lib/active_support_extension/test_case.rb
|
43
|
+
- lib/common_lib/engine.rb
|
43
44
|
- lib/common_lib/railtie.rb
|
44
45
|
- lib/common_lib/ruby.rb
|
45
46
|
- lib/common_lib/ruby/array.rb
|