asphalt 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ad0487d650796c423775e06355c7c18e144a2718
4
+ data.tar.gz: ce677999bc5ac0958580c3288be10a643c4863d5
5
+ SHA512:
6
+ metadata.gz: 17995f50c917684ce1c93454f52782c396496332ce0278950b485f5b5372d13d80e3e632caf7ac74628341f25fd864740ba69ee6b2228422f37d1e1270f7fd12
7
+ data.tar.gz: 253e028501ed8ea063e089d38c0f85446140696f3d365a6072e7d11b57b32c57b93f2d6ee9b3008bee0cf609da210ed426e401dad82f52fbb6ed0c28b40fbe01
@@ -0,0 +1,17 @@
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 ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in asphalt.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Don Okuda
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.
@@ -0,0 +1,43 @@
1
+ # Asphalt
2
+
3
+ Asphalt paves the way for your (Sass) stylesheets!
4
+
5
+
6
+ ## Introduction
7
+
8
+ The cruft of Asphalt comes from [this post on The Sass Way blog](http://www.thesassway.com/beginner/how-to-structure-a-sass-project). I wanted to try out structuring and breaking up my Sass files, but it took too much time to create all the directories and files just to get started. I created Asphalt to cut down on the time by generating the files to get started.
9
+
10
+ Feel free to read the blog post and try Asphalt out!
11
+
12
+
13
+ ## Installation
14
+
15
+ Install it from RubyGems:
16
+
17
+ $ gem install asphalt
18
+
19
+ or clone and install from this repo
20
+
21
+ $ git clone https//github.com/donokuda/asphalt.git
22
+ $ cd asphalt
23
+ $ rake install
24
+
25
+
26
+ ## Usage
27
+
28
+ In the directory of your stylesheets:
29
+
30
+ $ asphalt init
31
+
32
+ This will generate a folder structure of partialized Scss files.
33
+
34
+ That's it! Run `sass -w /path/to/stylesheet_folder/main.scss` to compile your sass files!
35
+
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it
40
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
41
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
42
+ 4. Push to the branch (`git push origin my-new-feature`)
43
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'asphalt/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "asphalt"
8
+ spec.version = Asphalt::VERSION
9
+ spec.authors = ["Don Okuda"]
10
+ spec.email = ["don.okuda@gmail.com"]
11
+ spec.description = "Asphalt paves the way for your Sass stylesheets!"
12
+ spec.summary = "Asphalt paves the way for your Sass stylesheets!"
13
+ spec.homepage = "https://github.com/donokuda/asphalt"
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
+ spec.add_dependency "thor", "~> 0.18.1"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "rspec", "~> 2.14.1"
25
+ end
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'asphalt'
@@ -0,0 +1,3 @@
1
+ require "asphalt/version"
2
+ require "asphalt/generator"
3
+ require "asphalt/cli"
@@ -0,0 +1,12 @@
1
+ require 'thor'
2
+
3
+ module Asphalt
4
+ class CLI < Thor
5
+ desc "init /path/to/stylesheets", "bootstrap directory with a set of Sass files"
6
+ def init(target_directory=Dir.pwd)
7
+ Asphalt::Generator.init!(target_directory)
8
+ end
9
+ end
10
+
11
+ CLI.start(ARGV)
12
+ end
@@ -0,0 +1,32 @@
1
+ module Asphalt
2
+ module Generator
3
+ # FIXME: TOMDOC this method and all other methods
4
+ def self.init!(directory)
5
+ directories = ["modules", "partials", "vendors"]
6
+ directories.each do |scaffold_dir|
7
+ FileUtils.mkdir_p(File.join(directory, scaffold_dir)) unless Dir.exists?(File.join(directory, scaffold_dir))
8
+ end
9
+
10
+ files = ['main.scss',
11
+ 'modules/_all.scss',
12
+ 'modules/_utility.scss',
13
+ 'modules/_colors.scss',
14
+ 'partials/_base.sass',
15
+ 'partials/_buttons.scss',
16
+ 'partials/_figures.scss',
17
+ 'partials/_grids.scss',
18
+ 'partials/_typography.scss',
19
+ 'partials/_reset.scss']
20
+
21
+ files.each do |scaffold_file|
22
+ template_file_path = File.join(File.dirname(__FILE__), 'templates', scaffold_file)
23
+ target_file = File.new(File.join(directory, scaffold_file), 'a+')
24
+
25
+ if File.exists?(template_file_path)
26
+ target_file.write(File.read(template_file_path))
27
+ target_file.close
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,17 @@
1
+ // ASPHALT GENERATED: MODULES
2
+ @import "partials/base";
3
+
4
+ // ASPHALT GENERATED: PARTIALS
5
+ @import "partials/reset";
6
+ @import "partials/typography";
7
+ @import "partials/buttons";
8
+ @import "partials/figures";
9
+ @import "partials/grids";
10
+
11
+ // Import third party styles here
12
+ // PROTIP: Be sure to change the file extension to .scss
13
+ // EXAMPLES:
14
+ // @import "vendor/colorpicker";
15
+ // @import "vendor/jquery.ui.core";
16
+
17
+ // Your styles go here:
@@ -0,0 +1,3 @@
1
+ // ASPHALT GENERATED: Modules
2
+ @import 'utility';
3
+ @import 'colors';
@@ -0,0 +1,23 @@
1
+ // Uncomment if you use compass
2
+ // @import "compass"
3
+
4
+ // Font weights
5
+ $light: 100
6
+ $regular: 400
7
+ $bold: 600
8
+
9
+ // Base Font
10
+ $base-font-family: sans-serif
11
+ $base-font-weight: $regular
12
+ $base-font-size: 13px
13
+ $base-line-height: 1.4
14
+
15
+ // Fixed Font
16
+ $fixed-font-family: monospace
17
+ $fixed-font-size: 85%
18
+ $fixed-line-height: $base-line-height
19
+
20
+ // Headings
21
+ $header-font-weight: $bold
22
+
23
+ @import "modules/all"
@@ -0,0 +1,3 @@
1
+ module Asphalt
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+
3
+ describe Asphalt::Generator do
4
+ describe "#init!" do
5
+ before(:all) do
6
+ @temp_directory = Dir.mktmpdir
7
+ puts "Temp directory: #{ @temp_directory }"
8
+ end
9
+
10
+ it "creates the target directory if it doesn't exist" do
11
+ Asphalt::Generator.init!(File.join(@temp_directory, 'new_directory'))
12
+
13
+ Dir.should exist(File.join(@temp_directory, 'new_directory'))
14
+ end
15
+
16
+ it "creates the correct set of directories and files" do
17
+ Asphalt::Generator.init!(@temp_directory)
18
+
19
+ File.should exist(File.join(@temp_directory, 'main.scss'))
20
+
21
+ Dir.should exist(File.join(@temp_directory, 'modules'))
22
+ File.should exist(File.join(@temp_directory, 'modules', '_all.scss'))
23
+ File.should exist(File.join(@temp_directory, 'modules', '_utility.scss'))
24
+ File.should exist(File.join(@temp_directory, 'modules', '_colors.scss'))
25
+
26
+ Dir.should exist(File.join(@temp_directory, 'partials'))
27
+ File.should exist(File.join(@temp_directory, 'partials', '_base.sass'))
28
+ File.should exist(File.join(@temp_directory, 'partials', '_buttons.scss'))
29
+ File.should exist(File.join(@temp_directory, 'partials', '_figures.scss'))
30
+ File.should exist(File.join(@temp_directory, 'partials', '_grids.scss'))
31
+ File.should exist(File.join(@temp_directory, 'partials', '_typography.scss'))
32
+ File.should exist(File.join(@temp_directory, 'partials', '_reset.scss'))
33
+
34
+ Dir.should exist(File.join(@temp_directory, 'vendors'))
35
+ end
36
+
37
+ it "should have content in the files generated" do
38
+ fixtures_path = File.expand_path(File.join(__FILE__, '..', 'fixtures', 'example_stylesheet_folder'))
39
+
40
+ Asphalt::Generator.init!(@temp_directory)
41
+
42
+ File.read(File.join(@temp_directory, 'main.scss')).should match(%r(// ASPHALT GENERATED: MODULES))
43
+ File.read(File.join(@temp_directory, 'partials', '_base.sass')).should match(%r(@import "modules/all"))
44
+ File.read(File.join(@temp_directory, 'modules', '_all.scss')).should match(%r(// ASPHALT GENERATED: Modules))
45
+
46
+ end
47
+
48
+ it "should append template content to existing files" do
49
+ existing_file = File.new(File.join(@temp_directory, 'main.scss'), 'w+')
50
+ existing_file << "// Existing Content\n"
51
+ existing_file.close
52
+
53
+ Asphalt::Generator.init!(@temp_directory)
54
+
55
+ existing_file_content = File.read(File.join(@temp_directory, 'main.scss'))
56
+
57
+ existing_file_content.should match("// Existing Content")
58
+ existing_file_content.should match("// ASPHALT GENERATED: MODULES")
59
+ end
60
+
61
+ after(:all) do
62
+ FileUtils.remove_entry_secure @temp_directory
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,17 @@
1
+ // ASPHALT: MODULES
2
+ @import "partials/base";
3
+
4
+ // ASPHALT: PARTIALS
5
+ @import "partials/reset";
6
+ @import "partials/typography";
7
+ @import "partials/buttons";
8
+ @import "partials/figures";
9
+ @import "partials/grids";
10
+
11
+ // Import third party styles here
12
+ // PROTIP: Be sure to change the file extension to .scss
13
+ // EXAMPLES:
14
+ // @import "vendor/colorpicker";
15
+ // @import "vendor/jquery.ui.core";
16
+
17
+ // Your styles go here:
@@ -0,0 +1,4 @@
1
+ // Include this to get all your modules
2
+ // ASPHALT GENERATED: Modules
3
+ @import 'utility';
4
+ @import 'colors';
@@ -0,0 +1,23 @@
1
+ // Uncomment if you use compass
2
+ // @import "compass"
3
+
4
+ // Font weights
5
+ $light: 100
6
+ $regular: 400
7
+ $bold: 600
8
+
9
+ // Base Font
10
+ $base-font-family: sans-serif
11
+ $base-font-weight: $regular
12
+ $base-font-size: 13px
13
+ $base-line-height: 1.4
14
+
15
+ // Fixed Font
16
+ $fixed-font-family: monospace
17
+ $fixed-font-size: 85%
18
+ $fixed-line-height: $base-line-height
19
+
20
+ // Headings
21
+ $header-font-weight: $bold
22
+
23
+ @import "modules/all"
@@ -0,0 +1,3 @@
1
+ require 'tempfile'
2
+ require 'pathname'
3
+ require 'asphalt'
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asphalt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Don Okuda
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.18.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.18.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.14.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 2.14.1
69
+ description: Asphalt paves the way for your Sass stylesheets!
70
+ email:
71
+ - don.okuda@gmail.com
72
+ executables:
73
+ - asphalt
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - asphalt.gemspec
83
+ - bin/asphalt
84
+ - lib/asphalt.rb
85
+ - lib/asphalt/cli.rb
86
+ - lib/asphalt/generator.rb
87
+ - lib/asphalt/templates/main.scss
88
+ - lib/asphalt/templates/modules/_all.scss
89
+ - lib/asphalt/templates/partials/_base.sass
90
+ - lib/asphalt/version.rb
91
+ - spec/asphalt_spec.rb
92
+ - spec/fixtures/example_stylesheet_folder/main.scss
93
+ - spec/fixtures/example_stylesheet_folder/modules/_all.scss
94
+ - spec/fixtures/example_stylesheet_folder/partials/_base.sass
95
+ - spec/spec_helper.rb
96
+ homepage: https://github.com/donokuda/asphalt
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - '>='
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.0.3
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: Asphalt paves the way for your Sass stylesheets!
120
+ test_files:
121
+ - spec/asphalt_spec.rb
122
+ - spec/fixtures/example_stylesheet_folder/main.scss
123
+ - spec/fixtures/example_stylesheet_folder/modules/_all.scss
124
+ - spec/fixtures/example_stylesheet_folder/partials/_base.sass
125
+ - spec/spec_helper.rb