h2ocube_rails_helper 0.0.15 → 0.0.16

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: cb9cdfd52a86668d433fa7d3e80189feba6e0c5c
4
- data.tar.gz: c3b982ebf734bb70b06f42580ab3574f18cd6fd7
3
+ metadata.gz: d6346f74f2f95a7d17d06881352fe5eb1b187a8f
4
+ data.tar.gz: ac1947c454d034146e3767acd706f4de4a8320dd
5
5
  SHA512:
6
- metadata.gz: 431bff8e9411ab8b5bd36e56f0bf735645c07927e6b371edd6023ff6b6cebe9da27f7b1c23b385bfa37fbdc30e94809c5ae92b84bf4a9259997cede7455ae086
7
- data.tar.gz: 141064df285a3b08e3a133e3eda7a394aaf29172054f6a8d503926fad08a85b731d20a0c47b5ad461ef31341432fb3afccbf703df9bb731fddef91c09636d61b
6
+ metadata.gz: c79e6db11803c7e4e3c1783afeacd6df37730567a5f06d0f5d40b281caf947f0df021036cfb5d8a18842c4f76a97049988909d18830600565cc60675f1327c68
7
+ data.tar.gz: f59b0f35fcdf60dac4c6146ed63b48ecea9f1cd431510153b0955fe045ea9fbd64ed7b0d1793ae745181ade9fa6977496ad8b6e4be4c896f1f426fece55a9f56
data/.travis.yml CHANGED
@@ -2,4 +2,5 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.0
5
6
  script: "bundle exec rake test"
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'h2ocube_rails_helper'
7
- gem.version = '0.0.15'
7
+ gem.version = '0.0.16'
8
8
  gem.authors = ['Ben']
9
9
  gem.email = ['ben@h2ocube.com']
10
10
  gem.description = %q{Just an helper collection}
@@ -38,16 +38,14 @@ end
38
38
  def _title opts = {}
39
39
  return [@_title] if defined?(@_title)
40
40
  if defined?(@title)
41
- title = @title.class.to_s == 'Array' ? @title : [ @title.to_s.strip ]
41
+ title = @title.is_a?(Array) ? @title : [ @title.to_s ]
42
42
  else
43
- if defined?(@item)
44
- if @item.respond_to?(:title) && !@item.title.blank?
45
- title = @item.title
46
- end
43
+ if defined?(resource)
44
+ title = [resource.title, resource.class.model_name.human] if resource.respond_to?(:title) && resource.class.respond_to?(:model_name)
47
45
  end
48
46
  title ||= []
49
47
  end
50
- title = [ title ] if title.class.to_s != 'Array'
48
+
51
49
  if opts.has_key? :title
52
50
  title.push opts[:title]
53
51
  else
@@ -49,7 +49,7 @@ class RenderHtmlClass < ActionView::TestCase
49
49
  assert cls.include?('action')
50
50
  assert cls.include?('controller_action')
51
51
  assert cls.include?('mobile')
52
- assert cls.include?('iPad')
52
+ assert cls.include?('iphone')
53
53
  end
54
54
 
55
55
  def params
@@ -2,6 +2,9 @@ require 'test_helper'
2
2
 
3
3
  class RenderTitleClass < ActionView::TestCase
4
4
  test 'simple' do
5
+ self.class_eval do
6
+ undef_method :resource
7
+ end
5
8
  assert_equal render_title, '<title>title</title>'
6
9
  end
7
10
 
@@ -12,9 +15,12 @@ class RenderTitleClass < ActionView::TestCase
12
15
  assert_equal render_title, '<title>@title - title</title>'
13
16
  end
14
17
 
15
- test '@item' do
16
- @item = Item.new
17
- assert_equal render_title, '<title>item_title - title</title>'
18
+ test 'resource' do
19
+ def resource
20
+ Resource.new
21
+ end
22
+
23
+ assert_equal render_title, '<title>Resource Name - Class Name - title</title>'
18
24
  end
19
25
 
20
26
  test '@_title' do
@@ -33,8 +39,18 @@ class HelperSettings
33
39
  end
34
40
  end
35
41
 
36
- class Item
42
+ class ResourceModelName
43
+ def human
44
+ 'Class Name'
45
+ end
46
+ end
47
+
48
+ class Resource
37
49
  def title
38
- 'item_title'
50
+ 'Resource Name'
51
+ end
52
+
53
+ def self.model_name
54
+ ResourceModelName.new
39
55
  end
40
56
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: h2ocube_rails_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-26 00:00:00.000000000 Z
11
+ date: 2014-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: settingslogic
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: browser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Just an helper collection
@@ -45,8 +45,8 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
49
- - .travis.yml
48
+ - ".gitignore"
49
+ - ".travis.yml"
50
50
  - Gemfile
51
51
  - LICENSE.txt
52
52
  - README.md
@@ -93,17 +93,17 @@ require_paths:
93
93
  - lib
94
94
  required_ruby_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.0.5
106
+ rubygems_version: 2.2.1
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Just an helper collection