rails_utils 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +5 -0
- data/lib/rails_utils.rb +1 -1
- data/lib/rails_utils/version.rb +1 -1
- data/test/rails_utils_test.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9535e78db4cb9484af2b6a0d792ac14c42fbfb01
|
4
|
+
data.tar.gz: 0d23784ec670c813f138f54d6e41a73516bc39d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dee0d5b4e3f0a9352292f18b99f2172d697ae616bcfb2da8c139b2ec2bfd8dc6f729ca5d9040baa58c55ba38709271df5909ba5bfd8ca2a051ac6f2e2d18562b
|
7
|
+
data.tar.gz: 80bb0e8845afffd488adac1c67444f5e9cf355b6c37c5e74891abcf516caa40b02e9c0ad0cfe2947ba0f9bd4e7e034c29875862c5614fa9e1bb6989801e4a14a
|
data/README.markdown
CHANGED
@@ -95,6 +95,11 @@ Minitest-ed. To run all tests, just run `rake` or `rake test`.
|
|
95
95
|
|
96
96
|
## Changelog
|
97
97
|
|
98
|
+
_Version 3.1.0_
|
99
|
+
|
100
|
+
- Drop string `controller` from `page_class` and `javascript_initialization`.
|
101
|
+
|
102
|
+
|
98
103
|
_Version 3.0.0_
|
99
104
|
|
100
105
|
- Controller namespace added to `page_class` and `javascript_initialization`.
|
data/lib/rails_utils.rb
CHANGED
@@ -3,7 +3,7 @@ require 'action_view'
|
|
3
3
|
module RailsUtils
|
4
4
|
module ActionViewExtensions
|
5
5
|
def page_controller_class
|
6
|
-
controller.class.to_s.
|
6
|
+
controller.class.to_s.sub(/Controller$/, "").underscore.sub(/\//, "_")
|
7
7
|
end
|
8
8
|
|
9
9
|
def page_action_class
|
data/lib/rails_utils/version.rb
CHANGED
data/test/rails_utils_test.rb
CHANGED
@@ -12,7 +12,7 @@ describe "RailsUtils::ActionViewExtensions" do
|
|
12
12
|
|
13
13
|
describe "#page_controller_class" do
|
14
14
|
describe "simple controller" do
|
15
|
-
let(:controller_class) { "
|
15
|
+
let(:controller_class) { "AnimeController" }
|
16
16
|
let(:controller_name) { "anime" }
|
17
17
|
|
18
18
|
before { controller.stubs(:class).returns(controller_class) }
|
@@ -23,7 +23,7 @@ describe "RailsUtils::ActionViewExtensions" do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "simple controller" do
|
26
|
-
let(:controller_class) { "Awesome::
|
26
|
+
let(:controller_class) { "Awesome::AnimeController" }
|
27
27
|
let(:controller_name) { "awesome_anime" }
|
28
28
|
|
29
29
|
before { controller.stubs(:class).returns(controller_class) }
|
@@ -71,7 +71,7 @@ describe "RailsUtils::ActionViewExtensions" do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
describe "#javascript_initialization" do
|
74
|
-
let(:controller_class) { "Awesome::
|
74
|
+
let(:controller_class) { "Awesome::AnimeController" }
|
75
75
|
let(:controller_name) { "awesome_anime" }
|
76
76
|
|
77
77
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Winston Teo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|