tsscssd 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,8 +1,28 @@
1
1
  # Tsscssd
2
+ ***
2
3
 
3
- TODO: Write a gem description
4
+ Mo' CSS, no problems! Introducing Tyler's Stupid Simple Cascading Style Sheet Deco-dementor ©
4
5
 
5
- ## Installation
6
+ ***
7
+
8
+
9
+ ## What is this shit?
10
+
11
+ The TSSCSSD--sometimes pronounced "T two S C two S D" depending on level of G-ness--is a simple
12
+ CSS comment parser. Ta-da!
13
+
14
+ Having gotten fed up with overly complex solutions, I decided to write my own. KSS sucks and
15
+ CSS_Doc is BROKEN.
16
+
17
+ Besides, both were too heavy for my simple use case of "Hey man, I just wanna print my
18
+ comments out in an easy to reference style guide that is both easy on my eyes and wallet." Sub
19
+ in "sanity" for "wallet" because time is money and I have money on my mind.
20
+
21
+ The TSSCSSD will take your lame ass CSS comments, bust that shit out of their code chains, and
22
+ lay out fat stacks of tabular goodness for you all to party in. Or...lay out fat stacks of
23
+ tabular goodness in which for all you to part-ay.
24
+
25
+ ## How do I get started with this shit?
6
26
 
7
27
  Add this line to your application's Gemfile:
8
28
 
@@ -16,14 +36,83 @@ Or install it yourself as:
16
36
 
17
37
  $ gem install tsscssd
18
38
 
