klops 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ ## <a name="Examples"></a>Examples
2
+ In your view files, you can use following:
3
+
4
+ copyright 'Kamil Wdowicz'
5
+
6
+ This will produce:
7
+
8
+ Copyright 2012 Kamil Wdowicz. All Rights Reserved.
9
+
10
+ In your view files, you can use following:
11
+
12
+ @current_action
13
+ @current_controller
14
+
15
+ This will produce:
16
+
17
+ index
18
+ pages
19
+
20
+ ## <a name="installation"></a>Installation
21
+ In your `Gemfile`, add the following:
22
+
23
+ gem 'klops'
24
+
25
+ Run:
26
+
27
+ $ bundle install
@@ -0,0 +1,13 @@
1
+ module Klops
2
+ module ActionAdditions
3
+
4
+ def self.included(base)
5
+ base.append_before_filter :instantiate_controller_and_action_names
6
+ end
7
+
8
+ def instantiate_controller_and_action_names
9
+ @current_action = action_name
10
+ @current_controller = controller_name
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'klops/view_helpers'
2
+ require 'klops/action_additions'
3
+
4
+ module Klops
5
+ class Railtie < Rails::Railtie
6
+ initializer "klops.view_helpers" do
7
+ ActionView::Base.send :include, ViewHelpers
8
+ end
9
+ initializer "klops.action_additions" do
10
+ ActionController::Base.send :include, ActionAdditions
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Klops
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -0,0 +1,11 @@
1
+ module Klops
2
+ module ViewHelpers
3
+ def copyright(author='')
4
+ if author != ''
5
+ "Copyright #{Time.now.year} #{author}. All Rights Reserved."
6
+ else
7
+ "Copyright #{Time.now.year}. All Rights Reserved."
8
+ end
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease: !!null
6
6
  platform: ruby
7
7
  authors:
@@ -21,10 +21,14 @@ extra_rdoc_files: []
21
21
  files:
22
22
  - .gitignore
23
23
  - Gemfile
24
+ - README.md
24
25
  - Rakefile
25
26
  - klops.gemspec
26
27
  - lib/klops.rb
28
+ - lib/klops/action_additions.rb
29
+ - lib/klops/railtie.rb
27
30
  - lib/klops/version.rb
31
+ - lib/klops/view_helpers.rb
28
32
  has_rdoc: true
29
33
  homepage: ''
30
34
  licenses: []