sy 2.1.0 → 2.1.1

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: e8e3b882133b6a74dabbdbd0e3c76fe98e56ba6d
4
- data.tar.gz: 52f7d7273a5ac8ff6180a308871c492b8d1aec7a
3
+ metadata.gz: 9f18cca23e5dbaf84f9891e046540d06850f21cd
4
+ data.tar.gz: 0be54fd6686547d8367ce0081c4c19da8c0a3094
5
5
  SHA512:
6
- metadata.gz: 5d2b1dfd1999477ad6b9f4f30073380db2f8d20578b4ba2c51d29e09bdebb5f4ac92524beefc18897f3fcf25cd9c1f200f984cb4937d165a8fe362938f46f498
7
- data.tar.gz: d83f76d2d67b66bd18938c2d53f968837915c3e64d64d2806a9b4c8367bdddb31b26b9da59842965aa6c23b4bc5bf6b58863f899693e7023b76c7ea7b13df8a1
6
+ metadata.gz: 06602d4d119efc3a9db9f43aba372a557657e1eb1126cc028ed1368485f8182409dee7a4f0f2ac5a848e48050a69b3d3102550ccfa101cd9cc14986b4686b1f4
7
+ data.tar.gz: 41f838368c2b5bff694a1932dcf241de00278a41acde5d5c587abe6d4722344bcbc94a5fc4d0d365bea30cab53e67de5f5a46642b9ca33c2c86af6294950c8b4
data/.gitignore CHANGED
@@ -1,20 +1,21 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
1
15
  *~
2
16
  .#*
3
17
  \#*#
4
18
  *.gem
5
19
  *.rbc
6
- .bundle
7
- .config
8
- .yardoc
9
- Gemfile.lock
10
- InstalledFiles
11
- _yardoc
12
- coverage
13
- doc/
14
- lib/bundler/man
15
- pkg
16
- rdoc
17
- spec/reports
18
- test/tmp
19
- test/version_tmp
20
- tmp
20
+ /.config/
21
+ /rdoc/
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 boris
1
+ Copyright (c) 2015 Boris Stitnicky
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env rake
2
1
  require "bundler/gem_tasks"
2
+
Binary file
data/lib/sy.rb CHANGED
@@ -55,7 +55,7 @@ module SY
55
55
  AUTOINCLUDE = true unless defined? ::SY::AUTOINCLUDE
56
56
  end
57
57
 
58
- Numeric.class_exec { include ::SY::ExpressibleInUnits } if SY::AUTOINCLUDE
58
+ Numeric.class_exec { include SY::ExpressibleInUnits } if SY::AUTOINCLUDE
59
59
 
60
60
  # === Instead of introduction
61
61
  #
@@ -351,4 +351,4 @@ module SY
351
351
  ELEMENTARY_CHARGE = 1.60217656535e-19 * COULOMB
352
352
 
353
353
  ELECTRONVOLT = Unit.of Energy, short: "eV", amount: ELEMENTARY_CHARGE * VOLT
354
- end
354
+ end
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # Qualities specific to absolute magnitudes (mixin).
3
4
  #
4
5
  # Absolute magnitude may not be negative – physical amounts cannot have
@@ -114,4 +115,4 @@ module SY::AbsoluteMagnitude
114
115
  def çς
115
116
  "Magnitude"
116
117
  end
117
- end # class SY::Magnitude
118
+ end # class SY::AbsoluteMagnitude
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  # Composition of quantities.
4
4
  #
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # This class represents physical dimension of a metrological quantity.
3
4
  #
4
5
  class SY::Dimension
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # This mixin provides ability to respond to SY unit symbol methods.
3
4
  #
4
5
  module SY::ExpressibleInUnits
@@ -234,4 +235,4 @@ module SY::ExpressibleInUnits
234
235
  # beginning, certain methods for certain classes, to get in front of possible
235
236
  # collisions. Collision was detected for example for #second with
236
237
  # active_support/duration.rb
237
- end # module SY::UnitMethodsMixin
238
+ end
@@ -1,22 +1,23 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # Here, fixed assets of the main module are set up.
3
4
  #
4
5
  module SY
5
- QuantityError = Class.new TypeError # mixing incompatible quantities
6
- DimensionError = Class.new TypeError # mixing incompatible dimensions
6
+ QuantityError = Class.new TypeError # incompatible quantities
7
+ DimensionError = Class.new TypeError # incompatible dimensions
7
8
  MagnitudeError = Class.new TypeError # creating impossible magnitude
8
9
 
9
10
  BASE_DIMENSIONS = { # Basic physical dimensions.
10
11
  L: :LENGTH,
11
12
  M: :MASS,
12
- Q: :ELECTRIC_CHARGE,
13
+ T: :TIME,
14
+ Q: :ELECTRIC_CHARGE, # instead of electric current
13
15
  Θ: :TEMPERATURE,
14
- T: :TIME
15
- }
16
+ } # amount of substance and luminous intensity omitted
16
17
 
17
18
  class << BASE_DIMENSIONS
18
- # Letters of base dimensions.
19
- #
19
+ # Letters of the base dimensions.
20
+ #
20
21
  def letters
21
22
  keys
22
23
  end
@@ -44,7 +45,7 @@ module SY
44
45
  end
45
46
  end
46
47
 
47
- # Table of standard prefixes and their corresponding unit multiples.
48
+ # Table of standard prefixes and their corresponding unit multiples.
48
49
  #
