gearup 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/bin/gearup +5 -10
- data/bin/gearup-package +21 -0
- data/lib/gearup/context.rb +9 -0
- data/lib/gearup/environment.rb +24 -0
- data/lib/gearup/server.rb +15 -0
- data/lib/gearup/version.rb +1 -1
- data/lib/gearup.rb +3 -0
- data/test/index.html.haml +1 -0
- metadata +7 -1
data/.gitignore
CHANGED
data/bin/gearup
CHANGED
@@ -1,16 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
require 'rack'
|
5
|
-
require 'less'
|
6
|
-
require 'coffee-script'
|
7
|
-
require 'sprockets'
|
8
|
-
require 'haml'
|
3
|
+
$LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
|
9
4
|
|
5
|
+
require 'rubygems'
|
6
|
+
require 'gearup'
|
10
7
|
|
11
|
-
|
12
|
-
env.register_engine '.haml', Tilt::HamlTemplate
|
13
|
-
env.append_path "."
|
8
|
+
include Gearup
|
14
9
|
|
15
|
-
|
10
|
+
Server.new(Environment.build(ARGV[0] || "."), 3000).start
|
16
11
|
|
data/bin/gearup-package
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'gearup'
|
7
|
+
require 'pathname'
|
8
|
+
|
9
|
+
include Gearup
|
10
|
+
|
11
|
+
asset_dir, target_dir, *assets = ARGV
|
12
|
+
|
13
|
+
env = Environment.build(asset_dir)
|
14
|
+
|
15
|
+
assets.each do |asset_name|
|
16
|
+
asset = env.find_asset(asset_name)
|
17
|
+
destination_path = Pathname.new(File.expand_path(asset.digest_path, target_dir))
|
18
|
+
destination_path.dirname.mkpath
|
19
|
+
File.open(destination_path, 'w') {|f| f.write asset.body }
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'less'
|
2
|
+
require 'coffee-script'
|
3
|
+
require 'haml'
|
4
|
+
require 'sass'
|
5
|
+
require 'sprockets'
|
6
|
+
require 'gearup/context'
|
7
|
+
|
8
|
+
module Gearup
|
9
|
+
module Environment
|
10
|
+
def self.build root
|
11
|
+
env = Sprockets::Environment.new root
|
12
|
+
env.register_engine '.haml', Tilt::HamlTemplate
|
13
|
+
env.register_engine '.sass', Tilt::SassTemplate
|
14
|
+
env.append_path "."
|
15
|
+
|
16
|
+
env.context_class.class_eval do
|
17
|
+
include Gearup::Context
|
18
|
+
end
|
19
|
+
|
20
|
+
env
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
data/lib/gearup/version.rb
CHANGED
data/lib/gearup.rb
ADDED
data/test/index.html.haml
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gearup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrew Kiellor
|
@@ -116,6 +116,7 @@ email:
|
|
116
116
|
- akiellor@thoughtworks.com
|
117
117
|
executables:
|
118
118
|
- gearup
|
119
|
+
- gearup-package
|
119
120
|
extensions: []
|
120
121
|
|
121
122
|
extra_rdoc_files: []
|
@@ -127,7 +128,12 @@ files:
|
|
127
128
|
- README.md
|
128
129
|
- Rakefile
|
129
130
|
- bin/gearup
|
131
|
+
- bin/gearup-package
|
130
132
|
- gearup.gemspec
|
133
|
+
- lib/gearup.rb
|
134
|
+
- lib/gearup/context.rb
|
135
|
+
- lib/gearup/environment.rb
|
136
|
+
- lib/gearup/server.rb
|
131
137
|
- lib/gearup/version.rb
|
132
138
|
- test/application.css.less
|
133
139
|
- test/application.js.coffee
|