richcss 0.1.0 → 0.1.1

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: 09d0e0a3a4e317c7dafce1aa4d3c1fc5cd2b6e1f
4
- data.tar.gz: 411df6d822124af8ec79443d4afc5c48131518fe
3
+ metadata.gz: a5b6b90698223074a76b41789f4b12deed13e108
4
+ data.tar.gz: 6b965d13e56d1c3dc481c8b03c451829915337e8
5
5
  SHA512:
6
- metadata.gz: 2877d5bea707c176149564ba298572015a8c13e0bb754bdceaaf475f2ce524fe537b0ea00181cce8aae4455f2a49e888038d126ba3d82a0837fcf87e46ce991a
7
- data.tar.gz: ff506b25f7dcec0ad306896a2462c2b489081b1353415dbdf6f8b47f56beecfaed9d31ae2de5c367ab194f8d1592237b21379bf0114ef0f8f5e6c829df01fed3
6
+ metadata.gz: 54be27b64f8adcad69dff47d2a2ed4ef5432694599776c53342fe026dd52e91090ec9b13ada65d930eddfe9370321954aac418ba5160169d342bf8998175e60e
7
+ data.tar.gz: b1b4ff98903cc82101f4659de0975e9fed0c6444342feb5e45f6c61a0c1643506c5f098c5c89aae3cac9175c692f63a3bfa51e9359fcb119fdce7c5d6ce0c1bc
data/README.md CHANGED
@@ -28,9 +28,9 @@ Or install it yourself as:
28
28
 
29
29
  To start, in the directory where you want to put all your CSS, run
30
30
 
31
- $ richcss init
31
+ $ richcss init [css/scss]
32
32
 
33
- to create the skeleton structure. Currently, only CSS is supported by `init`.
33
+ to create the skeleton structure. Currently, only CSS and SCSS is supported by `init`. The default option is CSS is the user does not state which file format to use.
34
34
 
35
35
  #### Using RichCSS parts
36
36
 
@@ -44,7 +44,7 @@ The version is optional and will default to the latest version of that part.
44
44
 
45
45
  Generate the necessary files for your Part with
46
46
 
47
- $ richcss part init <PART_NAME>
47
+ $ richcss part init <PART_NAME> [css/scss]
48
48
 
49
49
  #### Publishing your Part for others to use
50
50
 
data/lib/richcss/cli.rb CHANGED
@@ -3,7 +3,7 @@ require 'richcss'
3
3
 
4
4
  module RichcssCLI
5
5
  class Part < Thor
6
- desc "init <PART_NAME>", "Generate a skeleton directory for your new Rich CSS part"
6
+ desc "init <PART_NAME> [css/scss]", "Generate a skeleton directory for your new Rich CSS part, either css or scss files"
7
7
  # part_name
8
8
  # |--- lib
9
9
  # | |--- elements
@@ -12,8 +12,12 @@ module RichcssCLI
12
12
  # | | |--- ...
13
13
  # |--- part_name.spec
14
14
  # |--- README.md
15
- def init(part)
16
- Richcss::Generators::PartTemplate.start([part])
15
+ def init(part, extension="css")
16
+ if (extension.eql?("css") || extension.eql?("scss"))
17
+ Richcss::Generators::PartTemplate.start([part, extension])
18
+ else
19
+ puts "Only support css or scss extension, default is css"
20
+ end
17
21
  end
18
22
 
19
23
  desc "check [PART_PATH]", "Validate folder/file structure of the Rich CSS part, optionally passing in a path"
@@ -43,15 +47,19 @@ module RichcssCLI
43
47
  end
44
48
 
45
49
  class Cli < Thor
46
- desc "init", "Initialize current directory to follow the Rich CSS framework"
50
+ desc "init [css/scss]", "Initialize current directory to follow the Rich CSS framework, either css or scss files"
47
51
  # elements
48
52
  # |--- ...
49
53
  # box
50
54
  # |--- ...
51
55
  # parts
52
56
  # |--- ...
53
- def init()
54
- Richcss::Generators::Template.start()
57
+ def init(extension="css")
58
+ if (extension.eql?("css") || extension.eql?("scss"))
59
+ Richcss::Generators::Template.start([extension])
60
+ else
61
+ puts "Only support css or scss extension, default is css"
62
+ end
55
63
  end
