heading_with_title 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +11 -0
- data/heading_with_title.gemspec +1 -0
- data/lib/heading_with_title/helpers.rb +2 -0
- data/lib/heading_with_title/version.rb +1 -1
- data/spec/heading_with_title/helpers_spec.rb +5 -0
- data/spec/support/active_record.rb +18 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fc73151e9379c8c01fdab6c2d80dffc7946acb9
|
4
|
+
data.tar.gz: 1c245e36436d5049b2ef35347645c62e4f89c9d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4572df0c090d19f2a10248ec1800349a60f06eafc5e2afbe68390d2f17caf8c225b17c55d7e80322f7df38ca49e746ec9b5d5c4445b96ce9feea7b69f7746578
|
7
|
+
data.tar.gz: 4f91fa734f44968f30c44f2421f79702c73d6f040e041dec6e168c56947c49eae560263afdd29a461c402ec07d8bbe84fc1a4d9e65de25689a6ad1cb1de77ce6
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -42,8 +42,12 @@ heading, or you call `page_title('Something')` to set page title without heading
|
|
42
42
|
# just pass hash as argument:
|
43
43
|
<%= heading_with_title username: 'John Doe' %>
|
44
44
|
|
45
|
+
# Also it accepts ActiveRecord model instance
|
46
|
+
<% heading_with_title Product.find(777) %>
|
47
|
+
|
45
48
|
# Or you might want to set only page title
|
46
49
|
<% page_title 'Users' %>
|
50
|
+
|
47
51
|
```
|
48
52
|
## Configuration
|
49
53
|
|
@@ -74,6 +78,9 @@ end
|
|
74
78
|
|
75
79
|
## Changelog
|
76
80
|
|
81
|
+
### 0.0.4
|
82
|
+
* Improvement: Now heading_with_title accepts ActiveRecord model instances.
|
83
|
+
|
77
84
|
### 0.0.3
|
78
85
|
* Bugfix: Fix Rails application name obtaining
|
79
86
|
|
@@ -84,3 +91,7 @@ end
|
|
84
91
|
## License
|
85
92
|
|
86
93
|
[The MIT License](https://github.com/tanraya/heading_with_title/blob/master/MIT-LICENSE)
|
94
|
+
|
95
|
+
|
96
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rocsci/heading_with_title/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
97
|
+
|
data/heading_with_title.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "heading_with_title"
|
3
|
+
require "support/active_record"
|
3
4
|
|
4
5
|
module HeadingWithTitle
|
5
6
|
module Helpers #:nodoc:
|
@@ -69,6 +70,10 @@ describe HeadingWithTitle::Helpers do
|
|
69
70
|
heading_with_title(name: 'John Doe').should == '<h1>Hello John Doe!</h1>'
|
70
71
|
end
|
71
72
|
|
73
|
+
it 'allows ActiveRecord instance' do
|
74
|
+
heading_with_title(Product.new).should == '<h1>Tasty Cakes</h1>'
|
75
|
+
end
|
76
|
+
|
72
77
|
it 'raises ArgumentError on incorrect arguments' do
|
73
78
|
expect { heading_with_title(OpenStruct.new(name: 'Weird')) }.to raise_error(ArgumentError, 'Incorrect arguments for heading_with_title!')
|
74
79
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "active_record"
|
2
|
+
|
3
|
+
ActiveRecord::Base.establish_connection(
|
4
|
+
adapter: 'sqlite3',
|
5
|
+
database: ':memory:'
|
6
|
+
)
|
7
|
+
|
8
|
+
ActiveRecord::Migration.create_table :products do |t|
|
9
|
+
t.string :name
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
class Product < ActiveRecord::Base
|
14
|
+
def to_s
|
15
|
+
'Tasty Cakes'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
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
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozloff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Setting the page heading at the same time with a page title
|
70
84
|
email:
|
71
85
|
- demerest@gmail.com
|
@@ -84,6 +98,7 @@ files:
|
|
84
98
|
- lib/heading_with_title/railtie.rb
|
85
99
|
- lib/heading_with_title/version.rb
|
86
100
|
- spec/heading_with_title/helpers_spec.rb
|
101
|
+
- spec/support/active_record.rb
|
87
102
|
homepage: https://github.com/rocsci/heading_with_title
|
88
103
|
licenses:
|
89
104
|
- MIT
|
@@ -110,3 +125,4 @@ specification_version: 4
|
|
110
125
|
summary: A set of helpers for Rails
|
111
126
|
test_files:
|
112
127
|
- spec/heading_with_title/helpers_spec.rb
|
128
|
+
- spec/support/active_record.rb
|