semantic_id 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/semantic_id.rb +4 -18
- data/lib/semantic_id/version.rb +1 -1
- metadata +4 -4
data/lib/semantic_id.rb
CHANGED
@@ -1,20 +1,6 @@
|
|
1
|
-
require 'semantic_id/
|
2
|
-
|
3
|
-
module ::ActionView::Helpers::TextHelper
|
4
|
-
|
5
|
-
def semantic_id
|
6
|
-
string = String.new
|
7
|
-
|
8
|
-
case
|
9
|
-
when controller.action_name =~ /new|edit/
|
10
|
-
string += controller.action_name + "_"
|
11
|
-
when controller.action_name =~ /index|create/
|
12
|
-
string += controller.controller_name
|
13
|
-
else
|
14
|
-
string += controller.controller_name.singularize
|
15
|
-
end
|
16
|
-
|
17
|
-
string += "_view"
|
18
|
-
end
|
1
|
+
require 'semantic_id/helper'
|
2
|
+
require 'rails'
|
19
3
|
|
4
|
+
ActiveSupport.on_load(:action_view) do
|
5
|
+
include SemanticId::Helper
|
20
6
|
end
|
data/lib/semantic_id/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-07-14 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2155796020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2155796020
|
25
25
|
description: Semantic_ID is a very simple helper that creates a view-specific semantic
|
26
26
|
selector string following the same convention as the Rails Route Helpers. IE, the
|
27
27
|
ExamplesController#Index view would return "examples_view".
|