heading_with_title 0.0.4 → 0.0.5

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: 9fc73151e9379c8c01fdab6c2d80dffc7946acb9
4
- data.tar.gz: 1c245e36436d5049b2ef35347645c62e4f89c9d5
3
+ metadata.gz: 40b580dc1fea2a22d55478b1671954991b1117fe
4
+ data.tar.gz: ea2102d4d5ede2f86dbcf1d311cb98d1fa41b039
5
5
  SHA512:
6
- metadata.gz: 4572df0c090d19f2a10248ec1800349a60f06eafc5e2afbe68390d2f17caf8c225b17c55d7e80322f7df38ca49e746ec9b5d5c4445b96ce9feea7b69f7746578
7
- data.tar.gz: 4f91fa734f44968f30c44f2421f79702c73d6f040e041dec6e168c56947c49eae560263afdd29a461c402ec07d8bbe84fc1a4d9e65de25689a6ad1cb1de77ce6
6
+ metadata.gz: 0b37ac5bf339b284a2a2f51868eb162fd330657e44a94676a21bd1ae1ffed07f589894f0de6a53a797f098005b9632b3d2e08b848a58d86072d08caa9886a5a7
7
+ data.tar.gz: d541d05c819335f9994161385c71baff21f5dea3fefb62f99bbebbb03dddbed92754cf6c4dccea7d4bc7e8ad153b2cf7512f71dd98774c522b48f02c7e7957d1
data/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ ## Changelog
2
+
3
+ ### 0.0.5
4
+ * Bugfix: Fix incorrect block handling.
5
+
6
+ ### 0.0.4
7
+ * Improvement: Now heading_with_title accepts ActiveRecord model instances.
8
+
9
+ ### 0.0.3
10
+ * Bugfix: Fix Rails application name obtaining
11
+
12
+ ### 0.0.2
13
+ * Ability to call `heading_with_title` without arguments. It uses I18n translation in this case.
14
+ * Support for I18n interpolation.
data/README.md CHANGED
@@ -76,18 +76,6 @@ HeadingWithTitle.configure do |config|
76
76
  end
77
77
  ```
78
78
 
79
- ## Changelog
80
-
81
- ### 0.0.4
82
- * Improvement: Now heading_with_title accepts ActiveRecord model instances.
83
-
84
- ### 0.0.3
85
- * Bugfix: Fix Rails application name obtaining
86
-
87
- ### 0.0.2
88
- * Ability to call `heading_with_title` without arguments. It uses I18n translation in this case.
89
- * Support for I18n interpolation.
90
-
91
79
  ## License
92
80
 
93
81
  [The MIT License](https://github.com/tanraya/heading_with_title/blob/master/MIT-LICENSE)
@@ -28,7 +28,12 @@ module HeadingWithTitle
28
28
  end
29
29
 
30
30
  page_title(heading)
31
- heading = raw(block.call(heading)) if block_given?
31
+
32
+ if block_given?
33
+ content = capture(heading, &block)
34
+ heading = raw(content)
35
+ end
36
+
32
37
  content_tag(HeadingWithTitle.default_heading_size, heading)
33
38
  end
34
39
  end
@@ -1,3 +1,3 @@
1
1
  module HeadingWithTitle
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -13,6 +13,7 @@ end
13
13
  describe HeadingWithTitle::Helpers do
14
14
  include ActionView::Helpers
15
15
  include HeadingWithTitle::Helpers
16
+ include ActionView::Context
16
17
 
17
18
  before do
18
19
  Rails.stub_chain(:application, :class, :parent_name).and_return('AwesomeApp')
@@ -49,7 +50,7 @@ describe HeadingWithTitle::Helpers do
49
50
 
50
51
  it 'applies block' do
51
52
  result = heading_with_title 'Users' do |heading|
52
- "<span>" + heading + "</span>"
53
+ raw("<span>" + heading + "</span>")
53
54
  end
54
55
 
55
56
  result.should == '<h1><span>Users</span></h1>'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heading_with_title
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kozloff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-24 00:00:00.000000000 Z
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - .gitignore
91
+ - CHANGELOG.md
91
92
  - Gemfile
92
93
  - MIT-LICENSE.txt
93
94
  - README.md