hancock_cms_goto 1.0.1.1 → 1.0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/hancock/goto/goto_helper.rb +18 -0
- data/hancock_cms_goto.gemspec +2 -2
- data/lib/generators/hancock/goto/config/templates/hancock_goto.erb +3 -3
- data/lib/generators/hancock/goto/models/decorators_generator.rb +1 -1
- data/lib/hancock/goto/configuration.rb +3 -3
- data/lib/hancock/goto/middleware.rb +6 -4
- data/lib/hancock/goto/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f956a9ac74f49b894820747722fb5ec59d717cb6
|
4
|
+
data.tar.gz: 974fd7186cd94d06b1a523e3afabeb017c0b1b88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d7f0dca2191629974d9a9cb33300f7aaa4b0ab49562ada7decb844b6e25af01b32c56e634cf40e0a9c4504534654f5b11e52626b6fa646a8f75633d8ec74ab
|
7
|
+
data.tar.gz: 419ce55f77fdc954df1c7f7221ce35da3a9c82d91cfb1ccfa806f640fbcf6c0d38f35a358414860bf6471f53d56c7e2a7589563c3e0edb81fb470b8948ca4a78
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Hancock::Goto::GotoHelper
|
2
|
+
|
3
|
+
def link_goto(name = nil, options = nil, html_options = nil, &block)
|
4
|
+
html_options, options, name = options, name, block if block_given?
|
5
|
+
options ||= {}
|
6
|
+
|
7
|
+
options.merge!({only_path: false}) if options.is_a?(Hash)
|
8
|
+
options = {controller: "hancock/goto/transfers", action: 'index', url: url_for(options)}
|
9
|
+
html_options.merge!({target: :_blank}) if html_options.is_a?(Hash)
|
10
|
+
|
11
|
+
if block_given?
|
12
|
+
link_to(options, html_options, &block)
|
13
|
+
else
|
14
|
+
link_to(name, options, html_options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/hancock_cms_goto.gemspec
CHANGED
@@ -30,9 +30,9 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.10"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
|
33
|
-
spec.add_dependency 'hancock_cms', [">=1.0", "<=2.1"]
|
33
|
+
spec.add_dependency 'hancock_cms', [">=1.0.1", "<=2.1"]
|
34
34
|
# spec.add_dependency 'hancock_cms', ["~> 1.0", "~> 2.1"]
|
35
|
-
|
35
|
+
|
36
36
|
spec.add_dependency 'nokogiri'
|
37
37
|
spec.add_dependency 'addressable'
|
38
38
|
end
|
@@ -10,7 +10,7 @@ Hancock::Goto.configure do |config|
|
|
10
10
|
# config.add_noopener = true
|
11
11
|
# config.del_attrs = true
|
12
12
|
|
13
|
-
# config.model_settings_support = defined?(RailsAdminModelSettings)
|
14
|
-
# config.user_abilities_support = defined?(RailsAdminUserAbilities)
|
15
|
-
# config.ra_comments_support = defined?(RailsAdminComments)
|
13
|
+
# config.model_settings_support = !!defined?(RailsAdminModelSettings)
|
14
|
+
# config.user_abilities_support = !!defined?(RailsAdminUserAbilities)
|
15
|
+
# config.ra_comments_support = !!defined?(RailsAdminComments)
|
16
16
|
end
|
@@ -12,7 +12,7 @@ module Hancock::Goto::Models
|
|
12
12
|
copied = true
|
13
13
|
copy_file "#{c}.rb", "app/models/concerns/hancock/goto/decorators/#{c}.rb"
|
14
14
|
end
|
15
|
-
puts "U need to set
|
15
|
+
puts "U need to set models`s name. One of this: #{permitted_models.join(", ")}." unless copied
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
@@ -37,9 +37,9 @@ module Hancock
|
|
37
37
|
@add_noopener = true
|
38
38
|
@del_attrs = true
|
39
39
|
|
40
|
-
@model_settings_support = defined?(RailsAdminModelSettings)
|
41
|
-
@user_abilities_support = defined?(RailsAdminUserAbilities)
|
42
|
-
@ra_comments_support = defined?(RailsAdminComments)
|
40
|
+
@model_settings_support = !!defined?(RailsAdminModelSettings)
|
41
|
+
@user_abilities_support = !!defined?(RailsAdminUserAbilities)
|
42
|
+
@ra_comments_support = !!defined?(RailsAdminComments)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -29,7 +29,7 @@ module Hancock::Goto
|
|
29
29
|
status, headers, response = @app.call(env)
|
30
30
|
headers = HeaderHash.new(headers)
|
31
31
|
|
32
|
-
if should_process?(status, headers)
|
32
|
+
if should_process?(status, headers, env)
|
33
33
|
begin
|
34
34
|
content = extract_content(response)
|
35
35
|
doc = ::Nokogiri::HTML(content)
|
@@ -68,9 +68,11 @@ module Hancock::Goto
|
|
68
68
|
end
|
69
69
|
|
70
70
|
private
|
71
|
-
def should_process?(status, headers)
|
72
|
-
|
73
|
-
|
71
|
+
def should_process?(status, headers, env)
|
72
|
+
cond = (env['hancock_goto_replace'].nil? || (env['hancock_goto_replace'] != false))
|
73
|
+
cond &&
|
74
|
+
!STATUS_WITH_NO_ENTITY_BODY.include?(status) &&
|
75
|
+
!headers['transfer-encoding'] &&
|
74
76
|
headers['content-type'] &&
|
75
77
|
headers['content-type'].include?('text/html')
|
76
78
|
end
|
data/lib/hancock/goto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hancock_cms_goto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1.
|
4
|
+
version: 1.0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kiseliev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.0.1
|
48
48
|
- - "<="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '2.1'
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
57
|
+
version: 1.0.1
|
58
58
|
- - "<="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '2.1'
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- Rakefile
|
104
104
|
- app/controllers/concerns/hancock/goto/decorators/transfers.rb
|
105
105
|
- app/controllers/hancock/goto/transfers_controller.rb
|
106
|
+
- app/helpers/hancock/goto/goto_helper.rb
|
106
107
|
- app/models/concerns/hancock/goto/decorators/transfer.rb
|
107
108
|
- app/models/hancock/goto/transfer.rb
|
108
109
|
- bin/console
|