56
64
 
57
65
  desc "install <PART> [VERSION]", "Install the part requested into the Parts directory"
@@ -5,6 +5,9 @@ module Richcss
5
5
  module Generators
6
6
  class Template < Thor::Group
7
7
  include Thor::Actions
8
+
9
+ # Args is [extension]
10
+ argument :arguments, :type => :array
8
11
 
9
12
  def self.source_root
10
13
  File.dirname(__FILE__) + "/generator"
@@ -15,6 +18,7 @@ module Richcss
15
18
  @boxFiles = ['blocks', 'main', 'positioning']
16
19
  @elementFiles = ['button', 'colors', 'features', 'fonts', 'images', 'inputs', 'lists']
17
20
  @partFiles = ['Partfile']
21
+ @extension = "." + arguments[0];
18
22
  end
19
23
 
20
24
  def create_folders
@@ -24,16 +28,12 @@ module Richcss
24
28
  end
25
29
 
26
30
  def create_css_files
27
- # TODO: add choice of CSS or SCSS files to generate
28
- # TODO: Make it not hardcode box/elements
29
- extension = ".css"
30
- # extension = ".css.scss"
31
31
  @boxFiles.each do |filename|
32
- create_file "box/#{filename}#{extension}" unless File.file?("box/#{filename}#{extension}")
32
+ create_file "box/#{filename}#{@extension}" unless File.file?("box/#{filename}#{@extension}")
33
33
  end
34
34
 
35
35
  @elementFiles.each do |filename|
36
- create_file "elements/#{filename}#{extension}" unless File.file?("elements/#{filename}#{extension}")
36
+ create_file "elements/#{filename}#{@extension}" unless File.file?("elements/#{filename}#{@extension}")
37
37
  end
38
38
  end
39
39
 
@@ -45,7 +45,10 @@ module Richcss
45
45
  class PartTemplate < Thor::Group
46
46
  include Thor::Actions
47
47
 
48
- argument :part_name, :type => :array
48
+ # Args is [part_name, extension]
49
+ argument :arguments, :type => :array
50
+
51
+
49
52
  # argument :part, :type => :array
50
53
  # argument :part_name, :type => :string
51
54
 
@@ -54,10 +57,11 @@ module Richcss
54
57
  end
55
58
 
56
59
  def init
57
- @name = part_name.first
60
+ @name = arguments[0]
58
61
  @groups = ['box', 'elements']
59
62
  @boxFiles = ['blocks', 'main', 'positioning']
60
63
  @elementFiles = ['button', 'colors', 'features', 'fonts', 'images', 'inputs', 'lists']
64
+ @extension = "." + arguments[1];
61
65
  end
62
66
 
63
67
  def create_folders
@@ -69,16 +73,12 @@ module Richcss
69
73
  end
70
74
 
71
75
  def create_css_files
72
- # TODO: add choice of CSS or SCSS files to generate
73
- # TODO: Make it not hardcode box/elements
74
- extension = ".css"
75
- # extension = ".css.scss"
76
76
  @boxFiles.each do |filename|
77
- create_file "#{@name}/lib/box/#{filename}#{extension}" unless File.file?("#{@name}/lib/box/#{filename}#{extension}")
77
+ create_file "#{@name}/lib/box/#{filename}#{@extension}" unless File.file?("#{@name}/lib/box/#{filename}#{@extension}")
78
78
  end
79
79
 
80
80
  @elementFiles.each do |filename|
81
- create_file "#{@name}/lib/elements/#{filename}#{extension}" unless File.file?("#{@name}/lib/elements/#{filename}#{extension}")
81
+ create_file "#{@name}/lib/elements/#{filename}#{@extension}" unless File.file?("#{@name}/lib/elements/#{filename}#{@extension}")
82
82
  end
83
83
  end
84
84
 
@@ -1,3 +1,3 @@
1
1
  module Richcss
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richcss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Lo, Gabriel Cheng, Bill Xu, Jonathan Lai, David Zhu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-13 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler