modular-scale 2.0.0.alpha5 → 2.0.0

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/lib/modular-scale.rb CHANGED
@@ -16,7 +16,7 @@ Compass::Frameworks.register('modular-scale', :path => extension_path)
16
16
  # a prerelease version
17
17
  # Date is in the form of YYYY-MM-DD
18
18
  module ModularScale
19
- VERSION = "2.0.0.alpha5"
19
+ VERSION = "2.0.0"
20
20
  DATE = "2013-12-20"
21
21
  end
22
22
 
@@ -65,21 +65,26 @@ module Sass::Script::Functions
65
65
  # NOTE THIS IS NOT FULLY FUNCTIONAL YET
66
66
  # ONLY LOOPS THROUGH SOME/MOST OF THE POSSIBILITES
67
67
 
68
- rbases.each do |base|
69
- rratios.each do |ratio|
68
+ rratios.each do |ratio|
69
+ rbases.each do |base|
70
+
71
+ base_counter = 0
72
+
73
+ # Seed list with an initial value
74
+ r << base
70
75
 
71
76
  # Find values on a positive scale
72
- if rvalue > 0
73
- # Find lower values on the scale
74
- i = -1;
77
+ if rvalue >= 0
78
+ # Find higher values on the scale
79
+ i = 0;
75
80
  while ((ratio ** i) * base) >= (rbases[0])
76
81
  r << (ratio ** i) * base
77
82
  i = i - 1;
78
83
  end
79
84
 
80
- # Find higher possible values on the scale
81
- i = 1;
82
- while ((ratio ** i) * base) <= ((ratio ** rvalue) * base)
85
+ # Find lower possible values on the scale
86
+ i = 0;
87
+ while ((ratio ** i) * base) <= ((ratio ** (rvalue + 1)) * base)
83
88
  r << (ratio ** i) * base
84
89
  i = i + 1;
85
90
  end
@@ -87,15 +92,15 @@ module Sass::Script::Functions
87
92
  else
88
93
 
89
94
  # Find lower values on the scale
90
- i = 1;
95
+ i = 0;
91
96
  while ((ratio ** i) * base) <= (rbases[0])
92
97
  r << (ratio ** i) * base
93
98
  i = i + 1;
94
99
  end
95
100
 
96
101
  # Find higher possible values on the scale
97
- i = -1;
98
- while ((ratio ** i) * base) >= ((ratio ** rvalue) * base)
102
+ i = 0;
103
+ while ((ratio ** i) * base) >= ((ratio ** (rvalue - 1)) * base)
99
104
  r << (ratio ** i) * base
100
105
  i = i - 1;
101
106
  end
@@ -108,10 +113,11 @@ module Sass::Script::Functions
108
113
  r.sort!
109
114
  r.uniq!
110
115
 
116
+
111
117
  if rvalue < 0
112
118
  r = r.keep_if { |a| a <= rbases[0] }
113
119
  # Final value
114
- r = r[rvalue - 1]
120
+ r = r[(rvalue - 1)]
115
121
  else
116
122
  r = r[rvalue]
117
123
  end
@@ -1,35 +1,74 @@
1
- @if ms-list(-3, 3, 10 16, $major-third) != (6.5536 8 8.192 10 10.24 12.5 12.8) {
2
- @warn "function ms-list(): FAIL";
3
- @debug "function ms-list(-3, 3, 10 16, $major-third)";
4
- @debug "Result: (#{ms-list(-3, 3, 10 16, $major-third)})";
5
- @debug "Intended: (6.5536 8 8.192 10 10.24 12.5 12.8)";
6
- }@else {
7
- @debug "function ms-list(): PASS";
8
- }
9
-
10
1
  @if "#{ms(2, 16, $minor-sixth)}" != "40.96" {
11
- @warn "function ms(): FAIL";
2
+ @debug "";
3
+ @warn "function ms(): FAIL!";
12
4
  @debug "function ms(2, 16, $minor-sixth)";
13
5
  @debug "Result: #{ms(2, 16, $minor-sixth)}";
14
6
  @debug "Intended: 40.96";
7
+ @debug "";
15
8
  }@else {
16
- @debug "function ms(): PASS";
9
+ @warn "function ms(+): pass";
10
+ }
11
+
12
+ @if "#{ms(-2, 16, $minor-sixth)}" != "6.25" {
13
+ @debug "";
14
+ @warn "function ms(): FAIL!";
15
+ @debug "function ms(-2, 16, $minor-sixth)";
16
+ @debug "Result: #{ms(-2, 16, $minor-sixth)}";
17
+ @debug "Intended: 6.25";
18
+ @debug "";
19
+ }@else {
20
+ @warn "function ms(-): pass";
17
21
  }
18
22
 
