sass-color-extractor 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +54 -0
- data/.ruby-version +1 -1
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/lib/sass_color_extractor/base.rb +4 -1
- data/lib/sass_color_extractor/version.rb +1 -1
- data/sass_color_extractor.gemspec +2 -1
- data/spec/fixtures/test_colors.sass +11 -0
- data/spec/fixtures/test_colors.scss +12 -0
- data/spec/{sass_color_extractor_base_spec.rb → sass_color_extractor/base_spec.rb} +5 -1
- metadata +24 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 50bef27e591f36b32568c6374179e3486faf3fe4aed49e16120be05f8c1051d8
|
4
|
+
data.tar.gz: f0547e4fbd35369a7f2a03af36edc9aa9a565bcd0bb3119105f3a01d101fc719
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20a2012fb425285d262a94456fed8838d3ce5ceb1474512d62e51b7b6330df40e62eaabbd9626994c6e73f855b235627eceda7f7a30a1da14d2b2bf36490a4eb
|
7
|
+
data.tar.gz: 0b59366623ff3bbb2c0f6840dfd0530aa819c7b16811b657861683b61b99cb30217679b81a106cfbe9c8685c7480fe5dc70c7b3c6c67cffa7a5ea770d9b99b19
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# This configuration was automatically generated from a CircleCI 1.0 config.
|
2
|
+
# It should include any build commands you had along with commands that CircleCI
|
3
|
+
# inferred from your project structure. We strongly recommend you read all the
|
4
|
+
# comments in this file to understand the structure of CircleCI 2.0, as the idiom
|
5
|
+
# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather
|
6
|
+
# than the prescribed lifecycle of 1.0. In general, we recommend using this generated
|
7
|
+
# configuration as a reference rather than using it in production, though in most
|
8
|
+
# cases it should duplicate the execution of your original 1.0 config.
|
9
|
+
version: 2
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
parallelism: 1
|
13
|
+
shell: /bin/bash --login
|
14
|
+
|
15
|
+
environment:
|
16
|
+
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
17
|
+
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
18
|
+
docker:
|
19
|
+
- image: circleci/ruby:2.5.1-node-browsers
|
20
|
+
steps:
|
21
|
+
- checkout
|
22
|
+
- restore_cache:
|
23
|
+
keys:
|
24
|
+
# This branch if available
|
25
|
+
- v1-dep-{{ .Branch }}-
|
26
|
+
# Default branch if not
|
27
|
+
- v1-dep-development-
|
28
|
+
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch set properly
|
29
|
+
- v1-dep-
|
30
|
+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
31
|
+
- run:
|
32
|
+
shell: /bin/bash
|
33
|
+
name: Machine Setup
|
34
|
+
command: |-
|
35
|
+
sudo gem update --system
|
36
|
+
sudo gem install bundle rake
|
37
|
+
- run:
|
38
|
+
shell: /bin/bash
|
39
|
+
name: Bundle install
|
40
|
+
command: |-
|
41
|
+
bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
42
|
+
bundle exec bundle-audit update && bundle exec bundle-audit check
|
43
|
+
- run:
|
44
|
+
name: Ruby Tests (rspec)
|
45
|
+
command: bundle exec rspec --color --tty --format progress spec
|
46
|
+
- save_cache:
|
47
|
+
key: v1-dep-{{ .Branch }}-{{ epoch }}
|
48
|
+
paths:
|
49
|
+
- vendor/bundle
|
50
|
+
- ~/.bundle
|
51
|
+
- store_test_results:
|
52
|
+
path: /tmp/circleci-test-results
|
53
|
+
- store_artifacts:
|
54
|
+
path: /tmp/circleci-test-results
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "byebug"
|
1
2
|
module SassColorExtractor
|
2
3
|
class Base
|
3
4
|
DEFAULT_SYNTAX = :scss
|
@@ -5,7 +6,9 @@ module SassColorExtractor
|
|
5
6
|
def self.parse_colors(sass_file)
|
6
7
|
syntax = guess_syntax(sass_file)
|
7
8
|
engine = Sass::Engine.for_file(sass_file, syntax: syntax)
|
8
|
-
colors = VariableEvaluator.visit(engine.to_tree).
|
9
|
+
colors = VariableEvaluator.visit(engine.to_tree).each_with_object({}) do |(name, color), acc|
|
10
|
+
acc[name] = color if name && color
|
11
|
+
end
|
9
12
|
Hash[colors.map{|name, color| [ name, color.to_s.gsub(/^#/,'') ]}]
|
10
13
|
end
|
11
14
|
|
@@ -21,7 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "sass", "~> 3.4"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.7"
|
24
|
-
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rake"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.5"
|
26
26
|
spec.add_development_dependency "byebug", "~> 3.5"
|
27
|
+
spec.add_development_dependency "bundle-audit", "~> 0.1.0"
|
27
28
|
end
|
@@ -5,6 +5,7 @@ $red: #ff0000
|
|
5
5
|
$yellr: #fc2
|
6
6
|
$light_yellr: lighten($yellr, 20%)
|
7
7
|
$dark_yellr: darken($yellr, 10%)
|
8
|
+
$orangey: rgba(200,100,10, 0.2)
|
8
9
|
|
9
10
|
@mixin this
|
10
11
|
color: whatever
|
@@ -12,3 +13,13 @@ $dark_yellr: darken($yellr, 10%)
|
|
12
13
|
overflow:hidden
|
13
14
|
|
14
15
|
// empty line and comment line
|
16
|
+
|
17
|
+
// conditionals
|
18
|
+
|
19
|
+
// Conditionals
|
20
|
+
$dynamic-color: yellow
|
21
|
+
|
22
|
+
@if $external-setting == true
|
23
|
+
$dynamic-color: blue
|
24
|
+
@else
|
25
|
+
$dynamic-color: red
|
@@ -7,8 +7,20 @@ $white: #ffffff;
|
|
7
7
|
|
8
8
|
$light_yellr: lighten($yellr, 20%);
|
9
9
|
$dark_yellr: darken($yellr, 10%);
|
10
|
+
$orangey: rgba(200,100,10, 0.2);
|
10
11
|
|
11
12
|
@mixin this { color: whatever; }
|
12
13
|
.style { overflow:hidden; }
|
13
14
|
|
14
15
|
// empty line and comment line
|
16
|
+
|
17
|
+
|
18
|
+
// Conditionals
|
19
|
+
$dynamic-color: yellow;
|
20
|
+
|
21
|
+
@if $external-setting == true {
|
22
|
+
$dynamic-color: blue;
|
23
|
+
}
|
24
|
+
@else {
|
25
|
+
$dynamic-color: red;
|
26
|
+
}
|
@@ -13,7 +13,9 @@ describe SassColorExtractor::Base do
|
|
13
13
|
"white" => "ffffff",
|
14
14
|
"red" => "ff0000",
|
15
15
|
"yellr" => "fc2",
|
16
|
+
"dynamic-color" => "yellow",
|
16
17
|
"light_yellr" => "ffe488",
|
18
|
+
"orangey" => "rgba(200, 100, 10, 0.2)",
|
17
19
|
"dark_yellr" => "eeb700"
|
18
20
|
})
|
19
21
|
end
|
@@ -28,8 +30,10 @@ describe SassColorExtractor::Base do
|
|
28
30
|
"white" => "ffffff",
|
29
31
|
"red" => "ff0000",
|
30
32
|
"yellr" => "fc2",
|
33
|
+
"dynamic-color" => "yellow",
|
31
34
|
"light_yellr" => "ffe488",
|
32
|
-
"
|
35
|
+
"orangey" => "rgba(200, 100, 10, 0.2)",
|
36
|
+
"dark_yellr" => "eeb700",
|
33
37
|
})
|
34
38
|
end
|
35
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-color-extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mr Rogers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.5'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundle-audit
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.1.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.1.0
|
83
97
|
description:
|
84
98
|
email:
|
85
99
|
- jon@rcode5.com
|
@@ -87,6 +101,7 @@ executables: []
|
|
87
101
|
extensions: []
|
88
102
|
extra_rdoc_files: []
|
89
103
|
files:
|
104
|
+
- ".circleci/config.yml"
|
90
105
|
- ".gitignore"
|
91
106
|
- ".ruby-version"
|
92
107
|
- Gemfile
|
@@ -100,7 +115,7 @@ files:
|
|
100
115
|
- sass_color_extractor.gemspec
|
101
116
|
- spec/fixtures/test_colors.sass
|
102
117
|
- spec/fixtures/test_colors.scss
|
103
|
-
- spec/
|
118
|
+
- spec/sass_color_extractor/base_spec.rb
|
104
119
|
- spec/sass_color_extractor_spec.rb
|
105
120
|
- spec/spec_helper.rb
|
106
121
|
homepage: https://github.com/rcode5/sass_color_extractor
|
@@ -123,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
138
|
version: '0'
|
124
139
|
requirements: []
|
125
140
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.7.6
|
127
142
|
signing_key:
|
128
143
|
specification_version: 4
|
129
144
|
summary: Extract colors from Sass/Scss in ruby - can be used to generate a nice palette
|
@@ -131,6 +146,6 @@ summary: Extract colors from Sass/Scss in ruby - can be used to generate a nice
|
|
131
146
|
test_files:
|
132
147
|
- spec/fixtures/test_colors.sass
|
133
148
|
- spec/fixtures/test_colors.scss
|
134
|
-
- spec/
|
149
|
+
- spec/sass_color_extractor/base_spec.rb
|
135
150
|
- spec/sass_color_extractor_spec.rb
|
136
151
|
- spec/spec_helper.rb
|