ecstatic 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9dfcdf64f92b0ee7e1ff586233ce1679e1ba1d1f
4
+ data.tar.gz: 829a72fe539ccb8c46205cf31161ac4da9e4ba58
5
+ SHA512:
6
+ metadata.gz: aa02f09d02fbcbeb416e113b2aeb8411d32a0afa70e1c27e333b78218916f622b9613533e362068e52f06069f6bc5ed3fe9f626bae0d71cf6193198baedf7408
7
+ data.tar.gz: 8306ccd96d0f45df5f27cce62e20b9f06ed38bc466fd34c628569d9f150235f9e3910a13b541b24e901ccc0a4eb65dcadcdd7fab2319dc9226a910e15da870fc
data/.gitignore ADDED
@@ -0,0 +1,18 @@
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
+ .DS_Store
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ ecstatic
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ecstatic.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Bradley Grzesiak
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,71 @@
1
+ # Ecstatic
2
+
3
+ Ecstatic is a static site generator focused on simplicity. It uses just enough of the right tools, leaving as much power in your hands while still providing plenty of value. Ecstatic is opinionated in favor of [HAML](http://haml.info/), [SASS](http://sass-lang.com/), and (someday) [CoffeeScript](http://coffeescript.org/).
4
+
5
+ Ecstatic provides a straight-forward directory structure for your site<!-- and concatenates scripts and stylesheets-->. It also provides a mechanism to push either the `master` or `gh-pages` branch to GitHub.
6
+
7
+ Ecstatic does **not** provide an automatic mechanism for blogging. If you want to use Ecstatic for blogging, you will have to curate your own site structure. Not ideal, but it's not a core feature. Perhaps someone will write a plugin that provides automatic blogging functionality (hint, hint).
8
+
9
+ Ecstatic is not meant to create ridiculously optimized sites. It will instead make fairly optimized sites. Perhaps, in the future, there can be a plugin ecosystem that takes Ecstatic output and performs further optimization (e.g., pre-gzip, JS Google closure tools advanced compilation, etc.)
10
+
11
+ ## Requirements
12
+
13
+ You will need Ruby 2.0. It should also run fine on Ruby 1.9.3. Either RVM or rbenv should work. You will also need a way to compile CoffeeScript. Simply having [node.js](http://nodejs.org/) on your machine should suffice.
14
+
15
+ ## Creating a static site for GitHub Pages
16
+
17
+ Starting from scratch:
18
+
19
+ $ mkdir my_site
20
+ $ cd my_site
21
+ $ echo 'ruby-2.0.0' > .ruby-version
22
+ $ echo 'my_site' > .ruby-gemset
23
+ $ cd . # load the gemset when using RVM
24
+ $ gem install bundler
25
+ $ (echo "source 'https://rubygems.org'"; echo "gem 'ecstatic'") > Gemfile
26
+ $ bundle
27
+ $ ecstatic init
28
+
29
+ If your site is a Github Pages page rather than a user or organization home page, then your last step is different:
30
+
31
+ $ ecstatic init --ghpages
32
+
33
+ ## Getting started
34
+
35
+ After installation and initialization, you should have the following directory tree:
36
+
37
+ ```
38
+ .
39
+ ├── Gemfile
40
+ ├── Gemfile.lock
41
+ ├── README.md
42
+ ├── config.rb
43
+ ├── gh-pages
44
+ └── site
45
+ ├── assets
46
+ │   ├── images
47
+ │   ├── javascripts
48
+ │   └── stylesheets
49
+ └── pages
50
+ └── index.haml
51
+ ```
52
+
53
+ When writing your website, you will focus almost exclusively on the `site` directory. While you're working on your site, you'll want to run `ecstatic server` and view its contents at [localhost:4567](http://localhost:4567).
54
+
55
+ Ecstatic will automatically compile HAML files in `site/pages/` and SCSS files in `site/assets/stylesheets`. If you need need something like CoffeeScript compilation, then it should be fairly simple to add to `lib/ecstatic/watcher.rb`. Pull requests welcome!
56
+
57
+ ## Deploying to GitHub Pages
58
+
59
+ Assuming everything worked and you set up your git remotes right, you should be able to deploy with:
60
+
61
+ ```
62
+ ecstatic deploy
63
+ ```
64
+
65
+ ## Contributing
66
+
67
+ 1. Fork it
68
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
69
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
70
+ 4. Push to the branch (`git push -u origin my-new-feature`)
71
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/ecstatic ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'rubygems'
5
+ require 'thor'
6
+ gem 'ecstatic'
7
+ rescue LoadError
8
+ end
9
+
10
+ require 'ecstatic'
11
+
12
+ Ecstatic::Command.start
data/ecstatic.gemspec ADDED
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ecstatic/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "ecstatic"
8
+ gem.version = Ecstatic::VERSION
9
+ gem.authors = ["Bradley Grzesiak", "Matt Gauger"]
10
+ gem.email = ["brad@bendyworks.com"]
11
+ gem.description = %q{A static site generator focused on simplicity}
12
+ gem.summary = %q{Ecstatic is a static site generator focused on simplicity. It uses just enough of the right tools, leaving as much power in your hands while still providing plenty of value. Ecstatic is opinionated in favor of HAML, SASS, and CoffeeScript.}
13
+ gem.homepage = "http://github.com/listrophy/ecstatic"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency 'coffee-script'
21
+ gem.add_dependency 'haml'
22
+ gem.add_dependency 'rake'
23
+ gem.add_dependency 'rdiscount'
24
+ gem.add_dependency 'sass'
25
+ gem.add_dependency 'sinatra'
26
+ gem.add_dependency 'thin'
27
+ gem.add_dependency 'thor'
28
+ gem.add_dependency 'watchr'
29
+
30
+ gem.add_development_dependency 'rspec'
31
+ gem.add_development_dependency 'pry'
32
+ gem.add_development_dependency 'pry-debugger'
33
+ end
data/lib/ecstatic.rb ADDED
@@ -0,0 +1,8 @@
1
+ require "ecstatic/actions"
2
+ require "ecstatic/command"
3
+ require "ecstatic/server"
4
+ require "ecstatic/version"
5
+ require "ecstatic/watcher"
6
+
7
+ module Ecstatic
8
+ end
@@ -0,0 +1,18 @@
1
+ module Ecstatic
2
+ module Actions
3
+ # Run a command in git.
4
+ #
5
+ # git :init
6
+ # git add: "this.file that.rb"
7
+ # git add: "onefile.rb", rm: "badfile.cxx"
8
+ def git(commands={})
9
+ if commands.is_a?(Symbol)
10
+ run "git #{commands}"
11
+ else
12
+ commands.each do |cmd, options|
13
+ run "git #{cmd} #{options}"
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,74 @@
1
+ module Ecstatic
2
+ class Command < Thor
3
+ include Thor::Actions
4
+ include Ecstatic::Actions
5
+
6
+ def self.source_root
7
+ File.expand_path('../templates', __FILE__)
8
+ end
9
+
10
+ desc 'init', 'Create a new ecstatic project'
11
+ method_options ghpages: false, aliases: '-gh', banner: "test"
12
+ def init
13
+ init_git_if_not_already
14
+ directory 'site'
15
+ copy_file '.gitignore'
16
+
17
+ if options.ghpages?
18
+ empty_directory 'gh-pages'
19
+ init_git_if_not_already('gh-pages')
20
+ Dir.chdir('gh-pages') do
21
+ git :checkout => '-b gh-pages'
22
+ end
23
+ end
24
+ end
25
+
26
+ desc 'server', 'Run your site locally, recompiling files as they change.'
27
+ def server
28
+ Thread.new do
29
+ Ecstatic::Watcher.watch!
30
+ end
31
+ Ecstatic::Server.run!
32
+ end
33
+
34
+ desc 'deploy', 'Deploy a site to Github Pages.'
35
+ def deploy
36
+ Dir.chdir('gh-pages') do
37
+ ensure_we_are_on_branch
38
+ commit_changes_if_necessary &&
39
+ push_changes
40
+ end
41
+ end
42
+
43
+ private
44
+ def init_git_if_not_already(path = '.')
45
+ unless Dir.exists?(File.join(path, '.git'))
46
+ git :init => path
47
+ else
48
+ puts "Skipping git init because #{path} already has a .git/"
49
+ end
50
+ end
51
+
52
+ def ensure_we_are_on_branch
53
+ current_branch = `git rev-parse --abbrev-ref HEAD`
54
+
55
+ unless current_branch.chomp == 'gh-pages'
56
+ git :checkout => 'gh-pages'
57
+ end
58
+ end
59
+
60
+ def commit_changes_if_necessary
61
+ unless `git status -s`.chomp.empty?
62
+ git :add => '-A .'
63
+ git :commit => %Q(-m "Deploy at #{DateTime.now.rfc2822}")
64
+ else
65
+ puts "Nothing to deploy."
66
+ return false
67
+ end
68
+ end
69
+
70
+ def push_changes
71
+ git :push => '-u origin gh-pages'
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,13 @@
1
+ require 'sinatra'
2
+
3
+ module Ecstatic
4
+ class Server < Sinatra::Base
5
+ configure do
6
+ set :public_folder, 'gh-pages'
7
+ end
8
+
9
+ get '/' do
10
+ open 'gh-pages/index.html'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ *.gem
2
+ pkg/
3
+ _site/
4
+ .bundle/
5
+ gh-pages/
6
+ site/_site/
7
+
8
+ # OSX
9
+ .DS_Store
10
+
11
+ # vim
12
+ .*.s[a-w][a-z]
13
+ *.un~
14
+ Session.vim
15
+ .netrwhist
16
+ *~
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ module Ecstatic
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,18 @@
1
+ require 'watchr'
2
+
3
+ module Ecstatic
4
+ class Watcher
5
+ def self.watch!
6
+ script = Watchr::Script.new
7
+ script.watch('site/pages/(.*)\.haml') do |m|
8
+ puts "Compiling page: #{m[0]}"
9
+ system("haml site/pages/#{m[1]}.haml gh-pages/#{m[1]}")
10
+ end
11
+
12
+ script.watch('site/assets/stylesheets/.*') { puts 'Compiling scss'; system('compass compile') }
13
+ handler = Watchr.handler.new;
14
+ controller = Watchr::Controller.new(script,handler);
15
+ controller.run # blocking
16
+ end
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ecstatic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Bradley Grzesiak
8
+ - Matt Gauger
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-10-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: coffee-script
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: haml
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rdiscount
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: sass
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: sinatra
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: thin
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: thor
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: watchr
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :runtime
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: rspec
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - '>='
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ - !ruby/object:Gem::Dependency
155
+ name: pry
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - '>='
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ - !ruby/object:Gem::Dependency
169
+ name: pry-debugger
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ description: A static site generator focused on simplicity
183
+ email:
184
+ - brad@bendyworks.com
185
+ executables:
186
+ - ecstatic
187
+ extensions: []
188
+ extra_rdoc_files: []
189
+ files:
190
+ - .gitignore
191
+ - .ruby-gemset
192
+ - .ruby-version
193
+ - Gemfile
194
+ - LICENSE.txt
195
+ - README.md
196
+ - Rakefile
197
+ - bin/ecstatic
198
+ - ecstatic.gemspec
199
+ - lib/ecstatic.rb
200
+ - lib/ecstatic/actions.rb
201
+ - lib/ecstatic/command.rb
202
+ - lib/ecstatic/server.rb
203
+ - lib/ecstatic/templates/.gitignore
204
+ - lib/ecstatic/templates/site/.gitkeep
205
+ - lib/ecstatic/templates/site/assets/.gitkeep
206
+ - lib/ecstatic/templates/site/pages/.gitkeep
207
+ - lib/ecstatic/templates/site/scripts/.gitkeep
208
+ - lib/ecstatic/templates/site/stylesheets/.gitkeep
209
+ - lib/ecstatic/version.rb
210
+ - lib/ecstatic/watcher.rb
211
+ homepage: http://github.com/listrophy/ecstatic
212
+ licenses: []
213
+ metadata: {}
214
+ post_install_message:
215
+ rdoc_options: []
216
+ require_paths:
217
+ - lib
218
+ required_ruby_version: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - '>='
226
+ - !ruby/object:Gem::Version
227
+ version: '0'
228
+ requirements: []
229
+ rubyforge_project:
230
+ rubygems_version: 2.0.6
231
+ signing_key:
232
+ specification_version: 4
233
+ summary: Ecstatic is a static site generator focused on simplicity. It uses just enough
234
+ of the right tools, leaving as much power in your hands while still providing plenty
235
+ of value. Ecstatic is opinionated in favor of HAML, SASS, and CoffeeScript.
236
+ test_files: []