cssex 0.1.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.
Files changed (7) hide show
  1. data/.gitignore +3 -0
  2. data/README +25 -0
  3. data/Rakefile +26 -0
  4. data/VERSION +1 -0
  5. data/bin/cssex +22 -0
  6. data/cssex.gemspec +44 -0
  7. metadata +60 -0
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ **/.DS_Store
3
+ pkg/*
data/README ADDED
@@ -0,0 +1,25 @@
1
+ # install nokogiri & cssex
2
+ $ sudo gem install nokogiri
3
+ $ sudo gem install cssex
4
+
5
+ # usage
6
+ $ cssex some_html_file.html | pbcopy
7
+
8
+ # copies the css skeleton for your file to the clipboard...
9
+
10
+ #main{}
11
+ #left_rail{}
12
+ #logo{}
13
+ #blurb{}
14
+ #utility_block{}
15
+ #contributors_block{}
16
+ #categories_block{}
17
+ #tags_block{}
18
+ #right_main{}
19
+ #blog_roll_header{}
20
+ #blog_roll{}
21
+ .blog_entry{}
22
+ .preview_image{}
23
+ .entry_info{}
24
+ .date{}
25
+ .attribution{}
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/testtask'
4
+ require 'rake/rdoctask'
5
+
6
+ begin
7
+ require 'jeweler'
8
+ Jeweler::Tasks.new do |g|
9
+ g.name = 'cssex'
10
+ g.summary = %(Create CSS Skeletons from HTML files)
11
+ g.description = %(Create CSS Skeletons from HTML files)
12
+ g.email = 'signalstatic@gmail.com'
13
+ g.homepage = 'http://github.com/twoism/cssex'
14
+ g.authors = %w(twoism)
15
+ end
16
+ Jeweler::GemcutterTasks.new
17
+ rescue LoadError
18
+ puts 'Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com'
19
+ end
20
+
21
+ Rake::TestTask.new do |t|
22
+ t.libs = %w(test)
23
+ t.pattern = 'test/**/*_test.rb'
24
+ end
25
+
26
+ #task :default => :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ raise "No file specified!" unless ARGV.first
4
+
5
+ %w{rubygems nokogiri open-uri}.each { |lib| require lib }
6
+
7
+ def skeletize nodes
8
+ nodes.each do |node|
9
+ next unless node["class"] || node["id"]
10
+
11
+ str = "\t" * node.path.split("/").count
12
+ str << "##{node["id"]}" if node["id"]
13
+ str << ".#{node["class"]}" if node["class"]
14
+ str << "{}"
15
+ puts str
16
+
17
+ skeletize node.children
18
+ end
19
+ end
20
+
21
+ @doc = Nokogiri::HTML(open(ARGV.first))
22
+ skeletize @doc.css('body').children
@@ -0,0 +1,44 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{cssex}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["twoism"]
12
+ s.date = %q{2009-12-30}
13
+ s.default_executable = %q{cssex}
14
+ s.description = %q{Create CSS Skeletons from HTML files}
15
+ s.email = %q{signalstatic@gmail.com}
16
+ s.executables = ["cssex"]
17
+ s.extra_rdoc_files = [
18
+ "README"
19
+ ]
20
+ s.files = [
21
+ ".gitignore",
22
+ "README",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "bin/cssex",
26
+ "cssex.gemspec"
27
+ ]
28
+ s.homepage = %q{http://github.com/twoism/cssex}
29
+ s.rdoc_options = ["--charset=UTF-8"]
30
+ s.require_paths = ["lib"]
31
+ s.rubygems_version = %q{1.3.5}
32
+ s.summary = %q{Create CSS Skeletons from HTML files}
33
+
34
+ if s.respond_to? :specification_version then
35
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
36
+ s.specification_version = 3
37
+
38
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
39
+ else
40
+ end
41
+ else
42
+ end
43
+ end
44
+
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cssex
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - twoism
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-30 00:00:00 -05:00
13
+ default_executable: cssex
14
+ dependencies: []
15
+
16
+ description: Create CSS Skeletons from HTML files
17
+ email: signalstatic@gmail.com
18
+ executables:
19
+ - cssex
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ files:
25
+ - .gitignore
26
+ - README
27
+ - Rakefile
28
+ - VERSION
29
+ - bin/cssex
30
+ - cssex.gemspec
31
+ has_rdoc: true
32
+ homepage: http://github.com/twoism/cssex
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options:
37
+ - --charset=UTF-8
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ requirements: []
53
+
54
+ rubyforge_project:
55
+ rubygems_version: 1.3.5
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: Create CSS Skeletons from HTML files
59
+ test_files: []
60
+