Skip to content

Commit f9d0dcb

Browse files
committed
Structure further solidified, Railtie initialization implemented
1 parent b08bfa2 commit f9d0dcb

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

cortex-snippets-client-ruby.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
1010
spec.email = ['[email protected]']
1111
spec.license = 'Apache-2.0'
1212

13-
spec.summary = %q{Provides loading of Cortex snippets for Rails and Sinatra applications}
13+
spec.summary = %q{Provides loading of Cortex snippets for Ruby applications, with some Rails ViewHelpers}
1414
spec.homepage = 'https://github.com/cortex-cms/cortex-snippets-client-ruby'
1515

1616
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }

lib/cortex/snippets/client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
require 'cortex/snippets/client/version'
2+
require 'cortex/snippets/client/view_helpers'
3+
require 'cortex/snippets/client/railtie' if defined?(Rails)
24

35
module Cortex
46
module Snippets
57
module Client
6-
# Your code goes here...
8+
79
end
810
end
911
end

lib/cortex/snippets/client/railtie.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Cortex
2+
module Snippets
3+
module Client
4+
class Railtie < Rails::Railtie
5+
initializer 'cortex.snippets.client.view_helpers' do
6+
ActiveSupport.on_load( :action_view ){ include ViewHelpers }
7+
end
8+
end
9+
end
10+
end
11+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Cortex
2+
module Snippets
3+
module Client
4+
module ViewHelpers
5+
6+
end
7+
end
8+
end
9+
end

0 commit comments

Comments
 (0)