starch 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6b6a4173185bf8ea05853f031b42dbfac996ca55
4
+ data.tar.gz: b37598511ef6e085c5627a7946f31523e37cd03d
5
+ SHA512:
6
+ metadata.gz: 41681de3cf1828e9b02b1952362d86d6694d85d3421e1edff66e0cc251d97e56d023a9c4c7677220ea96b9d866ac32cdcb2b91713a32aac71cf1193375348c31
7
+ data.tar.gz: afa8d6c38037998b9e70bbd1db167642f1418c002f457deac637ad5f49a4e4923b893cb83b136710f2c88881f89ed4b702cc0486570244ca97717e247855445b
data/.gitignore ADDED
@@ -0,0 +1,22 @@
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
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in starch.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Brian O'Keefe
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/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # Starch
2
+
3
+ Starch is an opinionated skeleton generator for basic static site development.
4
+ It will get you going on new sites quickly by generating the meat and *potatoes*
5
+ of your toolchain. Starch gets you:
6
+
7
+ * A simple directory structure
8
+ * Barebones `bower.json` and `package.json` files for easily saving bower and
9
+ npm dependencies
10
+ * SASS compilation
11
+ * JS uglification
12
+ * Coffeescript compilation
13
+ * A preview server with livereload
14
+ * The ability to build a production-ready version of your site
15
+
16
+ ## Prerequisites
17
+
18
+ * [NodeJS](http://nodejs.org) with `npm`
19
+
20
+ ## Installation
21
+
22
+ $ gem install starch
23
+
24
+ ## Usage
25
+
26
+ To scaffold a new site named `mysite`:
27
+
28
+ $ starch new mysite
29
+
30
+ Starch will create a directory `mysite` within the current directory that looks
31
+ like this:
32
+
33
+ mysite
34
+ ├── Gruntfile.js
35
+ ├── app
36
+ │   └── assets
37
+ | ├── files
38
+ | ├── fonts
39
+ | ├── images
40
+ │   ├── js
41
+ │   └── stylesheets
42
+ │   └── main.scss
43
+ ├── bower.json
44
+ ├── node_modules
45
+ │   └── ...
46
+ └── package.json
47
+
48
+ * Your site's HTML can live anywhere in the `app` directory (preferably outside
49
+ of `assets`)
50
+ * Javascript and Coffeescript should live in `app/assets/js/`
51
+ * Javascript files should have a `.js` extension and Coffeescript files should
52
+ have a `.coffee` extension
53
+ * SASS should live in `app/assets/stylesheets/`
54
+ * The only SASS file that will be compiled is
55
+ `app/assets/stylesheets/main.scss`. This file should be used to import the
56
+ rest of your SASS.
57
+ * Images, fonts, and any other static assets should live in `images`, `fonts`,
58
+ and `files` (all in `app/assets`), respectively. These files will be copied
59
+ 1:1 without any additional processing.
60
+
61
+ By default, your site will be built 1:1 with the `app` directory, so you can
62
+ reference assets in your site like: `/assets/images/spuds.png`.
63
+
64
+ ### Grunt tasks
65
+
66
+ The entirety of the Starch toolchain is accessible through
67
+ [Grunt](http://gruntjs.com). There are quite a few tasks defined in the
68
+ Gruntfile, but there are only three that you should really care about:
69
+
70
+ * `grunt serve`: Builds your site for staging and starts a preview server on
71
+ `http://0.0.0.0:8000`. `livereload` is enabled, so any time the `app`
72
+ directory changes, the site will be automatically refreshed in your browser.
73
+ Neat!
74
+ * `grunt build`: Builds your site for production into the `public_html`
75
+ directory.
76
+ * `grunt clean`: Nukes the `staging` and `public_html` directories. You can be
77
+ more specific with `grunt clean:staging` and `grunt clean:build`,
78
+ respectively.
79
+
80
+ ### It's just a scaffolder
81
+
82
+ Starch is meant to provide a solid starting point for new projects; however, it
83
+ may not always meet your particular needs. You're encouraged to modify the
84
+ generated Gruntfile (or anything else) to meet the requirements of your project.
85
+
86
+ ## Contributing
87
+
88
+ 1. Fork it ( https://github.com/[my-github-username]/starch/fork )
89
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
90
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
91
+ 4. Push to the branch (`git push origin my-new-feature`)
92
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'cucumber/rake/task'
3
+
4
+ Bundler::GemHelper.install_tasks
5
+ Cucumber::Rake::Task.new
6
+
7
+ task :default => :cucumber
8
+
data/bin/starch ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'starch'
3
+ Starch::Generator.start
4
+
@@ -0,0 +1,27 @@
1
+ Feature: scaffolding a site
2
+
3
+ Scenario: Scaffold a new site
4
+ When I run `bundle exec starch new foo`
5
+ Then the following directories should exist:
6
+ | foo |
7
+ | foo/node_modules |
8
+ | foo/app |
9
+ | foo/app/assets/files |
10
+ | foo/app/assets/fonts |
11
+ | foo/app/assets/images |
12
+ | foo/app/assets/js |
13
+ | foo/app/assets/stylesheets |
14
+ And the following files should exist:
15
+ | foo/Gruntfile.js |
16
+ | foo/package.json |
17
+ | foo/bower.json |
18
+ | foo/app/assets/stylesheets/main.scss |
19
+ And the file "foo/package.json" should contain:
20
+ """
21
+ "name": "foo",
22
+ """
23
+ And the file "foo/bower.json" should contain:
24
+ """
25
+ "name": "foo",
26
+ """
27
+ And the output should contain "foo created"
File without changes
@@ -0,0 +1,6 @@
1
+ require 'aruba/cucumber'
2
+
3
+ Before do
4
+ @aruba_timeout_seconds = 30
5
+ end
6
+
data/lib/starch.rb ADDED
@@ -0,0 +1,3 @@
1
+ require 'starch/version'
2
+ require 'starch/generator'
3
+
@@ -0,0 +1,27 @@
1
+ require 'thor'
2
+
3
+ module Starch
4
+ class Generator < Thor
5
+ include Thor::Actions
6
+
7
+ attr_accessor :name
8
+
9
+ # gem root relative to here
10
+ source_root File.expand_path File.join(__FILE__, '..', '..', '..')
11
+
12
+ desc 'new [NAME]', 'Scaffold a new site named [NAME]'
13
+ def new(name)
14
+ # make sure name can be used in ERB
15
+ @name = name
16
+
17
+ say 'Generating skeleton', :yellow
18
+ directory 'skel', name
19
+
20
+ say 'Running `npm install`', :yellow
21
+ system "cd #{name}; npm install"
22
+
23
+ say "#{name} created", :green
24
+ end
25
+ end
26
+ end
27
+
@@ -0,0 +1,3 @@
1
+ module Starch
2
+ VERSION = "0.1.0"
3
+ end
data/skel/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ .sass-cache
3
+ logs
4
+ staging
data/skel/Gruntfile.js ADDED
@@ -0,0 +1,129 @@
1
+ module.exports = function(grunt) {
2
+ grunt.initConfig({
3
+ pkg: grunt.file.readJSON('package.json'),
4
+ clean: {
5
+ staging: ['staging'],
6
+ build: ['public_html']
7
+ },
8
+ coffee: {
9
+ staging: {
10
+ expand: true,
11
+ cwd: 'app',
12
+ src: 'assets/js/**/*.coffee',
13
+ dest: 'staging',
14
+ ext: '.js'
15
+ },
16
+ build: {
17
+ expand: true,
18
+ cwd: 'app',
19
+ src: 'assets/js/**/*.coffee',
20
+ dest: 'public_html',
21
+ ext: '.js'
22
+ }
23
+ },
24
+ copy: {
25
+ staging: {
26
+ files: [{
27
+ expand: true,
28
+ cwd: 'app',
29
+ src: ['**/*.html', 'assets/{files,fonts,images}/**/*'],
30
+ dest: 'staging'
31
+ }]
32
+ },
33
+ build: {
34
+ files: [{
35
+ expand: true,
36
+ cwd: 'app',
37
+ src: ['**/*.html', 'assets/{files,fonts,images}/**/*'],
38
+ dest: 'public_html'
39
+ }]
40
+ }
41
+ },
42
+ express: {
43
+ main: {
44
+ options: {
45
+ bases: ["staging"],
46
+ livereload: true,
47
+ hostname: '0.0.0.0',
48
+ port: 8000
49
+ }
50
+ }
51
+ },
52
+ sass: {
53
+ staging: {
54
+ files: [{
55
+ src: 'app/assets/stylesheets/main.scss',
56
+ dest: 'staging/assets/stylesheets/main.css'
57
+ }]
58
+ },
59
+ build: {
60
+ options: {
61
+ style: 'compressed'
62
+ },
63
+ files: [{
64
+ src: 'app/assets/stylesheets/main.scss',
65
+ dest: 'public_html/assets/stylesheets/main.css'
66
+ }]
67
+ }
68
+ },
69
+ uglify: {
70
+ options: {
71
+ mangle: false
72
+ },
73
+ staging: {
74
+ options: {
75
+ beautify: true
76
+ },
77
+ files: [{
78
+ expand: true,
79
+ cwd: 'app',
80
+ src: 'assets/js/**/*.js',
81
+ dest: 'staging'
82
+ }]
83
+ },
84
+ build: {
85
+ files: [{
86
+ expand: true,
87
+ cwd: 'app',
88
+ src: 'assets/js/**/*.js',
89
+ dest: 'public_html'
90
+ }]
91
+ }
92
+ },
93
+ watch: {
94
+ coffee: {
95
+ files: 'app/assets/js/**/*.coffee',
96
+ tasks: 'coffee:staging',
97
+ options: { livereload: true }
98
+ },
99
+ js: {
100
+ files: 'app/assets/js/**/*.js',
101
+ tasks: ['uglify:staging'],
102
+ options: { livereload: true }
103
+ },
104
+ sass: {
105
+ files: 'app/assets/stylesheets/**/*',
106
+ tasks: ['sass:staging'],
107
+ options: { livereload: true }
108
+ },
109
+ static: {
110
+ files: ['app/**/*.html', 'app/assets/{files,fonts,images}/**/*'],
111
+ tasks: ['copy:staging'],
112
+ options: { livereload: true }
113
+ }
114
+ }
115
+ });
116
+
117
+ grunt.loadNpmTasks('grunt-contrib-clean');
118
+ grunt.loadNpmTasks('grunt-contrib-coffee');
119
+ grunt.loadNpmTasks('grunt-contrib-copy');
120
+ grunt.loadNpmTasks('grunt-contrib-sass');
121
+ grunt.loadNpmTasks('grunt-contrib-uglify');
122
+ grunt.loadNpmTasks('grunt-contrib-watch');
123
+ grunt.loadNpmTasks('grunt-express');
124
+
125
+ grunt.registerTask('serve', ['stage', 'express', 'watch']);
126
+ grunt.registerTask('stage', ['clean:staging', 'copy:staging', 'sass:staging', 'coffee:staging', 'uglify:staging']);
127
+ grunt.registerTask('build', ['clean:build', 'copy:build', 'sass:build', 'coffee:build', 'uglify:build']);
128
+ };
129
+
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "<%= name %>",
3
+ "version": "0.0.0",
4
+ "license": "MIT",
5
+ "private": true
6
+ }
7
+
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "<%= name %>",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "author": "<%= `git config user.name`.strip %> <<%= `git config user.email`.strip %>>",
6
+ "devDependencies": {
7
+ "grunt": "^0.4.5",
8
+ "grunt-contrib-clean": "^0.5.0",
9
+ "grunt-contrib-coffee": "^0.10.1",
10
+ "grunt-contrib-copy": "^0.5.0",
11
+ "grunt-contrib-sass": "^0.7.3",
12
+ "grunt-contrib-uglify": "^0.5.0",
13
+ "grunt-contrib-watch": "^0.6.1",
14
+ "grunt-express": "^1.4.0"
15
+ }
16
+ }
17
+
data/starch.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'starch/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'starch'
8
+ spec.version = Starch::VERSION
9
+ spec.authors = ["Brian O'Keefe"]
10
+ spec.email = ['brian@bokstuff.com']
11
+ spec.summary = %q{An opinionated skeleton generator for basic static sites.}
12
+ spec.description = spec.summary
13
+ spec.homepage = 'https://github.com/brianokeefe/starch'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
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_dependency 'thor'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.6'
24
+ spec.add_development_dependency 'rake'
25
+ spec.add_development_dependency 'aruba'
26
+ end
27
+
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: starch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Brian O'Keefe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-12 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'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
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.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
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: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: An opinionated skeleton generator for basic static sites.
70
+ email:
71
+ - brian@bokstuff.com
72
+ executables:
73
+ - starch
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - bin/starch
83
+ - features/new.feature
84
+ - features/step_definitions/starch_steps.rb
85
+ - features/support/env.rb
86
+ - lib/starch.rb
87
+ - lib/starch/generator.rb
88
+ - lib/starch/version.rb
89
+ - skel/.gitignore
90
+ - skel/Gruntfile.js
91
+ - skel/app/assets/files/.empty_directory
92
+ - skel/app/assets/fonts/.empty_directory
93
+ - skel/app/assets/images/.empty_directory
94
+ - skel/app/assets/js/.empty_directory
95
+ - skel/app/assets/stylesheets/main.scss
96
+ - skel/bower.json.tt
97
+ - skel/package.json.tt
98
+ - starch.gemspec
99
+ homepage: https://github.com/brianokeefe/starch
100
+ licenses:
101
+ - MIT
102
+ metadata: {}
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 2.3.0
120
+ signing_key:
121
+ specification_version: 4
122
+ summary: An opinionated skeleton generator for basic static sites.
123
+ test_files:
124
+ - features/new.feature
125
+ - features/step_definitions/starch_steps.rb
126
+ - features/support/env.rb