analog 0.4.1 → 0.4.2

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +4 -3
  4. data/lib/scale.rb +5 -2
  5. data/lib/scale/scheme.rb +17 -10
  6. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6ecbb065dc457e1c7083a6fb9dccd5009803cc9
4
- data.tar.gz: 1ae46aeb485d2b1cd55cfca16215461485ea5ee3
3
+ metadata.gz: 0ca5b95340638a16df7216da31a80145520cd467
4
+ data.tar.gz: 1b4b248f6a9db4459d489385d43b53ef3b181c59
5
5
  SHA512:
6
- metadata.gz: 584c06d0f46fa1413f2a7388189b0d0eeed82f57e363f042d0abe1711f7847aaf46473c4b97ef765ebb198440cb3f3fb9ea96953bb04d1ecaae8c7f97c928074
7
- data.tar.gz: 27172f45799a415d540608514248a7d753a20d9064cdd5e040f81a613920ef35846d409ce4f597c7d283a020c178aa0ef654b9c513ce47877a08b3d9f7035ed9
6
+ metadata.gz: 0de8ad8f42594367f7427fcf95b64fb90ca2fef9801c5e2a28f9c32495574a44cae80de43c76ddf63fdce7ef9ea692fed236586470be7e236f573709fe0da24b
7
+ data.tar.gz: 1f26e81c89f06055d45bcaffbfd226ccab9417a6db6afd7b85b18ca40538b0cb62e61e0275980dadd1dece484524f998b9851cc63a7e94c269fb0b8dab438168
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2014-2015 Ari Russo
1
+ Copyright 2014-2017 Ari Russo
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # analog
1
+ # Analog
2
2
 
3
- A Ruby helper for scaling numbers.
3
+ A Ruby helper for scaling numbers
4
4
 
5
5
  #### Background
6
6
 
@@ -77,4 +77,5 @@ or with Bundler
77
77
  #### License
78
78
 
79
79
  Licensed under Apache 2.0, See the file LICENSE
80
- Copyright (c) 2014-2014 [Ari Russo](http://arirusso.com)
80
+
81
+ Copyright (c) 2014-2017 [Ari Russo](http://arirusso.com)
@@ -1,8 +1,11 @@
1
1
  # Analog
2
2
  # Helper for scaling numbers
3
- # (c) 2014-2015 Ari Russo
3
+ # https://github.com/arirusso/analog
4
+ #
5
+ # (c) 2014-2017 Ari Russo
4
6
  # Licensed under Apache 2.0
5
7
  #
8
+
6
9
  require "scale/destination"
7
10
  require "scale/scheme"
8
11
  require "scale/source"
@@ -10,6 +13,6 @@ require "scale/source"
10
13
  # Helper for scaling numbers
11
14
  module Scale
12
15
 
13
- VERSION = "0.4.1"
16
+ VERSION = "0.4.2"
14
17
 
15
18
  end
@@ -18,7 +18,7 @@ module Scale
18
18
  end
19
19
 
20
20
  # Build a scaling scheme starting with the given destination
21
- # @param [::Enumerable] destination
21
+ # @param [::Enumerable] destination
22
22
  # @return [Scale::Scheme]
23
23
  def to(destination)
24
24
  Scheme.new.to(destination)
@@ -42,8 +42,15 @@ module Scale
42
42
  # @option options [::Enumerable] :source The source for this scaling scenario
43
43
  def initialize(options = {})
44
44
  @input = options[:input]
45
- @source = Source.new(options[:source]) unless options[:source].nil?
46
- @destination = Destination.new(options[:destination]) unless options[:destination].nil?
45
+ @destination = nil
46
+ @source = nil
47
+
48
+ unless options[:source].nil?
49
+ @source = Source.new(options[:source])
50
+ end
51
+ unless options[:destination].nil?
52
+ @destination = Destination.new(options[:destination])
53
+ end
47
54
  end
48
55
 
49
56
  # Set the source for this scaling scenario. If on calling this method, the scenario
@@ -57,8 +64,8 @@ module Scale
57
64
  scale? ? result : self
58
65
  end
59
66
 
60
- # Set the destination for this scaling scenario. If on calling this method, the
61
- # scenario has all of its needed properties, the scaled value will be returned.
67
+ # Set the destination for this scaling scenario. If on calling this method, the
68
+ # scenario has all of its needed properties, the scaled value will be returned.
62
69
  # Otherwise this method will return the updated Scheme object.
63
70
  #
64
71
  # @param [::Enumerable] destination
@@ -68,8 +75,8 @@ module Scale
68
75
  scale? ? result : self
69
76
  end
70
77
 
71
- # Set both the source and destination on this scheme. If on calling this method, the
72
- # scenario has all of its needed properties, the scaled value will be returned.
78
+ # Set both the source and destination on this scheme. If on calling this method, the
79
+ # scenario has all of its needed properties, the scaled value will be returned.
73
80
  # Otherwise this method will return the updated Scheme object.
74
81
  #
75
82
  # @param [::Enumerable] source
@@ -82,10 +89,10 @@ module Scale
82
89
  end
83
90
 
84
91
 
85
- # Set the input of this scaling scenario. If on calling this method, the
86
- # scenario has all of its needed properties, the scaled value will be returned.
92
+ # Set the input of this scaling scenario. If on calling this method, the
93
+ # scenario has all of its needed properties, the scaled value will be returned.
87
94
  # Otherwise this method will return the updated Scheme object.
88
- #
95
+ #
89
96
  # @param [Numeric] number
90
97
  # @return [Numeric, Scale::Scheme]
91
98
  def scale(number)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-03 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -112,7 +112,7 @@ files:
112
112
  - test/source_test.rb
113
113
  homepage: http://github.com/arirusso/analog
114
114
  licenses:
115
- - Apache License (2.0)
115
+ - Apache-2.0
116
116
  metadata: {}
117
117
  post_install_message:
118
118
  rdoc_options: []
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: 1.3.6
131
131
  requirements: []
132
132
  rubyforge_project: analog
133
- rubygems_version: 2.2.2
133
+ rubygems_version: 2.6.8
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Helper for scaling numbers