19
23
  @if ms(2, 14 18, $major-second) != 15.75 {
20
- @warn "function ms() multi-base: FAIL";
24
+ @debug "";
25
+ @warn "function ms() multi-base: FAIL!";
21
26
  @debug "function ms(2, 14 18, $major-second)";
22
27
  @debug "Result: #{ms(2, 14 18, $major-second)}";
23
28
  @debug "Intended: 15.75";
29
+ @debug "";
30
+ }@else {
31
+ @warn "function ms(+) multi-base: pass";
32
+ }
33
+
34
+ @if ms(-1, 14 18, $major-third) != 11.52 {
35
+ @debug "";
36
+ @warn "function ms() multi-base: FAIL!";
37
+ @debug "function ms(-1, 14 18, $major-third)";
38
+ @debug "Result: #{ms(-1, 14 18, $major-third)}";
39
+ @debug "Intended: 11.52";
40
+ @debug "";
24
41
  }@else {
25
- @debug "function ms() multi-base: PASS";
42
+ @warn "function ms(-) multi-base: pass";
43
+ }
44
+
45
+ @if "#{ms(-4, 12, $major-tenth $octave)}" != "1.92" {
46
+ @debug "";
47
+ @warn "function ms() multi-ratio: FAIL!";
48
+ @debug "function ms(-4, 12, $major-tenth $octave)";
49
+ @debug "Result: #{ms(-4, 12, $major-tenth $octave)}";
50
+ @debug "Intended: 1.92";
51
+ @debug "";
52
+ }@else {
53
+ @warn "function ms(+) multi-ratio: pass";
26
54
  }
27
55
 
28
56
  @if ms(-4, 12, $major-tenth $octave) != 1.92 {
29
- @warn "function ms() multi-ratio: FAIL";
57
+ @debug "";
58
+ @warn "function ms() multi-ratio: FAIL!";
30
59
  @debug "function ms(-4, 12, $major-tenth $octave)";
31
60
  @debug "Result: #{ms(-4, 12, $major-tenth $octave)}";
32
61
  @debug "Intended: 1.92";
62
+ @debug "";
33
63
  }@else {
34
- @debug "function ms() multi-ratio: PASS";
64
+ @warn "function ms(-) multi-ratio: pass";
35
65
  }
66
+
67
+ @if ms-list(-3, 3, 10 16, $major-third) != (6.5536 8 8.192 10 10.24 12.5 12.8) {
68
+ @debug "function ms-list(): FAIL!";
69
+ @warn "function ms-list(-3, 3, 10 16, $major-third)";
70
+ @debug "Result: (#{ms-list(-3, 3, 10 16, $major-third)})";
71
+ @debug "Intended: (6.5536 8 8.192 10 10.24 12.5 12.8)";
72
+ }@else {
73
+ @warn "function ms-list(): pass";
74
+ }
Binary file
@@ -11,7 +11,7 @@
11
11
  @if $MS-gem-exists {
12
12
 
13
13
  // Remove units from bases
14
- $Unit: nth($Bases, 1) * 0 + 1;
14
+ $Unit: nth($Bases, 1) * 0 + 1; // Extracts the unit from the base
15
15
  $Unitless-Bases: ();
16
16
  @each $Base in $Bases {
17
17
  $Base: $Base/$Unit;
@@ -28,9 +28,7 @@
28
28
  $Base-counter: 0;
29
29
 
30
30
  // Seed list with an initial value
31
- @if $Base == $Base {
32
- $MS-base-list: $Base;
33
- }
31
+ $MS-base-list: $Base;
34
32
 
35
33
  // Find values on a positive scale
36
34
  @if $Value >= 0 {
@@ -54,7 +52,7 @@
54
52
  }
55
53
 
56
54
  // Find values on a negitive scale
57
- @if $Value < 0 {
55
+ @else {
58
56
 
59
57
  // Find lower values on the scale
60
58
  $Base-counter: 1;
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modular-scale
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha5
4
+ version: 2.0.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - First Last
@@ -13,15 +14,17 @@ dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: compass
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: 0.12.0
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.12.0
27
30
  description: A generalized Compass extension to build off of
@@ -47,25 +50,29 @@ files:
47
50
  homepage: http://extension.com
48
51
  licenses:
49
52
  - MIT
50
- metadata: {}
51
53
  post_install_message:
52
54
  rdoc_options: []
53
55
  require_paths:
54
56
  - lib
55
57
  required_ruby_version: !ruby/object:Gem::Requirement
58
+ none: false
56
59
  requirements:
57
- - - '>='
60
+ - - ! '>='
58
61
  - !ruby/object:Gem::Version
59
62
  version: '0'
63
+ segments:
64
+ - 0
65
+ hash: -3329853190298866016
60
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
+ none: false
61
68
  requirements:
62
- - - '>='
69
+ - - ! '>='
63
70
  - !ruby/object:Gem::Version
64
71
  version: 1.3.6
65
72
  requirements: []
66
73
  rubyforge_project: modular-scale
67
- rubygems_version: 2.0.3
74
+ rubygems_version: 1.8.23
68
75
  signing_key:
69
- specification_version: 4
76
+ specification_version: 3
70
77
  summary: An easy to use system for writing and managing media queries.
71
78
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a41d2f097a0279165903f7426bd0892afdc08cd0
4
- data.tar.gz: eb01990d61ee5012f089180b06bd0a7ee9e4a002
5
- SHA512:
6
- metadata.gz: 5eb6c45de955c5a6eca68e69d0da7fda2f6c1a7b0657a84e78a1c3ee188b8c2a32b82b1671850728d680e18975f66873497380f646af0b49ba50c859476d6903
7
- data.tar.gz: 34d3e455fe63c42dc8d441ec158dbf086432ab1574ad4345bdf8d6126d8cf4532c2e4a1337715e9262c8d157797d8179c6dec17568b0e015e9c67f5db15dbf9b