rails_utils 3.3.0 → 3.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b74801dca81a0f37b7c7c1d437d11d968c48fb4
4
- data.tar.gz: 97ff2354d937ae47037a098f4ca27ac634fa4beb
3
+ metadata.gz: c3569698ba27aae3cdcd88cb1ed58fc1d1e251b4
4
+ data.tar.gz: 229ea1766631a6d548e0056809dcc2cb576554df
5
5
  SHA512:
6
- metadata.gz: 4d41c4c24a71d0c465fc8b59fe4e81d9b28cbbc898f92a63e28e910695763a98e9c8dfeeec3fb97638f9624b9eed7fefae5590f3f09bee9f4e4bd6a9ef97bb93
7
- data.tar.gz: 70a60df61784f419f58574a851a589bad462fb5c2ec558c232f01efe5e5426b1f56062f03f78c817e78655a8f01051ae097a369df0d1a9265321feda8db3424a
6
+ metadata.gz: c50136816341a8e4cb2a36b9338d08186a702e044e7ff3b19784ea74a03e7e5c437dcd3a3f5e278364587e568ae3c03dddc0760dd8157b8cc3d673472487a3e5
7
+ data.tar.gz: 3abd2f3ed1de45d30e1f303957c6a97bb99d7bc52a99b5976be5bdb0b1c02057929fba92ed0d2b35e3584f1c3e68b2573e43e8a9f5cded1c595838ed2d0ce05d
data/README.md CHANGED
@@ -125,6 +125,10 @@ Minitest-ed. To run all tests, just run `rake` or `rake test`.
125
125
 
126
126
  ## Changelog
127
127
 
128
+ _Version 3.3.1_
129
+
130
+ - [Pull Request 10](https://github.com/winston/rails_utils/pull/10) - Allow overiding of `default` for `page_title` - by @choonkeat.
131
+
128
132
  _Version 3.3.0_
129
133
 
130
134
  - [Pull Request 8](https://github.com/winston/rails_utils/pull/8) - Add `button_html` and `button_class` options for `flash_messages` - by @choonkeat.
@@ -1,3 +1,3 @@
1
1
  module RailsUtils
2
- VERSION = "3.3.0"
2
+ VERSION = "3.3.1"
3
3
  end
data/lib/rails_utils.rb CHANGED
@@ -17,7 +17,7 @@ module RailsUtils
17
17
 
18
18
  def page_title(options={})
19
19
  default_page_title = "#{page_controller_class.capitalize} #{page_action_class.capitalize}"
20
- i18n_options = { default: default_page_title }.reverse_merge!(options)
20
+ i18n_options = { default: default_page_title }.merge!(options)
21
21
  I18n.t("#{page_controller_class}.#{page_action_class}.title", i18n_options)
22
22
  end
23
23
 
@@ -85,9 +85,13 @@ describe "RailsUtils::ActionViewExtensions" do
85
85
  it "combines page_controller_class and page_action_class" do
86
86
  view.page_title.must_equal default_translation
87
87
  end
88
+
89
+ it "uses :default provided by gem user" do
90
+ view.page_title(default: 'my custom default').must_equal 'my custom default'
91
+ end
88
92
  end
89
93
 
90
- describe 'when translation is avaiable' do
94
+ describe 'when translation is available' do
91
95
  let(:action_name) { "show" }
92
96
 
93
97
  before { I18n.backend.store_translations("en", { controller_name.to_sym => { action_name.to_sym => { title: "An awesome title" } }}) }
@@ -97,7 +101,7 @@ describe "RailsUtils::ActionViewExtensions" do
97
101
  end
98
102
  end
99
103
 
100
- describe "when translation is avaiable + interpolations" do
104
+ describe "when translation is available + interpolations" do
101
105
  let(:action_name) { "show" }
102
106
 
103
107
  before { I18n.backend.store_translations("en", { controller_name.to_sym => { action_name.to_sym => { title: "An awesome title, %{name}" } }}) }
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.3.0
4
+ version: 3.3.1
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-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.4.2
132
+ rubygems_version: 2.2.2
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Rails helpers based on opinionated project practices.