49
50
  PREFIX_TABLE = [ { full: "exa", short: "E", factor: 1e18 },
50
51
  { full: "peta", short: "P", factor: 1e15 },
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  require_relative '../sy'
4
4
 
@@ -35,4 +35,7 @@ module SY
35
35
 
36
36
  # === Time
37
37
  FORTNIGHT = Unit.of Time, short: 'ftn', amount: 1_209_600 * SECOND
38
+
39
+ # === Speed
40
+ MPH = Unit.of Speed, amount: MILE / HOUR
38
41
  end
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  # This module defines common assets of a magnitude – be it absolute (number of
4
4
  # unit objects), or relative (magnitude difference).
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # Represents a certain way, that a quantity <em>measures</em> another quantity
3
4
  # (reference quantity). Instance has two attributes:
4
5
  #
@@ -1,4 +1,4 @@
1
- #encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  require 'matrix'
4
4
 
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # Represents a certain way, that a quantity <em>measures</em> another quantity
3
4
  # (reference quantity). Instance has two attributes:
4
5
  #
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  # Setting +AUTOINCLUDE+ constant to _false_ at the beginning of the +sy+ loading
4
4
  # process prevents automatic inclusion of +SY::ExpressibleInUnits+ in +Numeric+.
@@ -1,4 +1,4 @@
1
- #encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  # Quantity.
4
4
  #
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
+
2
3
  # Qualities specific to relative magnitudes (mixin).
3
4
  #
4
5
  module SY::SignedMagnitude
@@ -1,4 +1,4 @@
1
- #encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  # This class represents a unit of measurement – a predefined magnitude
4
4
  # of a metrological quantity.
@@ -1,5 +1,7 @@
1
+ # coding: utf-8
2
+
1
3
  module SY
2
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
3
5
  DEBUG = false # debug mode switch - sometimes there are lines like
4
6
  # puts "something" if SY::DEBUG
5
7
  end
@@ -1,4 +1,4 @@
1
- #encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  # Wildcard zero, stronger than ordinary numeric literal 0.
4
4
  #
data/sy.gemspec CHANGED
@@ -1,19 +1,23 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/sy/version', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sy/version'
3
5
 
4
- Gem::Specification.new do |gem|
5
- gem.authors = ["boris"]
6
- gem.email = ["\"boris@iis.sinica.edu.tw\""]
7
- gem.description = %q{Physical units library}
8
- gem.summary = %q{Simple and concise way to express physical units.}
9
- gem.homepage = ""
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "sy"
8
+ spec.version = SY::VERSION
9
+ spec.authors = ["Boris Stitnicky"]
10
+ spec.email = ["borisstitnicky@centrum.cz"]
11
+ spec.summary = %q{Simple and concise way to express physical units.}
12
+ spec.description = %q{Physical units library}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
10
15
 
11
- gem.files = `git ls-files`.split($\)
12
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
- gem.name = "sy"
15
- gem.require_paths = ["lib"]
16
- gem.version = SY::VERSION
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
17
20
 
18
- gem.add_dependency "activesupport"
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
19
23
  end
@@ -10,8 +10,8 @@ require 'mathn'
10
10
  require 'minitest/autorun'
11
11
 
12
12
  # The following will load SY library
13
- # require 'sy'
14
- require './../lib/sy'
13
+ require 'sy'
14
+ # require './../lib/sy'
15
15
 
16
16
  # **************************************************************************
17
17
  # THE SPECIFICATIONS START HERE
metadata CHANGED
@@ -1,41 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
- - boris
7
+ - Boris Stitnicky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-18 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activesupport
14
+ name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
19
+ version: '1.7'
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
- version: '0'
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
27
41
  description: Physical units library
28
42
  email:
29
- - '"boris@iis.sinica.edu.tw"'
43
+ - borisstitnicky@centrum.cz
30
44
  executables: []
31
45
  extensions: []
32
46
  extra_rdoc_files: []
33
47
  files:
34
- - .gitignore
48
+ - ".gitignore"
35
49
  - Gemfile
36
- - LICENSE
50
+ - LICENSE.txt
37
51
  - README.md
38
52
  - Rakefile
53
+ - iupac_green.pdf
39
54
  - lib/sy.rb
40
55
  - lib/sy/absolute_magnitude.rb
41
56
  - lib/sy/composition.rb
@@ -57,7 +72,8 @@ files:
57
72
  - test/noinclude_test.rb
58
73
  - test/sy_test.rb
59
74
  homepage: ''
60
- licenses: []
75
+ licenses:
76
+ - MIT
61
77
  metadata: {}
62
78
  post_install_message:
63
79
  rdoc_options: []
@@ -65,17 +81,17 @@ require_paths:
65
81
  - lib
66
82
  required_ruby_version: !ruby/object:Gem::Requirement
67
83
  requirements:
68
- - - '>='
84
+ - - ">="
69
85
  - !ruby/object:Gem::Version
70
86
  version: '0'
71
87
  required_rubygems_version: !ruby/object:Gem::Requirement
72
88
  requirements:
73
- - - '>='
89
+ - - ">="
74
90
  - !ruby/object:Gem::Version
75
91
  version: '0'
76
92
  requirements: []
77
93
  rubyforge_project:
78
- rubygems_version: 2.0.3
94
+ rubygems_version: 2.2.2
79
95
  signing_key:
80
96
  specification_version: 4
81
97
  summary: Simple and concise way to express physical units.