liner 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +16 -1
- data/README.md +29 -6
- data/lib/liner/inspectable.rb +8 -1
- data/lib/liner/version.rb +1 -1
- metadata +16 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dad0b6535c04ddf76fad05584ad64b4c379187f7
|
4
|
+
data.tar.gz: 75233cdd3a40e5d9a126f46fc12b510a137e6276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 757c14e3eafdf3619452c3b9c2e3276e2e8830aef5af1cea231f44d1319ede9fae6ca213f405ae02c366b64b61e2db5a1f1413597e816338ffabfd89379bdd9f
|
7
|
+
data.tar.gz: 4fce92aab596458b658e3b4e03193b2004489c1ccc926f71c7a8433108dcd8150cb2241cea8d9e6c4eb4cb142b8fbd32392ed1cf2165afca710eab0a6434f48d
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.0
|
data/.travis.yml
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
bundler_args: --without yard pry
|
2
4
|
rvm:
|
3
5
|
- 1.9.3
|
4
6
|
- 2.0.0
|
5
|
-
- 2.1.0
|
7
|
+
- 2.1.0
|
8
|
+
- ruby-head
|
9
|
+
- rbx
|
10
|
+
- rbx-2
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
- rvm: jruby-19mode
|
14
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
15
|
+
- rvm: jruby-head
|
16
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
17
|
+
allow_failure:
|
18
|
+
- rvm: ruby-head
|
19
|
+
- rvm: jruby-head
|
20
|
+
fast_finish: true
|
data/README.md
CHANGED
@@ -61,16 +61,24 @@ e[:layout] = "V6" # => "V6"
|
|
61
61
|
e[:foo] = "Bar" # => ArgumentError: Invalid liner attribute: 'foo'
|
62
62
|
```
|
63
63
|
|
64
|
-
If you want a full attribute hash, we have that
|
64
|
+
If you want a full attribute hash, we have that.
|
65
65
|
|
66
66
|
```ruby
|
67
67
|
e.liner # => { :layout => 'V6', :fuel => 'diesel' }
|
68
68
|
```
|
69
69
|
|
70
|
+
You can set attributes en masse by sending an array or hash.
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
e.liner = { layout: 'I4', fuel: 'biofuel' }
|
74
|
+
```
|
75
|
+
```ruby
|
76
|
+
e.liner_values = ['I4', 'biofuel']
|
77
|
+
```
|
78
|
+
|
70
79
|
### Inspection
|
71
80
|
|
72
|
-
|
73
|
-
here).
|
81
|
+
A nice inspection method is always handy.
|
74
82
|
|
75
83
|
```ruby
|
76
84
|
e.inspect
|
@@ -105,7 +113,7 @@ like you would any accessor. You can access the raw value through either the ins
|
|
105
113
|
```ruby
|
106
114
|
class Taco < Liner.new(:filling)
|
107
115
|
def filling
|
108
|
-
if
|
116
|
+
if liner_get(:filling) == 'ground beef'
|
109
117
|
'Steak'
|
110
118
|
elsif @filling == 'unknown fish'
|
111
119
|
'Atlantic Cod'
|
@@ -166,6 +174,23 @@ Guitar.new('C', 6)
|
|
166
174
|
# => #<Guitar key="C", strings=6>
|
167
175
|
```
|
168
176
|
|
177
|
+
### Supported Ruby Versions
|
178
|
+
|
179
|
+
This library aims to support and is tested against the following Ruby
|
180
|
+
implementations:
|
181
|
+
|
182
|
+
* Ruby 1.9.3
|
183
|
+
* Ruby 2.0.0
|
184
|
+
* Ruby 2.1.0
|
185
|
+
* [JRuby](http://jruby.org/)
|
186
|
+
* [Rubinius](http://rubini.us/)
|
187
|
+
|
188
|
+
If something doesn't work on one of these versions, it's a bug.
|
189
|
+
|
190
|
+
This library may inadvertently work (or seem to work) on other Ruby versions or
|
191
|
+
implementations, however support will only be provided for the implementations
|
192
|
+
listed above.
|
193
|
+
|
169
194
|
## Installation
|
170
195
|
|
171
196
|
Add this line to your application's Gemfile:
|
@@ -180,8 +205,6 @@ Or install it yourself as:
|
|
180
205
|
|
181
206
|
$ gem install liner
|
182
207
|
|
183
|
-
|
184
|
-
|
185
208
|
## Contributing
|
186
209
|
|
187
210
|
1. Fork it
|
data/lib/liner/inspectable.rb
CHANGED
@@ -4,9 +4,16 @@ module Liner
|
|
4
4
|
# @return [String]
|
5
5
|
# @api public
|
6
6
|
def inspect
|
7
|
-
attribute_string = liner.map{|k,v| "#{k}=#{v.inspect}"}.join(', ')
|
8
7
|
"#<#{self.class} #{attribute_string}>"
|
9
8
|
end
|
10
9
|
alias :to_s :inspect
|
10
|
+
|
11
|
+
# List all the liner attributes as a string, used for inspection.
|
12
|
+
# @return [String]
|
13
|
+
# @api private
|
14
|
+
def attribute_string
|
15
|
+
liner.map { |k,v| "#{k}=#{v.inspect}" }.join(', ')
|
16
|
+
end
|
17
|
+
private :attribute_string
|
11
18
|
end
|
12
19
|
end
|
data/lib/liner/version.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lewis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02
|
11
|
+
date: 2014-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
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: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
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: :development
|
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
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: A liner for Ruby objects. Add attribute, inspection, serialization, and
|
@@ -74,8 +74,9 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- .gitignore
|
78
|
-
- .
|
77
|
+
- ".gitignore"
|
78
|
+
- ".ruby-version"
|
79
|
+
- ".travis.yml"
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.md
|
@@ -106,17 +107,17 @@ require_paths:
|
|
106
107
|
- lib
|
107
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
109
|
requirements:
|
109
|
-
- -
|
110
|
+
- - ">="
|
110
111
|
- !ruby/object:Gem::Version
|
111
112
|
version: '0'
|
112
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
114
|
requirements:
|
114
|
-
- -
|
115
|
+
- - ">="
|
115
116
|
- !ruby/object:Gem::Version
|
116
117
|
version: '0'
|
117
118
|
requirements: []
|
118
119
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.2.
|
120
|
+
rubygems_version: 2.2.0
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
123
|
summary: Liner is a lightweight library designed to enhance simple classes with a
|