charisma 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/charisma.gemspec +1 -1
- data/lib/charisma.rb +1 -0
- data/lib/charisma/base.rb +0 -3
- data/lib/charisma/characteristic.rb +0 -2
- data/lib/charisma/curator.rb +36 -6
- data/lib/charisma/curator/curation.rb +11 -4
- data/lib/charisma/version.rb +1 -1
- data/test/charisma/curator_spec.rb +30 -0
- data/test/helper.rb +0 -70
- data/test/spec_helper.rb +8 -0
- data/test/support/planet.rb +20 -0
- data/test/support/relative_astronomic_mass.rb +6 -0
- data/test/support/spaceship.rb +26 -0
- data/test/support/spaceship_fuel.rb +11 -0
- data/test/support/spaceship_make.rb +7 -0
- data/test/test_charisma.rb +48 -3
- metadata +33 -19
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ Bueller::Tasks.new
|
|
21
21
|
require 'rake/testtask'
|
22
22
|
Rake::TestTask.new(:test) do |test|
|
23
23
|
test.libs << 'lib' << 'test'
|
24
|
-
test.
|
24
|
+
test.test_files = FileList['test/**/test_*.rb'] + FileList['test/**/*_spec.rb']
|
25
25
|
test.verbose = true
|
26
26
|
end
|
27
27
|
|
data/charisma.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = 'charisma'
|
6
6
|
s.version = Charisma::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.date = "2011-
|
8
|
+
s.date = "2011-09-29"
|
9
9
|
s.authors = ['Andy Rossmeissl', 'Seamus Abshere']
|
10
10
|
s.email = 'andy@rossmeissl.net'
|
11
11
|
s.homepage = 'http://github.com/brighterplanet/charisma'
|
data/lib/charisma.rb
CHANGED
@@ -4,6 +4,7 @@ require 'active_support/version'
|
|
4
4
|
active_support/inflector/methods
|
5
5
|
active_support/core_ext/class/attribute_accessors
|
6
6
|
active_support/core_ext/string/output_safety
|
7
|
+
active_support/core_ext/object/try
|
7
8
|
}.each do |active_support_3_requirement|
|
8
9
|
require active_support_3_requirement
|
9
10
|
end if ActiveSupport::VERSION::MAJOR == 3
|
data/lib/charisma/base.rb
CHANGED
data/lib/charisma/curator.rb
CHANGED
@@ -8,23 +8,33 @@ module Charisma
|
|
8
8
|
# The curator's subject--the instance itself'
|
9
9
|
attr_reader :subject
|
10
10
|
|
11
|
-
# The hashed wrapped by the curator that actually stores the computed characteristics'
|
12
|
-
attr_reader :characteristics
|
13
|
-
|
14
11
|
# Create a Curator.
|
15
12
|
#
|
16
13
|
# Typically this is done automatically when <tt>#characteristics</tt> is called on an instance of a characterized class for the first time.
|
17
14
|
# @param [Object] The subject of the curation -- an instance of a characterized class
|
18
15
|
# @see Charisma::Base#characteristics
|
19
16
|
def initialize(subject)
|
20
|
-
@characteristics = {}.extend LooseEquality
|
21
17
|
@subject = subject
|
22
18
|
subject.class.characterization.keys.each do |key|
|
23
|
-
if subject.respond_to?(key)
|
24
|
-
|
19
|
+
if subject.respond_to?(key)
|
20
|
+
value = subject.send(key)
|
21
|
+
self[key] = value unless value.nil?
|
25
22
|
end
|
26
23
|
end
|
27
24
|
end
|
25
|
+
|
26
|
+
# The hashed wrapped by the curator that actually stores the computed characteristics'
|
27
|
+
def characteristics
|
28
|
+
return @characteristics unless @characteristics.nil?
|
29
|
+
|
30
|
+
@characteristics = ::Hash.new do |h, key|
|
31
|
+
if characterization = subject.class.characterization[key]
|
32
|
+
Curation.new nil, characterization
|
33
|
+
end
|
34
|
+
end
|
35
|
+
@characteristics.extend LooseEquality
|
36
|
+
@characteristics
|
37
|
+
end
|
28
38
|
|
29
39
|
# Store a late-defined characteristic, with a Charisma wrapper.
|
30
40
|
# @param [Symbol] key The name of the characteristic, which must match one defined in the class's characterization
|
@@ -41,6 +51,26 @@ module Charisma
|
|
41
51
|
# (see #inpsect)
|
42
52
|
def to_s; inspect end
|
43
53
|
|
54
|
+
# Provide a hash of display-friendly presentations of the computed characteristics' values.
|
55
|
+
#
|
56
|
+
# This is just a convenience method for a common use case, namely injecting a hash with the display-friendly presentations.
|
57
|
+
# @return [Hash]
|
58
|
+
def to_hash
|
59
|
+
characteristics.inject({}) do |memo, (k, v)|
|
60
|
+
memo[k] = v.to_s
|
61
|
+
memo
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Provide a shallow copy.
|
66
|
+
#
|
67
|
+
# @return [Charisma::Curator]
|
68
|
+
def dup
|
69
|
+
shallow = super
|
70
|
+
shallow.instance_variable_set :@characteristics, characteristics.dup
|
71
|
+
shallow
|
72
|
+
end
|
73
|
+
|
44
74
|
extend ::Forwardable
|
45
75
|
def_delegators :characteristics, :[], :keys, :slice, :==, :each
|
46
76
|
|
@@ -22,7 +22,7 @@ module Charisma
|
|
22
22
|
# @param [Charisma::Characteristic, optional] characteristic The associated characteristic definition
|
23
23
|
def initialize(value, characteristic = nil)
|
24
24
|
@characteristic = characteristic
|
25
|
-
establish_units_methods
|
25
|
+
establish_units_methods
|
26
26
|
self.value = value
|
27
27
|
end
|
28
28
|
|
@@ -49,12 +49,19 @@ module Charisma
|
|
49
49
|
# Delegator method
|
50
50
|
def __setobj__(obj); self.value = obj end
|
51
51
|
|
52
|
+
def units
|
53
|
+
characteristic.try(:measurement_class).try(:unit)
|
54
|
+
end
|
55
|
+
|
56
|
+
def u
|
57
|
+
characteristic.try(:measurement_class).try(:unit_abbreviation)
|
58
|
+
end
|
59
|
+
|
52
60
|
private
|
53
61
|
|
54
|
-
# If this curation deals with a measured characteristic, this method will delegate
|
62
|
+
# If this curation deals with a measured characteristic, this method will delegate appropriate unit-name methods like <tt>#kilograms</tt> to <tt>#render</tt>.
|
55
63
|
def establish_units_methods
|
56
|
-
|
57
|
-
if conversions = Conversions.conversions[units.to_sym]
|
64
|
+
if characteristic and characteristic.measurement and conversions = Conversions.conversions[units.to_sym]
|
58
65
|
self.class.def_delegators :render, *conversions.keys
|
59
66
|
end
|
60
67
|
end
|
data/lib/charisma/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
2
|
+
require File.expand_path('../support/spaceship', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
describe Charisma::Curator do
|
5
|
+
before do
|
6
|
+
@ship = Spaceship.new :window_count => 3, :weight => false
|
7
|
+
@curator = Charisma::Curator.new @ship
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#initialize' do
|
11
|
+
it 'stores the subject' do
|
12
|
+
@curator.subject.must_equal @ship
|
13
|
+
end
|
14
|
+
it "assigns any characteristics set on subject to the curation's characteristics" do
|
15
|
+
@curator.characteristics[:window_count].must_equal 3
|
16
|
+
end
|
17
|
+
it "assigns characteristics on subject set to `false`" do
|
18
|
+
@curator.characteristics[:weight].must_be_same_as false
|
19
|
+
end
|
20
|
+
it "does not assign nil characteristics" do
|
21
|
+
@curator.characteristics.keys.wont_include :size
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#characteristics' do
|
26
|
+
it 'returns a default value of a nil Curation for valid characteristics' do
|
27
|
+
@curator.characteristics[:size].value.must_be_nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/test/helper.rb
CHANGED
@@ -1,77 +1,7 @@
|
|
1
1
|
require 'bigdecimal'
|
2
2
|
require 'rubygems'
|
3
3
|
require 'test/unit'
|
4
|
-
require 'supermodel'
|
5
4
|
|
6
5
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
6
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
8
7
|
require 'charisma'
|
9
|
-
|
10
|
-
class Test::Unit::TestCase
|
11
|
-
end
|
12
|
-
|
13
|
-
class RelativeAstronomicMass < Charisma::Measurement # or don't inherit and provide everything yourself
|
14
|
-
units :hollagrams => 'hg'
|
15
|
-
# before_ and after_ filters or some other reason to use this as opposed to Charisma::Measurements::Mass
|
16
|
-
end
|
17
|
-
|
18
|
-
class Spaceship < SuperModel::Base
|
19
|
-
attributes :window_count, :name, :size, :weight
|
20
|
-
belongs_to :make, :class_name => 'SpaceshipMake', :primary_key => 'name'
|
21
|
-
belongs_to :fuel, :class_name => 'SpaceshipFuel', :primary_key => 'name'
|
22
|
-
belongs_to :destination, :class_name => 'Planet', :primary_key => 'name'
|
23
|
-
|
24
|
-
include Charisma
|
25
|
-
characterize do
|
26
|
-
has :make, :display_with => :name
|
27
|
-
has :fuel
|
28
|
-
has :window_count do |window_count|
|
29
|
-
"#{window_count} windows"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
characterize do
|
34
|
-
has :size, :measures => :length # uses Charisma::Measurements::Length
|
35
|
-
has :weight, :measures => RelativeAstronomicMass
|
36
|
-
has :name
|
37
|
-
has :destination
|
38
|
-
has :color
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
class SpaceshipMake < SuperModel::Base
|
43
|
-
has_many :spaceships
|
44
|
-
attributes :name
|
45
|
-
self.primary_key = :name
|
46
|
-
end
|
47
|
-
|
48
|
-
class SpaceshipFuel < SuperModel::Base
|
49
|
-
has_many :spaceships
|
50
|
-
attributes :name, :emission_factor
|
51
|
-
self.primary_key = :name
|
52
|
-
|
53
|
-
def as_characteristic
|
54
|
-
"#{name} (#{emission_factor} kg CO2/L)"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
class Planet < SuperModel::Base
|
59
|
-
has_many :spaceships
|
60
|
-
attributes :name
|
61
|
-
self.primary_key = :name
|
62
|
-
|
63
|
-
def to_s
|
64
|
-
name
|
65
|
-
end
|
66
|
-
|
67
|
-
def mass
|
68
|
-
case name
|
69
|
-
when 'Pluto'
|
70
|
-
BigDecimal('1.31e+1_022')
|
71
|
-
else
|
72
|
-
raise "unknown"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
Conversions.register :hollagrams, :supertons, 2
|
data/test/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'supermodel'
|
2
|
+
|
3
|
+
class Planet < SuperModel::Base
|
4
|
+
has_many :spaceships
|
5
|
+
attributes :name
|
6
|
+
self.primary_key = :name
|
7
|
+
|
8
|
+
def to_s
|
9
|
+
name
|
10
|
+
end
|
11
|
+
|
12
|
+
def mass
|
13
|
+
case name
|
14
|
+
when 'Pluto'
|
15
|
+
BigDecimal('1.31e+1_022')
|
16
|
+
else
|
17
|
+
raise "unknown"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class RelativeAstronomicMass < Charisma::Measurement # or don't inherit and provide everything yourself
|
2
|
+
units :hollagrams => 'hg'
|
3
|
+
# before_ and after_ filters or some other reason to use this as opposed to Charisma::Measurements::Mass
|
4
|
+
end
|
5
|
+
|
6
|
+
Conversions.register :hollagrams, :supertons, 2
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'supermodel'
|
2
|
+
require File.expand_path('relative_astronomic_mass', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
class Spaceship < SuperModel::Base
|
5
|
+
attributes :window_count, :name, :size, :weight
|
6
|
+
belongs_to :make, :class_name => 'SpaceshipMake', :primary_key => 'name'
|
7
|
+
belongs_to :fuel, :class_name => 'SpaceshipFuel', :primary_key => 'name'
|
8
|
+
belongs_to :destination, :class_name => 'Planet', :primary_key => 'name'
|
9
|
+
|
10
|
+
include Charisma
|
11
|
+
characterize do
|
12
|
+
has :make, :display_with => :name
|
13
|
+
has :fuel
|
14
|
+
has :window_count do |window_count|
|
15
|
+
"#{window_count} windows"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
characterize do
|
20
|
+
has :size, :measures => :length # uses Charisma::Measurements::Length
|
21
|
+
has :weight, :measures => RelativeAstronomicMass
|
22
|
+
has :name
|
23
|
+
has :destination
|
24
|
+
has :color
|
25
|
+
end
|
26
|
+
end
|
data/test/test_charisma.rb
CHANGED
@@ -1,78 +1,100 @@
|
|
1
|
-
require 'helper'
|
1
|
+
require File.expand_path('helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
require 'support/planet'
|
4
|
+
require 'support/spaceship'
|
5
|
+
require 'support/spaceship_fuel'
|
6
|
+
require 'support/spaceship_make'
|
2
7
|
|
3
8
|
class TestCharisma < Test::Unit::TestCase
|
4
9
|
def test_001_simple_attribute_characteristic
|
5
10
|
spaceship = Spaceship.new :name => 'Amaroq'
|
6
11
|
assert_equal 'Amaroq', spaceship.characteristics[:name].to_s
|
7
12
|
end
|
13
|
+
|
8
14
|
def test_002_measured_attribute
|
9
15
|
spaceship = Spaceship.new :size => 10 # metres
|
10
16
|
assert_equal '10 m', spaceship.characteristics[:size].to_s
|
11
17
|
end
|
18
|
+
|
12
19
|
def test_003_classified_attribute
|
13
20
|
spaceship = Spaceship.new :weight => 1_000_000 # hg
|
14
21
|
assert_equal '1,000,000 hg', spaceship.characteristics[:weight].to_s
|
15
22
|
end
|
23
|
+
|
16
24
|
def test_004_units
|
17
25
|
spaceship = Spaceship.new :weight => '1000000.1' # kg
|
18
26
|
assert_equal :hollagrams, spaceship.characteristics[:weight].units
|
19
27
|
assert_equal 'hg', spaceship.characteristics[:weight].u
|
20
28
|
assert_equal 2_000_000.2, spaceship.characteristics[:weight].supertons
|
21
29
|
end
|
30
|
+
|
22
31
|
def test_005_attribute_with_custom_display
|
23
32
|
spaceship = Spaceship.new :window_count => 10
|
24
33
|
assert_equal '10 windows', spaceship.characteristics[:window_count].to_s
|
25
34
|
end
|
35
|
+
|
26
36
|
def test_006_simple_association
|
27
37
|
planet = Planet.create :name => 'Pluto'
|
28
38
|
spaceship = Spaceship.new :destination => planet
|
29
39
|
assert_equal 'Pluto', spaceship.characteristics[:destination].to_s
|
30
40
|
end
|
41
|
+
|
31
42
|
def test_007_association_with_display_hint
|
32
43
|
make = SpaceshipMake.create :name => 'Boeing'
|
33
44
|
spaceship = Spaceship.new :make => make
|
34
45
|
assert_equal 'Boeing', spaceship.characteristics[:make].to_s
|
35
46
|
end
|
47
|
+
|
36
48
|
def test_008_association_with_prepared_display
|
37
49
|
fuel = SpaceshipFuel.create :name => 'Kerosene', :emission_factor => 10
|
38
50
|
spaceship = Spaceship.new :fuel => fuel
|
39
51
|
assert_equal 'Kerosene (10 kg CO2/L)', spaceship.characteristics[:fuel].to_s
|
40
52
|
end
|
53
|
+
|
41
54
|
def test_009_number_helper
|
42
55
|
assert_equal '1,000', Charisma::NumberHelper.delimit(1_000)
|
43
56
|
end
|
57
|
+
|
44
58
|
def test_010_characteristics_slice
|
45
59
|
spaceship = Spaceship.new :name => 'Amaroq', :window_count => 2, :size => 10
|
46
60
|
assert_equal '10 m', spaceship.characteristics.slice(:size, :window_count)[:size].to_s
|
47
61
|
assert_equal nil, spaceship.characteristics.slice(:size, :window_count)[:name]
|
48
62
|
assert_equal 2, spaceship.characteristics.slice(:size, :window_count).values.length
|
49
63
|
end
|
64
|
+
|
50
65
|
def test_011_associated_object_methods
|
51
66
|
planet = Planet.create :name => 'Pluto'
|
52
67
|
spaceship = Spaceship.new :destination => planet
|
53
68
|
assert_equal BigDecimal('1.31e+1_022'), spaceship.characteristics[:destination].mass
|
54
69
|
end
|
70
|
+
|
55
71
|
def test_011_characteristic_arithmetic
|
56
72
|
amaroq = Spaceship.new :window_count => 8
|
57
73
|
geo = Spaceship.new :window_count => 6
|
58
74
|
assert_equal 2, amaroq.characteristics[:window_count] - geo.characteristics[:window_count]
|
59
75
|
end
|
60
|
-
|
76
|
+
|
77
|
+
def test_012_missing_characteristics_can_still_be_accessed
|
61
78
|
spaceship = Spaceship.new :name => 'Amaroq'
|
62
|
-
assert_equal
|
79
|
+
assert_equal Charisma::Curator::Curation, spaceship.characteristics[:size].class
|
80
|
+
assert_equal nil, spaceship.characteristics[:size].value
|
63
81
|
end
|
82
|
+
|
64
83
|
def test_013_characteristics_keys
|
65
84
|
spaceship = Spaceship.new :name => 'Amaroq'
|
66
85
|
assert_equal [:name].sort_by { |k| k.to_s }, spaceship.characteristics.keys.sort_by { |k| k.to_s }
|
67
86
|
end
|
87
|
+
|
68
88
|
def test_014_characterization_keys
|
69
89
|
assert_equal [:color, :destination, :fuel, :make, :name, :size, :weight, :window_count].sort_by { |k| k.to_s }, Spaceship.characterization.keys.sort_by { |k| k.to_s }
|
70
90
|
end
|
91
|
+
|
71
92
|
def test_015_characteristic_equality
|
72
93
|
amaroq = Spaceship.new :window_count => 8
|
73
94
|
buster = Spaceship.new :window_count => 8
|
74
95
|
assert_equal amaroq.characteristics, buster.characteristics
|
75
96
|
end
|
97
|
+
|
76
98
|
def test_016_inspection_of_undefined_characteristic
|
77
99
|
muktruk = Spaceship.new
|
78
100
|
muktruk.characteristics[:bumper_sticker] = 'LT'
|
@@ -80,6 +102,7 @@ class TestCharisma < Test::Unit::TestCase
|
|
80
102
|
muktruk.characteristics[:bumper_sticker].inspect
|
81
103
|
end
|
82
104
|
end
|
105
|
+
|
83
106
|
def test_017_each
|
84
107
|
spaceship = Spaceship.new :name => 'Amaroq'
|
85
108
|
catch :blam do
|
@@ -89,14 +112,36 @@ class TestCharisma < Test::Unit::TestCase
|
|
89
112
|
flunk
|
90
113
|
end
|
91
114
|
end
|
115
|
+
|
92
116
|
def test_018_double_bag
|
93
117
|
geo = SpaceshipMake.create :name => 'Geo'
|
94
118
|
g = Spaceship.new :make => geo
|
95
119
|
g.characteristics[:name] = g.characteristics[:make]
|
96
120
|
assert_equal 'Geo', g.characteristics[:name].to_s
|
97
121
|
end
|
122
|
+
|
98
123
|
def test_019_compare_fixnum
|
99
124
|
amaroq = Spaceship.new :window_count => 8
|
100
125
|
assert(amaroq.characteristics == { :window_count => 8 })
|
101
126
|
end
|
127
|
+
|
128
|
+
def test_020_to_hash
|
129
|
+
spaceship = Spaceship.new :name => 'Amaroq', :window_count => 2, :size => 10
|
130
|
+
assert_equal({:name => 'Amaroq', :window_count => '2 windows', :size => '10 m'}, spaceship.characteristics.to_hash)
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_021_dup
|
134
|
+
spaceship = Spaceship.new :name => 'Amaroq'
|
135
|
+
initial_characteristics = spaceship.characteristics.dup
|
136
|
+
assert_equal [:name], initial_characteristics.keys
|
137
|
+
spaceship.characteristics[:window_count] = 2
|
138
|
+
assert_equal [:name], initial_characteristics.keys
|
139
|
+
assert_equal [:name, :window_count], spaceship.characteristics.keys
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_022_nil_units
|
143
|
+
spaceship = Spaceship.new
|
144
|
+
assert_equal nil, spaceship.characteristics[:name].units
|
145
|
+
assert_equal :hollagrams, spaceship.characteristics[:weight].units
|
146
|
+
end
|
102
147
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charisma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-09-29 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
17
|
-
requirement: &
|
17
|
+
requirement: &2158256360 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2158256360
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: blockenspiel
|
28
|
-
requirement: &
|
28
|
+
requirement: &2158255680 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2158255680
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: conversions
|
39
|
-
requirement: &
|
39
|
+
requirement: &2158250620 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2158250620
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: bundler
|
50
|
-
requirement: &
|
50
|
+
requirement: &2158250040 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2158250040
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: bueller
|
61
|
-
requirement: &
|
61
|
+
requirement: &2158249400 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2158249400
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rake
|
72
|
-
requirement: &
|
72
|
+
requirement: &2158248760 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2158248760
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rcov
|
83
|
-
requirement: &
|
83
|
+
requirement: &2158248140 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: '0'
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *2158248140
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: supermodel
|
94
|
-
requirement: &
|
94
|
+
requirement: &2158247460 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '0'
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *2158247460
|
103
103
|
description: Define strategies for accessing and displaying a subset of your classes'
|
104
104
|
attributes
|
105
105
|
email: andy@rossmeissl.net
|
@@ -130,7 +130,14 @@ files:
|
|
130
130
|
- lib/charisma/measurement/time.rb
|
131
131
|
- lib/charisma/number_helper.rb
|
132
132
|
- lib/charisma/version.rb
|
133
|
+
- test/charisma/curator_spec.rb
|
133
134
|
- test/helper.rb
|
135
|
+
- test/spec_helper.rb
|
136
|
+
- test/support/planet.rb
|
137
|
+
- test/support/relative_astronomic_mass.rb
|
138
|
+
- test/support/spaceship.rb
|
139
|
+
- test/support/spaceship_fuel.rb
|
140
|
+
- test/support/spaceship_make.rb
|
134
141
|
- test/test_charisma.rb
|
135
142
|
homepage: http://github.com/brighterplanet/charisma
|
136
143
|
licenses: []
|
@@ -146,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
153
|
version: '0'
|
147
154
|
segments:
|
148
155
|
- 0
|
149
|
-
hash: -
|
156
|
+
hash: -4326195820228354583
|
150
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
158
|
none: false
|
152
159
|
requirements:
|
@@ -160,5 +167,12 @@ signing_key:
|
|
160
167
|
specification_version: 3
|
161
168
|
summary: Curate your rich Ruby objects' attributes
|
162
169
|
test_files:
|
170
|
+
- test/charisma/curator_spec.rb
|
163
171
|
- test/helper.rb
|
172
|
+
- test/spec_helper.rb
|
173
|
+
- test/support/planet.rb
|
174
|
+
- test/support/relative_astronomic_mass.rb
|
175
|
+
- test/support/spaceship.rb
|
176
|
+
- test/support/spaceship_fuel.rb
|
177
|
+
- test/support/spaceship_make.rb
|
164
178
|
- test/test_charisma.rb
|