speakeasy 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in sinatra_with_assets.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'pry'
8
+ end
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2011, 2012 Jesse Trimble
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,14 @@
1
+ # Speakeasy
2
+
3
+ Speakeasy gives you a quick way to get up and running with Sinatra and
4
+ Sprockets.
5
+
6
+ ---
7
+
8
+ ## Contributing
9
+
10
+ 1. Fork it
11
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
12
+ 3. Commit your changes *with* tests (`git commit -am 'Added some feature'`)
13
+ 4. Push to the branch (`git push origin my-new-feature`)
14
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+
4
+ require 'thor'
5
+
6
+ class Speakeasy < Thor
7
+ include Thor::Actions
8
+ attr_accessor :app_name
9
+ attr_accessor :constant_name
10
+
11
+ desc 'new [APP_NAME]', 'Make a new sinatra app with assets'
12
+ def new(app_name)
13
+ @app_name = app_name
14
+ @constant_name = constant_name_from(File.split(app_name)[1])
15
+
16
+ setup
17
+
18
+ copy_file 'README.markdown'
19
+ copy_file 'Gemfile'
20
+
21
+ copy_file 'server'
22
+ chmod "server", 0755
23
+
24
+ template 'config.ru'
25
+
26
+ directory 'app'
27
+ directory 'public'
28
+
29
+ copy_file 'views/index.slim'
30
+ template 'views/layout.slim'
31
+
32
+ say_status 'git', `git init #{app_name}`, true
33
+
34
+ say <<-GETSTARTED, Thor::Shell::Color::CYAN
35
+
36
+ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
37
+ Next steps:
38
+
39
+ - run `cd #{app_name}`
40
+ - run `bundle install`
41
+ - run `./server`
42
+ - navigate to http://localhost:3000
43
+ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
44
+
45
+ GETSTARTED
46
+ end
47
+
48
+ private
49
+
50
+ def setup
51
+ source_paths << File.expand_path(File.join(__FILE__, '../../lib/templates'))
52
+ self.destination_root = File.expand_path(File.join('.', @app_name))
53
+ end
54
+
55
+ def constant_name_from(name)
56
+ name.split(/[\-_]/).map { |word| letters = word.split(//); letters.unshift(letters.shift.upcase); letters.join }.join
57
+ end
58
+
59
+ end
60
+
61
+ Speakeasy.start
@@ -0,0 +1,5 @@
1
+ require "speakeasy/version"
2
+
3
+ module Speakeasy
4
+
5
+ end
@@ -0,0 +1,3 @@
1
+ module Speakeasy
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,9 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'sprockets'
4
+ gem 'sass'
5
+ gem 'coffee-script'
6
+ gem 'sinatra'
7
+ gem 'shotgun'
8
+ gem 'thin'
9
+ gem 'slim'
@@ -0,0 +1,5 @@
1
+ This is a new sinatra app.
2
+
3
+ It uses coffee-script for javascripts, scss for styles, and slim for
4
+ a templating engine. The coffee and scss compilation happens through sprockets
5
+ dynamically and view templates are rendered via slim dynamically.
@@ -0,0 +1,6 @@
1
+ class window.App
2
+
3
+ constructor: ->
4
+ # TODO: put your js app code here.
5
+ # This file is processed by sprockets, so `require` directives are
6
+ # respected.
@@ -0,0 +1,3 @@
1
+ /* TODO: put your app styles here.
2
+ * This file is processed by sprockets, so `require` directives are
3
+ * respected. */
@@ -0,0 +1,20 @@
1
+ require 'sinatra'
2
+ require 'sprockets'
3
+ require 'slim'
4
+
5
+ class <%= constant_name %> < Sinatra::Base
6
+ get '/' do
7
+ slim :index
8
+ end
9
+ end
10
+
11
+ map '/assets' do
12
+ environment = Sprockets::Environment.new
13
+ environment.append_path 'app/assets/javascripts'
14
+ environment.append_path 'app/assets/stylesheets'
15
+ run environment
16
+ end
17
+
18
+ map '/' do
19
+ run <%= constant_name %>
20
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ bundle exec shotgun --server thin --port 3000
@@ -0,0 +1,3 @@
1
+ h4 This file lives in:
2
+ pre
3
+ code views/index.erb
@@ -0,0 +1,8 @@
1
+ doctype 5
2
+ html
3
+ head
4
+ script src="/assets/app.js.coffee"
5
+ link rel="stylesheet" href="/assets/app.css"
6
+ title <%= constant_name %>
7
+ body
8
+ == yield
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "speakeasy/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "speakeasy"
7
+ s.version = Speakeasy::VERSION
8
+ s.authors = ["Jesse Trimble"]
9
+ s.email = ["jlowelltrim@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Generator for sinatra apps pre-wired for coffeescript, scss, and slim templates.}
12
+ s.description = %q{Generator for sinatra apps pre-wired for coffeescript, scss, and slim templates.}
13
+
14
+ s.rubyforge_project = "speakeasy"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_runtime_dependency "thor"
22
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: speakeasy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jesse Trimble
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Generator for sinatra apps pre-wired for coffeescript, scss, and slim
31
+ templates.
32
+ email:
33
+ - jlowelltrim@gmail.com
34
+ executables:
35
+ - speakeasy
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - .gitignore
40
+ - Gemfile
41
+ - LICENSE
42
+ - README.md
43
+ - Rakefile
44
+ - bin/speakeasy
45
+ - lib/speakeasy.rb
46
+ - lib/speakeasy/version.rb
47
+ - lib/templates/Gemfile
48
+ - lib/templates/README.markdown
49
+ - lib/templates/app/assets/javascripts/app.js.coffee
50
+ - lib/templates/app/assets/stylesheets/app.css.scss
51
+ - lib/templates/config.ru
52
+ - lib/templates/public/assets/.gitkeep
53
+ - lib/templates/server
54
+ - lib/templates/views/index.slim
55
+ - lib/templates/views/layout.slim
56
+ - speakeasy.gemspec
57
+ homepage: ''
58
+ licenses: []
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project: speakeasy
77
+ rubygems_version: 1.8.24
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: Generator for sinatra apps pre-wired for coffeescript, scss, and slim templates.
81
+ test_files: []