burgundy 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4295b2c824c87c0092cbb3e80951774e4569e2a5
4
- data.tar.gz: b76378908e014558208eb0d0bfd1f38341718f73
3
+ metadata.gz: f7c3874c398cc2ab2ef4400629e242daead00ec7
4
+ data.tar.gz: 64871202971ab0a7570437edb627692d23a0743d
5
5
  SHA512:
6
- metadata.gz: cc96e010f0b3a4f3537a8f026b9040b39d200c5a9ee42d2a32344b62ab72fc7d3216872ed08781dcf4eae9f701d9c83c286efbcd10bcfaf3ece8233c46884c9f
7
- data.tar.gz: 7a764ee903dfbdbb6c292e481f70ea3a7c4746757172df42ee8988f9164376f7dcf84111c141e9065b860bf836867a4e959ed6258cc967fa3c3513702cce261c
6
+ metadata.gz: 9c9c17ab637cb9ebf6702778821f7498f313beffedfb92231d80c29af8df4e8338dcf75f7772f8880ba077adcadf5d79c2f4733673bf78534c833c30eb3eae21
7
+ data.tar.gz: c4da20444705bc989ce27efb8cfa2f692963460a8470968ad16932b0b709a9f3c0a39cbd5b5ec54710e7205cec02b11edda29fbbdc8bf05393ccdf58606c0817
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 2.1.0
3
+ - '2.0'
4
+ - '2.1'
5
+ - '2.2'
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Burgundy
2
2
 
3
+ [![Build Status](https://travis-ci.org/fnando/burgundy.svg)](https://travis-ci.org/fnando/burgundy)
4
+ [![Code Climate](https://codeclimate.com/github/fnando/burgundy/badges/gpa.svg)](https://codeclimate.com/github/fnando/burgundy)
5
+
3
6
  A simple wrapper for objects (think of Burgundy as a decorator/presenter) in less than 100 lines.
4
7
 
5
8
  ## Installation
@@ -1,10 +1,11 @@
1
1
  module Burgundy
2
- class Collection
2
+ class Collection < SimpleDelegator
3
3
  include Enumerable
4
4
 
5
5
  def initialize(items, wrapping_class = nil)
6
6
  @items = items
7
7
  @wrapping_class = wrapping_class
8
+ __setobj__(@items)
8
9
  end
9
10
 
10
11
  def empty?
@@ -1,3 +1,3 @@
1
1
  module Burgundy
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -27,6 +27,11 @@ describe Burgundy do
27
27
  expect(collection.first).to eql(1)
28
28
  end
29
29
 
30
+ it 'delegates collection calls' do
31
+ collection = Burgundy::Collection.new([1,2,3], wrapper)
32
+ expect(collection.size).to eql(3)
33
+ end
34
+
30
35
  it 'includes Enumerable' do
31
36
  expect(Burgundy::Collection).to include(Enumerable)
32
37
  end
@@ -42,24 +47,24 @@ describe Burgundy do
42
47
  it 'responds to the routes method' do
43
48
  item = wrapper.new('hello')
44
49
 
45
- expect(item.respond_to?(:routes, true)).to be
46
- expect(item.respond_to?(:r, true)).to be
50
+ expect(item).to respond_to(:routes)
51
+ expect(item).to respond_to(:r)
47
52
  end
48
53
 
49
54
  it 'responds to the helpers method' do
50
55
  item = wrapper.new('hello')
51
56
 
52
- expect(item.respond_to?(:helpers, true)).to be
53
- expect(item.respond_to?(:h, true)).to be
57
+ expect(item).to respond_to(:helpers)
58
+ expect(item).to respond_to(:h)
54
59
  end
55
60
 
56
61
  it 'responds to the I18n methods' do
57
62
  item = wrapper.new('hello')
58
63
 
59
- expect(item.respond_to?(:translate, true)).to be
60
- expect(item.respond_to?(:t, true)).to be
61
- expect(item.respond_to?(:localize, true)).to be
62
- expect(item.respond_to?(:l, true)).to be
64
+ expect(item).to respond_to(:translate)
65
+ expect(item).to respond_to(:t)
66
+ expect(item).to respond_to(:localize)
67
+ expect(item).to respond_to(:l)
63
68
  end
64
69
 
65
70
  it 'returns route using action mailer options' do
@@ -13,7 +13,7 @@ Dummy::Application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
16
+ config.serve_static_files = true
17
17
  config.static_cache_control = "public, max-age=3600"
18
18
 
19
19
  # Show full error reports and disable caching.
@@ -8,6 +8,3 @@ require 'rspec/rails'
8
8
 
9
9
  require 'burgundy'
10
10
  I18n.locale = :en
11
-
12
- RSpec.configure do |config|
13
- end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burgundy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-05 00:00:00.000000000 Z
11
+ date: 2015-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.2.2
180
+ rubygems_version: 2.4.5
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: A simple wrapper for objects (think of Burgundy as a decorator/presenter)
@@ -225,4 +225,3 @@ test_files:
225
225
  - spec/dummy/public/500.html
226
226
  - spec/dummy/public/favicon.ico
227
227
  - spec/spec_helper.rb
228
- has_rdoc: