sassy-namespaces 0.1.7 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cae3367beb96d1a54314cea08184a272d697241
4
- data.tar.gz: 2b80ab729192867bf2bc09bd18670beeefa040df
3
+ metadata.gz: 5f41eff1f2096c40e52cc367afc69dde0a3182a7
4
+ data.tar.gz: db5f40592b98117154b18d0a040adc0892b68a37
5
5
  SHA512:
6
- metadata.gz: dc3e078d248c619f443b0c5825817e04a7d78a841ab1410c60d86b32baf184e4cd483f5e669d4bcb784f49aae9a29fe1dc8650213d569489e684f19cac60ac28
7
- data.tar.gz: 42eef5163e72d8cee6d363bd227faa899233d672b4ea1faa39e17644de13607014442720a92fba64963a4623efc1175536db69f120d9e9c20245c4658d6e46f6
6
+ metadata.gz: 8d6df393bc26fbd445369a2e07b7ed8a1abc320326233fa97e91fe2463f979b27448cb2107ef714b49df15d926b98d15051c825304758e07bf596b893933abe5
7
+ data.tar.gz: 122fd23b474e789ff3ca3c077d08758e26c443ae211614df6a2f3c15a1302b52a9f5848568adc4949b3821760c6da752b388307dcf364b3f1deb17f673d05f8c
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ Changelog
2
+ ==============
3
+
4
+ 0.2.0 (7/17/14)
5
+ ---------------
6
+ - Add unit tests using True
7
+ - Code clean-up
8
+ - Remove Compass dependency
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Andrew Clark
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1,10 +1,20 @@
1
- require 'compass'
2
1
  require 'sassy-maps'
3
2
 
4
- extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
5
- Compass::Frameworks.register('sassy-namespaces', :path => extension_path)
3
+ stylesheets_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'sass'))
4
+
5
+ begin
6
+ require 'compass'
7
+ Compass::Frameworks.register('sassy-namespaces', :stylesheets_directory => stylesheets_path)
8
+ rescue LoadError
9
+ # compass not found, register on the Sass path via the environment.
10
+ if ENV.key? 'SASS_PATH'
11
+ ENV['SASS_PATH'] += File::PATH_SEPARATOR + stylesheets_path
12
+ else
13
+ ENV['SASS_PATH'] = stylesheets_path
14
+ end
15
+ end
6
16
 
7
17
  module SassyNamespaces
8
- VERSION = "0.1.7"
9
- DATE = "2014-03-20"
18
+ VERSION = "0.2.0"
19
+ DATE = "2014-07-17"
10
20
  end
@@ -6,17 +6,14 @@ $__sassy-namespaces: ();
6
6
  // Add a key-value pair to an existing namespace, or to a new one if it doesn't already exist
7
7
  // Returns the updated namespace map
8
8
  @function namespace-set($name, $args...) {
9
- $length: length($args);
10
- $namespace: map-get($__sassy-namespaces, $name) or ($name: ());
11
-
9
+ $namespace: map-get($__sassy-namespaces, $name) or ();
10
+
12
11
  @if length($args) == 1 {
13
12
  @if type-of(nth($args, 1)) == map {
14
13
  $namespace: map-merge($namespace, nth($args, 1));
15
- } @else {
16
- @warn "Must pass either a map or a key and a value.";
17
14
  }
18
15
  }
19
- @else {
16
+ @else if length($args) > 1 {
20
17
  $keys: nth($args, 1);
21
18
 
22
19
  @if length($keys) == 1 {
@@ -30,21 +27,19 @@ $__sassy-namespaces: ();
30
27
  @return $namespace;
31
28
  }
32
29
 
33
-
34
30
  // Return value for key of a namespace
35
31
  // Returns null if key or namespace doesn't exist
36
32
  @function namespace-get($name, $args...) {
37
- $length: length($args) + 1;
38
33
  $namespace: map-get($__sassy-namespaces, $name);
39
34
 
40
35
  @if not $namespace {
41
36
  @return null;
42
37
  }
43
38
 
44
- @if $length == 1 {
39
+ @if length($args) == 0 {
45
40
  @return $namespace;
46
41
  }
47
- @else if $length == 2 {
42
+ @else if length($args) == 1 {
48
43
  $keys: nth($args, 1);
49
44
 
50
45
  @if length($keys) == 1 {
@@ -53,9 +48,8 @@ $__sassy-namespaces: ();
53
48
  @return map-get-deep($namespace, $args...);
54
49
  }
55
50
  }
56
- @else {
57
- @return null;
58
- }
51
+
52
+ @return null;
59
53
  }
60
54
 
61
55
  @function namespace($name, $args...) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassy-namespaces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-20 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -16,28 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
19
+ version: 3.3.0
20
+ - - "<"
25
21
  - !ruby/object:Gem::Version
26
- version: '3.3'
27
- - !ruby/object:Gem::Dependency
28
- name: compass
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0.12'
22
+ version: '3.5'
34
23
  type: :runtime
35
24
  prerelease: false
36
25
  version_requirements: !ruby/object:Gem::Requirement
37
26
  requirements:
38
27
  - - ">="
39
28
  - !ruby/object:Gem::Version
40
- version: '0.12'
29
+ version: 3.3.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.5'
41
33
  - !ruby/object:Gem::Dependency
42
34
  name: sassy-maps
43
35
  requirement: !ruby/object:Gem::Requirement
@@ -45,6 +37,9 @@ dependencies:
45
37
  - - ">="
46
38
  - !ruby/object:Gem::Version
47
39
  version: 0.3.2
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.5'
48
43
  type: :runtime
49
44
  prerelease: false
50
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,21 +47,36 @@ dependencies:
52
47
  - - ">="
53
48
  - !ruby/object:Gem::Version
54
49
  version: 0.3.2
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.5'
55
53
  description: Namespaces in Sass, minus the headaches.
56
54
  email:
57
55
  - acdlite@me.com
58
56
  executables: []
59
57
  extensions: []
60
- extra_rdoc_files: []
58
+ extra_rdoc_files:
59
+ - CHANGELOG.md
60
+ - LICENSE.txt
61
+ - README.md
62
+ - lib/sassy-namespaces.rb
61
63
  files:
64
+ - CHANGELOG.md
65
+ - LICENSE.txt
62
66
  - README.md
63
67
  - lib/sassy-namespaces.rb
64
- - stylesheets/_sassy-namespaces.scss
68
+ - sass/_sassy-namespaces.scss
65
69
  homepage: https://github.com/acdlite/sassy-namespaces
66
70
  licenses: []
67
71
  metadata: {}
68
72
  post_install_message:
69
- rdoc_options: []
73
+ rdoc_options:
74
+ - "--line-numbers"
75
+ - "--inline-source"
76
+ - "--title"
77
+ - sassy-namespaces
78
+ - "--main"
79
+ - README.md
70
80
  require_paths:
71
81
  - lib
72
82
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -78,11 +88,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
88
  requirements:
79
89
  - - ">="
80
90
  - !ruby/object:Gem::Version
81
- version: 1.3.6
91
+ version: '0'
82
92
  requirements: []
83
- rubyforge_project: sassy-namespaces
93
+ rubyforge_project:
84
94
  rubygems_version: 2.2.2
85
95
  signing_key:
86
- specification_version: 4
87
- summary: Syntactic sugar for using maps as namespaces.
96
+ specification_version: 3
97
+ summary: Namespaces in Sass, minus the headaches.
88
98
  test_files: []