sy 2.0.9 → 2.0.14.p1

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: fbbae1ea1d66b6976a9dbff702b83e891d0a2e71
4
- data.tar.gz: 45b1ac5ddb4e8394d96ae22ad4a2e9946e23ec11
3
+ metadata.gz: a3e8d0ee8af3d58235251a4ecf4bc5417d0bcf93
4
+ data.tar.gz: 760db697a01221f8718d1cd3470d970b1e8dc120
5
5
  SHA512:
6
- metadata.gz: 61cd30896408251b6611e1d616476e3666fd6d1c006140b4f9472ce15f11dfb29cf47b59a631614b9a8d1c5c74d282562ef70d588abacd3571aba063312ed5bb
7
- data.tar.gz: 2c6553261eebeacdf3ab6f9a29094bc855800845d2cf44a3c9d62b19dd86b09c25ce796ad4a50a7de9cc5f070b484c20b2a1a53ec2a6241b7a17ab9f67933d50
6
+ metadata.gz: 2b09ab7db542a71c9f8d45fc67d6cce95fef609d5b6ee3c057342c47207c7d7b51d322d2c23ddffb815faae360ded982c3054fed313e23ea01a8b9b59fffb92f
7
+ data.tar.gz: 4ee9df2f65f70a09b780f936df629fbf99f54f14786e773382b28e16b5695f3bdcfb936679da4a75215d788ccf946593e9ce4698c1e7db3d7b0e3e1eb45605ce
data/lib/sy/quantity.rb CHANGED
@@ -411,13 +411,14 @@ class SY::Quantity
411
411
  mixin = relative? ? SY::SignedMagnitude : SY::AbsoluteMagnitude
412
412
  qnt_ɴ_λ = -> { name ? "#{name}@%s" : "#<Quantity:#{object_id}@%s>" }
413
413
 
414
+ qnt = self
414
415
  @Magnitude = Class.new do
415
416
  include mmod
416
417
  include mixin
417
418
 
418
419
  singleton_class.class_exec do
419
420
  define_method :zero do # Costructor of zero magnitudes
420
- new amount: 0
421
+ new amount: 0, of: qnt
421
422
  end
422
423
 
423
424
  define_method :to_s do # Customized #to_s. It must be a proc,
@@ -449,7 +450,9 @@ class SY::Quantity
449
450
  ɴλ.call % "Unit" # as for @Magnitude applies.)
450
451
  end
451
452
  end
452
- end.namespace! SY::Unit
453
+ end.tap do |unit_parametrized_subclass|
454
+ unit_parametrized_subclass.namespace = SY::Unit
455
+ end
453
456
  end ).tap do |u|
454
457
  puts "@Unit constructed, its namespace is #{u.namespace}" if SY::DEBUG
455
458
  puts "its instances are #{u.namespace.instances}" if SY::DEBUG
data/lib/sy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module SY
2
- VERSION = "2.0.9"
2
+ VERSION = "2.0.14.p1"
3
3
  DEBUG = false # debug mode switch - sometimes there are lines like
4
4
  # puts "something" if SY::DEBUG
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.14.p1
5
5
  platform: ruby
6
6
  authors:
7
7
  - boris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-04 00:00:00.000000000 Z
11
+ date: 2013-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -68,9 +68,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - '>'
72
72
  - !ruby/object:Gem::Version
73
- version: '0'
73
+ version: 1.3.1
74
74
  requirements: []
75
75
  rubyforge_project:
76
76
  rubygems_version: 2.0.3