19
- ## Usage
39
+ ## How do I prep this shit?
40
+
41
+ *8Get crackin' on your CSS, homie!
42
+
43
+ Once you have shit handled--like HANDLED--you just need to throw down with this at the top of
44
+ your code:
45
+
46
+ /*
47
+ * Key - Value
48
+ */
49
+
50
+ You can slap as many silly ass key/value pairs as your little heart desires. A best practice
51
+ would be something like this shit:
52
+
53
+ /*
54
+ * Name - THE Shit
55
+ * Author - <a href="mailto:lilweezy@youngmoney.biz">Mr. Wayne</a>
56
+ * Description - This file is full of cash money.
57
+ */
58
+
59
+ In addition to your own silly ass key/value pairs, you get and additional couple *FOR FREE*!
60
+ These freebies are Filename (the file name...) and Dependencies (for all you mixin-ers).
61
+
62
+ Now, anything you want to have pulled out into the complimentary style guide, just comment
63
+ *directly* above the selector with a // <SPACE> to have that shit Fire in the Skied all up into
64
+ the mothership.
65
+
66
+ So like this:
67
+
68
+ // This is pretty much the dopest siz-lector.
69
+ .sizlector.the.bomb
70
+
71
+ ###LISTEN
72
+
73
+ Every file you want to have not-jacked-up style documentation has to start with this
74
+ otherwise the docu-dementor will not correctly disturb your shit and will literally
75
+ puke all over your shit.
76
+
77
+ ###IF YOU DON'T WANT SHIT DOCU-DEMENTED
78
+
79
+ That's just silly. But, for things you want skipped, add the file name to the skip array
80
+ in the command (see below for mo' info).
81
+
82
+ *Nuff said.*
83
+
84
+ When he goes for his walk of assets/stylesheets, he'll just keep on strolling like a pimp.
85
+
86
+
87
+ ##How do I set this shit OFF?
88
+
89
+ From your command line, make sure your ass in the right directory of your shit, then lay this down:
90
+
91
+ bundle exec tsscssd --appname [YOUR APP NAME] --stylesheets [PATH TO YOUR STYLESHEETS] --type [WHAT KIND OF STYLESHEETS ARE WE DEALING WITH] --output [WHERE YOU WANT THE DOPENESS] --skip [AN ARRAY OF FILES TO SKIP] =
92
+
93
+ ###Defaults
94
+
95
+ If you don't want to provide this badass with parameters, then this is what you get:
96
+
97
+ Appname = 'My dope app'
98
+ Stylesheets = CURRENT DIRECTORY + '/app/assets/stylesheets/'
99
+ @config[:output] = CURRENT DIRECTORY + '/app/public'
100
+ @config[:type] = 'scss'
101
+ @config[:skip] = ['normalize']
102
+
20
103
 
21
- TODO: Write usage instructions here
104
+ ## But...but what about all this other shit I want it to do?
22
105
 
23
- ## Contributing
106
+ If you have suggestions about how to improve the TSSCSSD, please feel free to tell your
107
+ collection of stuffed animals just before you cry yourself to sleep.
24
108
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
109
+ ....................../´¯/)
110
+ ....................,/¯../
111
+ .................../..../
112
+ ............./´¯/'...'/´¯¯`- ¸
113
+ ........../'/.../..../......./¨¯\
114
+ ........('(...´...´.... ¯~/'...')
115
+ .........\.................'...../
116
+ .........."...\.......... _.- ´
117
+ ............\..............(
118
+ ..............\.............\...
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tsscssd'
4
+ require 'optparse'
5
+
6
+ options = { :report => true }
7
+ op = OptionParser.new
8
+
9
+ op.on("-h", "--help") do
10
+ puts op.to_s
11
+ exit
12
+ end
13
+
14
+ op.on("-v", "--version") do
15
+ puts Tsscssd::VERSION
16
+ exit
17
+ end
18
+
19
+ appname_help = "What the hell shall we call this App?"
20
+ stylesheets_help = "Tell me where your delicious stylesheets are."
21
+ type_help = "Tell me how these stylesheets are written. CSS? SASS? SCSS?"
22
+ output_help = "Tell me where to lay down the fat stacks of documentation."
23
+ skip_help = "Give the filename you want to skip. JUST THE NAME...like 'normalize.'"
24
+
25
+ op.on("--appname [STRING]", appname_help) {|value| options[:appname] = value }
26
+ op.on("--stylesheets [PATH]", stylesheets_help) {|value| options[:stylesheets] = value }
27
+ op.on("--type [STRING]", type_help) {|value| options[:type] = value }
28
+ op.on("--output [PATH]", output_help) {|value| options[:output] = value }
29
+ op.on("--skip [STRING]", skip_help) {|value| options[:skip] = value }
30
+
31
+ begin
32
+ op.parse!(ARGV)
33
+ raise "Hey man...you need to pass me some paraemeter if you want this done correctly." if ARGV.empty?
34
+ Tsscssd.run!(ARGV[0], options)
35
+ rescue Exception => ex
36
+ puts ex.message
37
+ exit
38
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsscssd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -46,18 +46,13 @@ dependencies:
46
46
  description: A stupid simple automated CSS styleguide based on your comments.
47
47
  email:
48
48
  - scottt2@uw.edu
49
- executables: []
49
+ executables:
50
+ - tsscssd
50
51
  extensions: []
51
52
  extra_rdoc_files: []
52
53
  files:
53
- - .gitignore
54
- - Gemfile
55
- - LICENSE.txt
56
54
  - README.md
57
- - Rakefile
58
- - lib/tsscssd.rb
59
- - lib/tsscssd/version.rb
60
- - tsscssd.gemspec
55
+ - bin/tsscssd
61
56
  homepage: ''
62
57
  licenses:
63
58
  - MIT
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in tsscssd.gemspec
4
- gemspec
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Tyler Scott
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,115 +0,0 @@
1
- require "tsscssd/version"
2
- module Tsscssd
3
-
4
- LIB = File.dirname(__FILE__)
5
-
6
- autoload :Runner, File.join(LIB, 'tsscssd/runner')
7
- autoload :Builder, File.join(LIB, 'tsscssd/builder')
8
-
9
- def self.run!(input, config = {}, &block)
10
- Runner.new(input, config).run!(&block)
11
- end
12
-
13
- class << self
14
- attr_accessor :appname
15
- attr_accessor :stylesheets
16
- attr_accessor :output
17
- end
18
-
19
- class StyleGuide
20
- def initialize
21
- @files = []
22
- end
23
- def files
24
- @files
25
- end
26
- def addFile(file)
27
- cssFile = Tsscssd::CssFile.new(file)
28
- @files.push(cssFile)
29
- end
30
- end
31
-
32
- class CssFile
33
- def initialize(fileName)
34
- @fileName = fileName
35
- fn = fileName.split('/')
36
- fn = fn[fn.length-1]
37
- fn = fn.split('.')[0]
38
- @prettyName = fn
39
- @header = []
40
- @imports = []
41
- @comments = []
42
- @lineNumber = 0
43
- @inComment = false
44
- @comment = ''
45
- parseFile
46
- end
47
- def fileName
48
- @fileName
49
- end
50
- def prettyName
51
- @prettyName
52
- end
53
- def header
54
- @header
55
- end
56
- def imports
57
- @imports
58
- end
59
- def imports?
60
- @imports.length > 0 ? true : false
61
- end
62
- def comments
63
- @comments
64
- end
65
- def comments?
66
- @comments.length > 0 ? true : false
67
- end
68
- def parseFile
69
- File.open(fileName) do |file|
70
- while @line = file.gets
71
- @lineNumber = @lineNumber + 1
72
- if @line
73
- @line = @line.chomp
74
- @words = @line.split
75
- case @words[0]
76
- when '/*'
77
- #Begin the header comments. May need this for later.
78
- when '*'
79
- #puts 'Header Comment'
80
- headerComment = @line.split('*')
81
- value = @line.split('- ')
82
- value = value[value.length-1]
83
- key = headerComment[1].split[0]
84
- @header.push({key:key, value:value})
85
- when '*/'
86
- #End header comments. May need this for later.
87
- when '@import' # Collect those imports!
88
- #puts 'In imports | ' + @words[1].split("'")[1]
89
- @imports.push(@words[1].split("'")[1])
90
- when '//' #ID the comment. Mark as inComment for the next pass to grab the right hand side.
91
- #puts 'Inline Comment'
92
- if @inComment == false
93
- @inComment = true
94
- @comment = @line.split('// ')
95
- @comment = @comment.join.chomp
96
- end
97
- else
98
- if @inComment == true # grab the selector/variable for the comment we have ID'ed
99
- if @line[0] == '$'
100
- @line = @line.split(':')[0]
101
- elsif @line.split('{')[0].length < 2
102
- @line = @line.chomp(' {')
103
- else
104
- @line = @line.split('{')[0]
105
- end
106
- @comments.push({lineNumber:@lineNumber,selector:@line,comment:@comment})
107
- @inComment = false
108
- end
109
- end
110
- end
111
- end
112
- end
113
- end
114
- end
115
- end
@@ -1,3 +0,0 @@
1
- module Tsscssd
2
- VERSION = "0.0.2"
3
- end
@@ -1,23 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'tsscssd/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "tsscssd"
8
- spec.version = Tsscssd::VERSION
9
- spec.authors = ["Tyler Scott"]
10
- spec.email = ["scottt2@uw.edu"]
11
- spec.description = %q{A stupid simple automated CSS styleguide based on your comments.}
12
- spec.summary = %q{Mo' CSS? No problems!}
13
- spec.homepage = ""
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
23
- end