color_json 0.0.1.1 → 0.0.1.2

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: ef2fce1d5de8cfe68deb6aea95d3f6a8c8b31411
4
- data.tar.gz: 55e42a683ec8fd2c36e8f08c2e34add6966713c2
3
+ metadata.gz: cde06551ff3493a9f08900a7dd30ea03e9de983d
4
+ data.tar.gz: 2d1dd04d23f777105294900ca8537fc08fc54108
5
5
  SHA512:
6
- metadata.gz: 04ca1f3e3fb3c0cbc67a78018390ab6eb42577b87e1f8f9b8a02859b86a9cfc79d6a92fa3e86d2b12eff8834fc35ad150a6e455da204b1015cdf1b7ef926aba7
7
- data.tar.gz: 7e77ad247e6a3d0edd5d74e9f93f48f44f921dbaf1ed34e507430c8ba327a609203a0dbe3a6393d562be8561dedcb1f3d07cd20ea80fea8a3803a1e9717ab36a
6
+ metadata.gz: fd790a942ca369e715e938d7c2c1fedb0b34936ac4efcf7a5508cf2a65dfab0278b167f27594b89660b8f26d89a83a6c905735a88ba60e93ef4be95552c40c85
7
+ data.tar.gz: 82fc08698643062a10b4a6959cb59126423095fed264eee2856b296a7316b48cd2f9bdbbfcaf57ff8ad03f0fb5745e60bdeb730254b658b53489b07fc14d9115
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ColorJson
2
2
 
3
- Easy way to show your sass/scss/less color list.
3
+ Easy way to show your `sass/scss/less color` list.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,12 +20,77 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ color_json build <filename>
24
24
 
25
- ## Contributing
25
+ then you would got your `color.json` file!
26
26
 
27
- 1. Fork it ( https://github.com/[my-github-username]/color_json/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
27
+ ### Example
28
+
29
+ #### Basic usage
30
+ `no_group.scss`:
31
+
32
+ ```scss
33
+ $aqua: #7FDBFF;
34
+ $blue: #0074D9;
35
+ $navy: #001F3F;
36
+ $teal: #39CCCC;
37
+ ```
38
+
39
+ it would generate:
40
+
41
+ `color.json`:
42
+
43
+ ```json
44
+ "color": {
45
+ "$aqua": " #7FDBFF;",
46
+ "$blue": " #0074D9;",
47
+ "$navy": " #001F3F;",
48
+ "$teal": " #39CCCC;"
49
+ }
50
+ ```
51
+ #### Group usage
52
+
53
+ You can use `//**` to label your color usage.
54
+
55
+ `group.scss`:
56
+
57
+ ```scss
58
+ //** main color
59
+ $aqua: #7FDBFF;
60
+ $blue: #0074D9;
61
+
62
+ //** other
63
+ $yellow: #FFDC00;
64
+ $orange: #FF851B;
65
+ ```
66
+
67
+ it would generate:
68
+
69
+ `color.json`:
70
+ ```json
71
+ "color": {
72
+ "main color": {
73
+ "$aqua": " #7FDBFF;",
74
+ "$blue": " #0074D9;"
75
+ },
76
+ "other": {
77
+ "$yellow": " #FFDC00;",
78
+ "$orange": " #FF851B;"
79
+ }
80
+ }
81
+ ```
82
+
83
+ ## What the color.json can do?
84
+
85
+ `color.json` can combine with [canner](github.com/canner/canner) and help you show your color list very quickly.
86
+
87
+
88
+ ## Issue
89
+
90
+ This gem has many needs for imporvement.
91
+
92
+ Feel free to fork it and pull request.
93
+
94
+ ## License
95
+
96
+ [@ctxhou](github.com/ctxhou) MIT
data/Rakefile CHANGED
@@ -1,2 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+
4
+ desc "test build"
5
+ task :bu do
6
+ file = ARGV.last
7
+ bundle exec "bin/color_json build " + file
8
+ end
@@ -0,0 +1,7 @@
1
+ //** main color
2
+ $aqua: #7FDBFF;
3
+ $blue: #0074D9;
4
+
5
+ //** other
6
+ $yellow: #FFDC00;
7
+ $orange: #FF851B;
@@ -0,0 +1,7 @@
1
+ $aqua: #7FDBFF;
2
+ $blue: #0074D9;
3
+ $navy: #001F3F;
4
+ $teal: #39CCCC;
5
+ $green: #2ECC40;
6
+ $olive: #3D9970;
7
+ $lime: #01FF70;
data/lib/color_json.rb CHANGED
@@ -31,7 +31,7 @@ module ColorJson
31
31
  end
32
32
 
33
33
  File.open('color.json', "w") do |f|
34
- f << color_json.to_json
34
+ f << JSON.pretty_generate(color_json)
35
35
  end
36
36
  end
37
37
  end
@@ -0,0 +1,12 @@
1
+ require 'thor'
2
+ require "color_json"
3
+
4
+ module Cli
5
+ class Application < Thor
6
+ default_task :help
7
+ desc 'build FILE', 'Input your file and generate the color json file.'
8
+ def build(file)
9
+ ColorJson.build(file)
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module ColorJson
2
- VERSION = "0.0.1.1"
2
+ VERSION = "0.0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.1
4
+ version: 0.0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ctxhou
@@ -67,7 +67,10 @@ files:
67
67
  - Rakefile
68
68
  - bin/color_json
69
69
  - color_json.gemspec
70
+ - example/example.scss
71
+ - example/no_group.scss
70
72
  - lib/color_json.rb
73
+ - lib/color_json/cli/application.rb
71
74
  - lib/color_json/version.rb
72
75
  homepage: ''
73
76
  licenses: