gumdrop 0.8.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/ChangeLog.md +13 -0
- data/Gemfile +6 -2
- data/Gemfile.lock +43 -3
- data/Rakefile +37 -21
- data/Readme.md +60 -158
- data/bin/gumdrop +2 -1
- data/gumdrop.gemspec +11 -4
- data/lib/gumdrop/builder.rb +164 -0
- data/lib/gumdrop/cli/external.rb +14 -9
- data/lib/gumdrop/cli/internal.rb +54 -22
- data/lib/gumdrop/cli.rb +21 -0
- data/lib/gumdrop/content.rb +195 -132
- data/lib/gumdrop/data.rb +185 -0
- data/lib/gumdrop/data_providers/csv.rb +18 -0
- data/lib/gumdrop/data_providers/pstore.rb +25 -0
- data/lib/gumdrop/data_providers/sqlite.rb +43 -0
- data/lib/gumdrop/data_providers/xml.rb +15 -0
- data/lib/gumdrop/data_providers/yaml_and_json.rb +18 -0
- data/lib/gumdrop/data_providers/yamldb.rb +18 -0
- data/lib/gumdrop/data_providers/yamldoc.rb +12 -0
- data/lib/gumdrop/generator.rb +118 -94
- data/lib/gumdrop/renderer.rb +272 -0
- data/lib/gumdrop/server.rb +36 -27
- data/lib/gumdrop/site.rb +283 -338
- data/lib/gumdrop/support/compressor.rb +52 -0
- data/lib/gumdrop/support/sprockets.rb +14 -23
- data/lib/gumdrop/support/stitch.rb +25 -14
- data/lib/gumdrop/support/yaml_doc_template.rb +29 -0
- data/lib/gumdrop/util/configurable.rb +44 -0
- data/lib/gumdrop/util/core_ex.rb +84 -0
- data/lib/gumdrop/util/eventable.rb +35 -0
- data/lib/gumdrop/util/hash_object.rb +70 -0
- data/lib/gumdrop/util/loggable.rb +44 -0
- data/lib/gumdrop/util/pager.rb +51 -0
- data/lib/gumdrop/{support → util}/proxy_handler.rb +7 -6
- data/lib/gumdrop/util/scanner.rb +47 -0
- data/lib/gumdrop/util/site_access.rb +16 -0
- data/lib/gumdrop/util/view_helpers.rb +50 -0
- data/lib/gumdrop/util/yaml_doc.rb +51 -0
- data/lib/gumdrop/version.rb +2 -2
- data/lib/gumdrop.rb +40 -77
- data/specs/content_spec.rb +83 -73
- data/specs/fixtures/expected/data-access/from-csv.html +4 -0
- data/specs/fixtures/expected/data-access/from-json.html +6 -0
- data/specs/fixtures/expected/data-access/from-sqlite.html +5 -0
- data/specs/fixtures/expected/data-access/from-xml.html +4 -0
- data/specs/fixtures/expected/data-access/from-yaml.html +5 -0
- data/specs/fixtures/expected/data-access/from-yamldb.html +5 -0
- data/specs/fixtures/expected/data-access/from-yamldoc.html +2 -0
- data/specs/fixtures/expected/gen-with-block/as-file.html +1 -0
- data/specs/fixtures/expected/gen-with-block/as-plain.html +1 -0
- data/specs/fixtures/expected/gen-with-block/layout-nested.html +1 -0
- data/specs/fixtures/expected/gen-with-block/layout-nil.html +1 -0
- data/specs/fixtures/expected/gen-with-block/layout-wrap.html +1 -0
- data/specs/fixtures/expected/gen-with-inline-render/0-as-file.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/0-as-plain.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/0-layout-nil.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/0-layout-sub.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/0-layout-wrap.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/1-as-file.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/1-as-plain.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/1-layout-nil.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/1-layout-sub.html +4 -0
- data/specs/fixtures/expected/gen-with-inline-render/1-layout-wrap.html +4 -0
- data/specs/fixtures/expected/goodbye.html +1 -0
- data/specs/fixtures/expected/hello.html +1 -0
- data/specs/fixtures/expected/image.png +0 -0
- data/specs/fixtures/expected/index.html +47 -0
- data/specs/fixtures/expected/js/sprockets-app.js +7 -0
- data/specs/fixtures/expected/js/stitch-app.js +65 -0
- data/specs/fixtures/expected/js/stitch-app.min.js +5 -0
- data/specs/fixtures/expected/js/stitch-app.min.src.js +65 -0
- data/specs/fixtures/expected/js/straight.js +8 -0
- data/specs/fixtures/expected/js/test-coffee.js +5 -0
- data/specs/fixtures/expected/pages/docs/force-abs.html +2 -0
- data/specs/fixtures/expected/pages/docs/index.html +2 -0
- data/specs/fixtures/expected/partials/hoisted-data.html +3 -0
- data/specs/fixtures/expected/partials/nested.html +7 -0
- data/specs/fixtures/expected/partials/params.html +1 -0
- data/specs/fixtures/expected/partials/with-layouts.html +1 -0
- data/specs/fixtures/expected/robots.txt +1 -0
- data/specs/fixtures/expected/test-multi-procs.html +4 -0
- data/specs/fixtures/expected/test-nested-layout.html +1 -0
- data/specs/fixtures/expected/test-no-layout.html +2 -0
- data/specs/fixtures/expected/test-yamldoc.html +1 -0
- data/specs/fixtures/expected/test.html +2 -0
- data/{templates/backbone → specs/fixtures/source}/Gemfile +8 -4
- data/specs/fixtures/source/Gemfile.lock +84 -0
- data/specs/fixtures/source/Gumdrop +60 -9
- data/specs/fixtures/source/data/csv_data.csv +2 -0
- data/specs/fixtures/source/data/json_data.json +13 -0
- data/specs/fixtures/source/data/sql_data.sqlite +0 -0
- data/specs/fixtures/source/data/xml_data.xml +4 -0
- data/specs/fixtures/source/data/yaml_db.yamldb +9 -0
- data/specs/fixtures/source/data/yaml_items.yaml +2 -0
- data/specs/fixtures/source/data/yamldoc.yamldoc +4 -0
- data/specs/fixtures/source/data-access/from-csv.html.erb +4 -0
- data/specs/fixtures/source/data-access/from-json.html.erb +6 -0
- data/specs/fixtures/source/data-access/from-sqlite.html.erb +5 -0
- data/specs/fixtures/source/data-access/from-xml.html.erb +5 -0
- data/specs/fixtures/source/data-access/from-yaml.html.erb +5 -0
- data/specs/fixtures/source/data-access/from-yamldb.html.erb +5 -0
- data/specs/fixtures/source/data-access/from-yamldoc.html.erb +2 -0
- data/specs/fixtures/source/gen-with-inline-render.generator +7 -0
- data/specs/fixtures/source/goodbye.html.erb +1 -0
- data/specs/fixtures/source/hello.html +1 -0
- data/specs/fixtures/source/image.png +0 -0
- data/specs/fixtures/source/index.html.erb +6 -0
- data/specs/fixtures/source/js/sprockets/app.js +2 -0
- data/specs/fixtures/source/js/sprockets/view.js.coffee +1 -0
- data/specs/fixtures/source/js/stitch/app.js +1 -0
- data/specs/fixtures/source/js/stitch/view.js.coffee +1 -0
- data/specs/fixtures/source/js/straight.js +8 -0
- data/specs/fixtures/source/js/test-coffee.js.coffee +1 -0
- data/specs/fixtures/source/layouts/site.layout.erb +1 -0
- data/specs/fixtures/source/layouts/sub.layout.erb +1 -0
- data/specs/fixtures/source/layouts/wrap.layout.erb +1 -0
- data/specs/fixtures/source/pages/_users-nested.html.erb +7 -0
- data/specs/fixtures/source/pages/docs/force-abs.html.erb +2 -0
- data/specs/fixtures/source/pages/docs/index.html.erb +2 -0
- data/specs/fixtures/source/partials/_post_entry.html.erb +4 -0
- data/specs/fixtures/source/partials/_provides_name.html.erb +1 -0
- data/specs/fixtures/source/partials/_user-params.html.erb +1 -0
- data/specs/fixtures/source/partials/_user.html.erb +1 -0
- data/specs/fixtures/source/partials/_user_sets_layout.html.erb +1 -0
- data/specs/fixtures/source/partials/hoisted-data.html.erb +6 -0
- data/specs/fixtures/source/partials/nested.html.erb +1 -0
- data/specs/fixtures/source/partials/params.html.erb +1 -0
- data/specs/fixtures/source/partials/with-layouts.html.erb +1 -0
- data/specs/fixtures/source/test-multi-procs.html.markdown.erb +3 -0
- data/specs/fixtures/source/test-nested-layout.html.erb +1 -0
- data/specs/fixtures/source/test-no-layout.html.erb +2 -0
- data/specs/fixtures/source/test-yamldoc.html.erb.yamldoc +4 -0
- data/specs/fixtures/source/test.html.erb +2 -0
- data/specs/hash_object_spec.rb +53 -8
- data/specs/render_spec.rb +10 -0
- data/specs/site_spec.rb +79 -0
- data/specs/spec_helper.rb +59 -0
- data/templates/blank/Gemfile +0 -4
- data/templates/blank/Gumdrop +180 -113
- data/templates/default/Gemfile +3 -8
- data/templates/default/Gumdrop +166 -95
- data/templates/default/ReadMe.md +14 -0
- data/templates/default/config.ru +1 -0
- data/templates/default/data/news/20120703.yamldoc +14 -0
- data/templates/default/data/news/20120704.yamldoc +8 -0
- data/templates/{backbone/source/feed.xml.builder.txt → default/source/feed.xml.builder} +4 -4
- data/templates/default/source/index.html.erb +10 -1
- data/templates/default/source/theme/layout/_sidebar.html +1 -0
- data/templates/{backbone/source/theme/templates/site.template.slim → default/source/theme/layout/site.layout.slim} +3 -3
- metadata +212 -63
- data/lib/gumdrop/context.rb +0 -135
- data/lib/gumdrop/data_manager.rb +0 -214
- data/lib/gumdrop/support/base_packager.rb +0 -60
- data/lib/gumdrop/support/callbacks.rb +0 -30
- data/lib/gumdrop/support/hash_object.rb +0 -22
- data/lib/gumdrop/view_helpers.rb +0 -25
- data/notes.md +0 -347
- data/specs/deferred_loader_spec.rb +0 -31
- data/specs/fixtures/expected/posts/post1.html +0 -1
- data/specs/fixtures/expected/posts/post1.js +0 -14
- data/specs/fixtures/expected/posts/post2.html +0 -5
- data/specs/fixtures/expected/sub/sub/sub/test.html +0 -5
- data/specs/fixtures/expected/sub/sub/sub/test2.html +0 -5
- data/specs/fixtures/expected/test.js +0 -14
- data/specs/fixtures/source/posts/post1.html.slim +0 -6
- data/specs/fixtures/source/posts/post1.js.coffee +0 -3
- data/specs/fixtures/source/posts/post2.html.erb +0 -5
- data/specs/fixtures/source/sub/sub/sub/test.html +0 -5
- data/specs/fixtures/source/sub/sub/sub/test2.html.erb +0 -5
- data/specs/fixtures/source/test.js.coffee +0 -4
- data/specs/fixtures/source/test.js.erb.coffee +0 -3
- data/templates/backbone/Gumdrop +0 -123
- data/templates/backbone/Rakefile +0 -38
- data/templates/backbone/app/app.js.coffee +0 -49
- data/templates/backbone/app/init.js.coffee +0 -10
- data/templates/backbone/app/models/.gitkeep +0 -0
- data/templates/backbone/app/utils/index.js.coffee +0 -27
- data/templates/backbone/app/views/home.js.coffee +0 -17
- data/templates/backbone/app/views/styles/home.scss +0 -8
- data/templates/backbone/app/views/templates/home.mustache +0 -2
- data/templates/backbone/config.ru +0 -20
- data/templates/backbone/lib/all.js.coffee +0 -18
- data/templates/backbone/lib/backbone.js +0 -1158
- data/templates/backbone/lib/hogan.js +0 -509
- data/templates/backbone/lib/jquery.js +0 -9266
- data/templates/backbone/lib/underscore.js +0 -981
- data/templates/backbone/powrc +0 -2
- data/templates/backbone/source/default.htaccess.erb +0 -27
- data/templates/backbone/source/favicon.ico +0 -0
- data/templates/backbone/source/index.html.erb +0 -2
- data/templates/backbone/source/theme/screen.css.sass +0 -9
- data/templates/backbone/source/theme/scripts/app.js.coffee +0 -4
- data/templates/backbone/source/theme/styles/_tools.scss +0 -434
- data/templates/backbone/source/theme/templates/app.template.slim +0 -14
- data/templates/default/Rakefile +0 -38
- data/templates/default/powrc +0 -2
- data/templates/default/source/default.htaccess.erb +0 -27
- data/templates/default/source/feed.xml.builder.txt +0 -23
- data/templates/default/source/theme/templates/site.template.slim +0 -33
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'minitest/spec'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'gumdrop'
|
4
|
-
|
5
|
-
# describe Gumdrop::HashObject do
|
6
|
-
# before do
|
7
|
-
# @ho= Gumdrop::HashObject.new one:"ONE", two:"TWO", three:'THREE'
|
8
|
-
# end
|
9
|
-
|
10
|
-
# it "can be created with no arguments" do
|
11
|
-
# Gumdrop::HashObject.new.must_be_instance_of Gumdrop::HashObject
|
12
|
-
# end
|
13
|
-
|
14
|
-
# it "can be used as a standard hash" do
|
15
|
-
# @ho[:one].must_equal "ONE"
|
16
|
-
# end
|
17
|
-
|
18
|
-
# it "can be used as a standard with either a sym or string key" do
|
19
|
-
# @ho[:two].must_equal "TWO"
|
20
|
-
# @ho['two'].must_equal "TWO"
|
21
|
-
# end
|
22
|
-
|
23
|
-
# it "can be accessed like an object" do
|
24
|
-
# @ho.three.must_equal "THREE"
|
25
|
-
# end
|
26
|
-
|
27
|
-
# it "should return nil for an unknown key" do
|
28
|
-
# @ho.timmy.must_be_nil
|
29
|
-
# end
|
30
|
-
|
31
|
-
# end
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1>My First Post</h1><img src="../media/crap.png" /><p>Go to <a href="../about/hell">Hell</a></p>
|
data/templates/backbone/Gumdrop
DELETED
@@ -1,123 +0,0 @@
|
|
1
|
-
|
2
|
-
configure do
|
3
|
-
|
4
|
-
set :site_title, "My Site"
|
5
|
-
set :site_tagline, "My home on thar intarwebs!"
|
6
|
-
set :site_author, "Me"
|
7
|
-
set :site_url, "http://www.mysite.com"
|
8
|
-
|
9
|
-
# All the supported build configuration settings and their defaults:
|
10
|
-
# set :relative_paths, true
|
11
|
-
# set :proxy_enabled, true
|
12
|
-
# set :output_dir, "./output"
|
13
|
-
# set :source_dir, "./source"
|
14
|
-
# set :data_dir, './data'
|
15
|
-
# set :log, './logs/build.log'
|
16
|
-
# set :ignore, %w(.DS_Store .gitignore .git .svn .sass-cache)
|
17
|
-
# set :server_timeout, 15
|
18
|
-
# set :server_port, 4567
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
# Skipping files entirely from build process... Like they don't exist.
|
23
|
-
# skip 'file-to-ignore.html'
|
24
|
-
# skip 'dont-show/**/*'
|
25
|
-
|
26
|
-
# Ignores source file(s) from compilation, but does load the content into memory
|
27
|
-
# ignore 'pages/**/*'
|
28
|
-
|
29
|
-
# NOTE: Skipping and ignoring matches like a file glob (it use File.fnmatch in fact)
|
30
|
-
# (this doesn't work for files detected by stitch)
|
31
|
-
|
32
|
-
|
33
|
-
# Example site-level generator
|
34
|
-
generate do
|
35
|
-
|
36
|
-
stitch 'app.js', # JavaScript to assemble
|
37
|
-
:identifier=>'app', # variable name for the library
|
38
|
-
:paths=>['./app'],
|
39
|
-
:root=>'./app',
|
40
|
-
:dependencies=>[], # List of scripts to prepend to top of file (non moduled)
|
41
|
-
:prune=>false, # If true, removes the source files from Gumdrop.site hash
|
42
|
-
:compress=>:jsmin, # Options are :jsmin, :yuic, :uglify
|
43
|
-
:obfuscate=>false, # For compressors that support munging/mangling
|
44
|
-
:keep_src=>true # Creates another file, ex: app-src.js
|
45
|
-
|
46
|
-
stitch 'lib.js',
|
47
|
-
:identifier=>'lib',
|
48
|
-
:paths=>['./lib'],
|
49
|
-
:root=>'./lib',
|
50
|
-
:prune=>true,
|
51
|
-
:compress=>false,
|
52
|
-
:obfuscate=>false,
|
53
|
-
:keep_src=>false
|
54
|
-
|
55
|
-
|
56
|
-
# Requires a about.template.XX file
|
57
|
-
# page "about.html",
|
58
|
-
# :template=>'about',
|
59
|
-
# :passthru=>'Available in the template'
|
60
|
-
|
61
|
-
# page 'robots.txt' do
|
62
|
-
# # And content returned will be put in the file
|
63
|
-
# """
|
64
|
-
# User-Agent: *
|
65
|
-
# Disallow: /
|
66
|
-
# """
|
67
|
-
# end
|
68
|
-
|
69
|
-
# Maybe for a tumblr-like pager
|
70
|
-
# pager= Gumdrop.data.pager_for :posts, base_path:'posts/page', page_size:5
|
71
|
-
|
72
|
-
# pager.each do |page|
|
73
|
-
# page "#{page.uri}.html",
|
74
|
-
# template:'post_page',
|
75
|
-
# posts:page.items,
|
76
|
-
# pager:pager,
|
77
|
-
# current_page:pager.current_page
|
78
|
-
# end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
# All Gumdrop Hooks: on_start, on_before_scan, on_scan, on_before_generate, on_generate, on_before_render, on_render, on_end
|
83
|
-
on_start do |site|
|
84
|
-
puts "Gumdrop v#{Gumdrop::VERSION} building..."
|
85
|
-
end
|
86
|
-
# on_end do |site| end
|
87
|
-
|
88
|
-
# Example of using a content filter to compress CSS output
|
89
|
-
# require 'yui/compressor'
|
90
|
-
# content_filter do |content, info|
|
91
|
-
# if info.ext == '.css'
|
92
|
-
# puts " Compress: #{info.filename}"
|
93
|
-
# compressor= YUI::CssCompressor.new
|
94
|
-
# compressor.compress( content )
|
95
|
-
# else
|
96
|
-
# content
|
97
|
-
# end
|
98
|
-
# end
|
99
|
-
|
100
|
-
|
101
|
-
# View helpers (available in rendering context):
|
102
|
-
view_helpers do
|
103
|
-
|
104
|
-
# Calculate the years for a copyright
|
105
|
-
def copyright_years(start_year, divider="–")
|
106
|
-
end_year = Date.today.year
|
107
|
-
if start_year == end_year
|
108
|
-
"#{start_year}"
|
109
|
-
else
|
110
|
-
"#{start_year}#{divider}#{end_year}"
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
#
|
115
|
-
# Your custom helpers go here!
|
116
|
-
#
|
117
|
-
|
118
|
-
end
|
119
|
-
|
120
|
-
# Any specialized code for your site goes here...
|
121
|
-
|
122
|
-
require 'slim'
|
123
|
-
Slim::Engine.set_default_options pretty:true
|
data/templates/backbone/Rakefile
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require "bundler/setup"
|
3
|
-
require 'gumdrop'
|
4
|
-
|
5
|
-
# For the SYNC task
|
6
|
-
USER='user'
|
7
|
-
SERVER='server.com'
|
8
|
-
FOLDER="~/#{SERVER}"
|
9
|
-
|
10
|
-
# Build folder (change if you change Gumdrop.config.output_dir)
|
11
|
-
OUTPUT="output/"
|
12
|
-
|
13
|
-
desc "Build source files into output_dir"
|
14
|
-
task :build do
|
15
|
-
system("bundle exec gumdrop -b")
|
16
|
-
end
|
17
|
-
|
18
|
-
desc "Run development server"
|
19
|
-
task :serve do
|
20
|
-
system("bundle exec gumdrop -s")
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "Syncs with public server using rsync (if configured)"
|
24
|
-
task :sync do
|
25
|
-
cmd= "rsync -avz --delete #{OUTPUT} #{USER}@#{SERVER}:#{FOLDER}"
|
26
|
-
puts "Running:\n#{cmd}\n"
|
27
|
-
system(cmd)
|
28
|
-
puts "Done."
|
29
|
-
end
|
30
|
-
|
31
|
-
desc "Outputs the Gumdrop version"
|
32
|
-
task :version do
|
33
|
-
puts Gumdrop::VERSION
|
34
|
-
end
|
35
|
-
|
36
|
-
task :default do
|
37
|
-
puts `rake -T`
|
38
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
{ log, warn }= require('utils')
|
2
|
-
|
3
|
-
|
4
|
-
class Application extends Backbone.Router
|
5
|
-
|
6
|
-
views: {}
|
7
|
-
|
8
|
-
routes:
|
9
|
-
'': 'home'
|
10
|
-
|
11
|
-
|
12
|
-
home: ->
|
13
|
-
@views.home = new (require('views/home')) unless @views.home?
|
14
|
-
$('body').html @views.home.render().el
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
constructor: ->
|
19
|
-
@initializers= []
|
20
|
-
@isReady= no
|
21
|
-
super
|
22
|
-
|
23
|
-
addInitializer: (fn)->
|
24
|
-
if @isReady
|
25
|
-
fn.call this, @options
|
26
|
-
else
|
27
|
-
@initializers.push fn
|
28
|
-
this
|
29
|
-
|
30
|
-
start: (options)->
|
31
|
-
if @isReady
|
32
|
-
# You can only 'start' the app once!
|
33
|
-
warn "You can only start the application once!"
|
34
|
-
this
|
35
|
-
else
|
36
|
-
log "Init!"
|
37
|
-
@trigger 'app:init:before', app:this, options:options
|
38
|
-
for fn in @initializers
|
39
|
-
fn.call this, options
|
40
|
-
@trigger 'app:init:after', app:this, options:options
|
41
|
-
delete @initializers
|
42
|
-
@options= options
|
43
|
-
@isReady= yes
|
44
|
-
Backbone.history.start pushState:(@options.pushState)
|
45
|
-
log "Ready."
|
46
|
-
this
|
47
|
-
|
48
|
-
|
49
|
-
module.exports= new Application
|
File without changes
|
@@ -1,27 +0,0 @@
|
|
1
|
-
((has_console)->
|
2
|
-
|
3
|
-
# TODO: Implement all the other usual console tricks
|
4
|
-
log_methods= if has_console
|
5
|
-
log: ->
|
6
|
-
console.log arguments...
|
7
|
-
warn: ->
|
8
|
-
console.warn arguments...
|
9
|
-
error: ->
|
10
|
-
console.error arguments...
|
11
|
-
info: ->
|
12
|
-
console.info arguments...
|
13
|
-
else
|
14
|
-
# Create a bunch of NOOPs
|
15
|
-
# TODO: Decide if a fallback to non-console folks should be provided? (I'm thinking no.)
|
16
|
-
log: -> # noop
|
17
|
-
warn: -> # noop
|
18
|
-
error: -> # noop
|
19
|
-
info: -> # noop
|
20
|
-
|
21
|
-
module.exports= log_methods
|
22
|
-
module.exports.globalize= (ctx=window)->
|
23
|
-
for name, fn of log_methods
|
24
|
-
ctx[name]= fn
|
25
|
-
|
26
|
-
)(window.console?)
|
27
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
{log}= require 'utils'
|
2
|
-
|
3
|
-
|
4
|
-
class HomeView extends Backbone.View
|
5
|
-
className: 'home'
|
6
|
-
|
7
|
-
src:
|
8
|
-
template: require('./templates/home')
|
9
|
-
styles: require('./styles/home')
|
10
|
-
|
11
|
-
render: ->
|
12
|
-
@src.styles.add()
|
13
|
-
@el.innerHTML= @src.template({})
|
14
|
-
@
|
15
|
-
|
16
|
-
|
17
|
-
module.exports= HomeView
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Encoding.default_external = 'UTF-8'
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
|
6
|
-
begin
|
7
|
-
Bundler.setup(:default, :development)
|
8
|
-
rescue Bundler::BundlerError => e
|
9
|
-
$stderr.puts e.message
|
10
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
11
|
-
exit e.status_code
|
12
|
-
end
|
13
|
-
|
14
|
-
require 'gumdrop'
|
15
|
-
|
16
|
-
#require 'rack/static'
|
17
|
-
#use Rack::Static, :urls => ["/media"], :root => "source"
|
18
|
-
#use Rack::Static, :urls => ["/theme/images"], :root => "source"
|
19
|
-
|
20
|
-
run Gumdrop::Server
|
@@ -1,18 +0,0 @@
|
|
1
|
-
all_libs= {}
|
2
|
-
|
3
|
-
expose= (name, as)->
|
4
|
-
all_libs[as]= lib= require(name)
|
5
|
-
exports[as]= lib
|
6
|
-
|
7
|
-
# Listing of all the libraries
|
8
|
-
|
9
|
-
expose 'jquery', '$'
|
10
|
-
expose 'backbone', 'Backbone'
|
11
|
-
expose 'hogan', 'Hogan'
|
12
|
-
expose 'underscore', '_'
|
13
|
-
|
14
|
-
# Helper to assign all libs
|
15
|
-
exports.globalize= (ctx=window)->
|
16
|
-
for own name, lib of all_libs
|
17
|
-
ctx[name]= lib unless ctx[name]?
|
18
|
-
this
|