showcase 0.2.2 → 0.2.3

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: 2793f52eea58c519b380e4a3e87c7ec768d195c1
4
- data.tar.gz: c6c9a09255338c9f737fc2cd4ceb6b9213dbc011
3
+ metadata.gz: cccbdfb7ba5759b986763285e2422936225cf046
4
+ data.tar.gz: 9bffcb849bd62807722a63c331ad930b1c0a2cb1
5
5
  SHA512:
6
- metadata.gz: 0c4d859554d4c99b6b10078328057d90a51993ea4719f680d4f81bed35ecd0a702629d97bb558cb41a03a54c4a36769bc73c5b988d51ad99a9f98a770d53d133
7
- data.tar.gz: ff084a8d82002aab84dfa4ae740736e39808de657f8d71c804709679d3518cfa17a172e9d97b2fd5de29c785053f31c8cb5e7681bd05f06b2fbd9ff3439e2917
6
+ metadata.gz: fc96a5341cb344161b6108f53f147372f1d2ca8728fb064b1e2cd114f9f52572b9b01564a07d61c053c0570070d81f9966f17896be2b1b6f2cd2d93635246881
7
+ data.tar.gz: fbc674738a76c3f4bfc4355813279eee086b24b4b8a61fb646e2fbd47bb75cf37246026964c8e572b6a2c10b113d09e82f05f5a91edaa54a19960dfa0b7a0561
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ # Version 0.2.3
2
+
3
+ * Fix missing namespace in HtmlOptions and FirstNonblank helpers
4
+
data/README.md CHANGED
@@ -132,7 +132,7 @@ Super useful in acceptance testing to check the presence of a record inside a
132
132
  view:
133
133
 
134
134
  ```erb
135
- <% present(@project, class: 'big').box do %>
135
+ <% present(@project).box(class: 'big') do %>
136
136
  <p>Hi there!</p>
137
137
  <% end %>
138
138
  ```
@@ -1,6 +1,10 @@
1
- class FirstNonBlank
2
- def self.find(values)
3
- Array(values).find(&:presence)
1
+ module Showcase
2
+ module Helpers
3
+ class FirstNonBlank
4
+ def self.find(values)
5
+ Array(values).find(&:presence)
6
+ end
7
+ end
4
8
  end
5
9
  end
6
10
 
@@ -1,22 +1,26 @@
1
- class HtmlOptions
2
- def initialize(options = {})
3
- @options = (options || {}).symbolize_keys
4
- end
1
+ module Showcase
2
+ module Helpers
3
+ class HtmlOptions
4
+ def initialize(options = {})
5
+ @options = (options || {}).symbolize_keys
6
+ end
5
7
 
6
- def add_class!(css_class)
7
- @options[:class] ||= ""
8
- css_classes = @options[:class].split(/\s+/)
9
- css_classes << css_class
10
- @options[:class] = css_classes.join(" ")
11
- end
8
+ def add_class!(css_class)
9
+ @options[:class] ||= ""
10
+ css_classes = @options[:class].split(/\s+/)
11
+ css_classes << css_class
12
+ @options[:class] = css_classes.join(" ")
13
+ end
12
14
 
13
- def merge_attrs!(options = {})
14
- options = (options || {}).symbolize_keys
15
- @options.merge!(options)
16
- end
15
+ def merge_attrs!(options = {})
16
+ options = (options || {}).symbolize_keys
17
+ @options.merge!(options)
18
+ end
17
19
 
18
- def to_h
19
- @options.dup
20
+ def to_h
21
+ @options.dup
22
+ end
23
+ end
20
24
  end
21
25
  end
22
26
 
@@ -10,7 +10,7 @@ module Showcase
10
10
  end
11
11
 
12
12
  def title(values, options = {})
13
- title = FirstNonBlank.find(values)
13
+ title = Helpers::FirstNonBlank.find(values)
14
14
  title += options[:title_suffix] if options[:title_suffix]
15
15
 
16
16
  context.content_tag(:title, title) <<
@@ -60,7 +60,7 @@ module Showcase
60
60
  private
61
61
 
62
62
  def seo_meta_tags(*args)
63
- value = FirstNonBlank.find(args.pop)
63
+ value = Helpers::FirstNonBlank.find(args.pop)
64
64
 
65
65
  return nil unless value.present?
66
66
 
@@ -27,7 +27,7 @@ module Showcase
27
27
  options.delete(:active_class)
28
28
  end
29
29
 
30
- html_options = HtmlOptions.new(config.html_options)
30
+ html_options = Helpers::HtmlOptions.new(config.html_options)
31
31
  html_options.merge_attrs!(options)
32
32
  html_options.add_class!(active_class || config.active_class || 'active') if config.active
33
33
 
@@ -33,7 +33,7 @@ module Showcase
33
33
  {}
34
34
  end
35
35
 
36
- html_options = HtmlOptions.new(config_options)
36
+ html_options = Helpers::HtmlOptions.new(config_options)
37
37
  html_options.merge_attrs!(options)
38
38
  html_options.add_class!(dom_class)
39
39
  html_options.merge_attrs!(id: dom_id)
@@ -47,7 +47,7 @@ module Showcase
47
47
  params = Hash[
48
48
  settings[:params].map do |param, meta_key|
49
49
  values = [:"#{social}_#{meta_key}", meta_key].map do |key|
50
- FirstNonBlank.find(meta.send(key))
50
+ Helpers::FirstNonBlank.find(meta.send(key))
51
51
  end
52
52
  [ param, values.find(&:presence) ]
53
53
  end
@@ -1,4 +1,4 @@
1
1
  module Showcase
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showcase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-05 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -91,6 +91,7 @@ files:
91
91
  - .rspec
92
92
  - .travis.yml
93
93
  - Appraisals
94
+ - CHANGELOG.md
94
95
  - Gemfile
95
96
  - LICENSE.txt
96
97
  - README.md
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  version: '0'
149
150
  requirements: []
150
151
  rubyforge_project:
151
- rubygems_version: 2.0.14
152
+ rubygems_version: 2.2.2
152
153
  signing_key:
153
154
  specification_version: 4
154
155
  summary: A barebone and framework agnostic presenter implementation