title 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59409b794c1790c00f22f7b083e228c1fe8ad283
4
- data.tar.gz: 8a6e321565ca1e3f3225c9627c518b4d9a4b7cc0
3
+ metadata.gz: c92139dab0d7675c9d165439307253dbed3b6f95
4
+ data.tar.gz: 8411888a376953f5c105196d50f71956d2f7e0fc
5
5
  SHA512:
6
- metadata.gz: 0d2421d70c9b2c352dacf75987ab432f3b8b10efc7cf8cb0628ba861d0a4edf460de4e4ae3a592ffab21baaa09f48fee3d4907b9e7679c4de0d2ba048e13c5ba
7
- data.tar.gz: 7d2ab4a3ac91991c2a711300dac74de5436961520784204cfa76548c7e699f5684f93a3e6fb3324b73a5b13babe48a02efebc367b2c99329ce1383f96faa9638
6
+ metadata.gz: 7cc9664ea372a34c8bc58a86dabf331ebba79c1722eb8dd9820c4a46b25565633faa414bcc49a5412150e3dd351235b1ad71c9c86601132cfc94291200005fff
7
+ data.tar.gz: b53479e5742b2159da87703f6cb444c08d9b74ed11779b1ae2c0c4bede4bceee47c91488f7a42c1ccddf74955853050e2413bbd609a11797afcd4ee45f7f5e68
data/README.md CHANGED
@@ -13,6 +13,8 @@ Add to your translations:
13
13
  ```yaml
14
14
  en:
15
15
  titles:
16
+ # titles.application defaults to the sigficant portion of
17
+ # AppName::Application, which would be:
16
18
  application: AppName
17
19
  dashboards:
18
20
  show: Dashboard
@@ -8,7 +8,7 @@ module Title
8
8
  class PageTitle
9
9
  def initialize(controller_path, action_name, context)
10
10
  @controller_path = controller_path
11
- @action_name = action_name
11
+ @action_name = adjusted_action_name(action_name)
12
12
  @context = context
13
13
  end
14
14
 
@@ -48,6 +48,17 @@ module Title
48
48
  end
49
49
  defaults.reverse
50
50
  end
51
+
52
+ def adjusted_action_name(action_name)
53
+ case action_name
54
+ when 'create'
55
+ 'new'
56
+ when 'update'
57
+ 'edit'
58
+ else
59
+ action_name
60
+ end
61
+ end
51
62
  end
52
63
  end
53
64
  end
@@ -1,3 +1,3 @@
1
1
  module Title
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: title
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-06 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.2.2
151
+ rubygems_version: 2.5.1
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: I18n your <title>s