rubyhtmlapp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/RubyHtmlApp.gemspec +1 -1
- data/bin/rubyhtmlapp +4 -4
- data/lib/RubyHtmlApp/cli.rb +2 -1
- data/lib/RubyHtmlApp/helpers.rb +36 -24
- data/lib/RubyHtmlApp/templates/cli.rb +9 -9
- data/lib/RubyHtmlApp/templates/helpers.rb +4 -0
- data/lib/RubyHtmlApp/templates/html/layout.html.haml +9 -9
- data/lib/RubyHtmlApp/templates/javascripts/application.js +6 -6
- data/lib/RubyHtmlApp/templates/newgem.rb +1 -0
- data/lib/RubyHtmlApp/templates/run +5 -5
- data/lib/RubyHtmlApp/templates/stylesheets/{application.css.scss → application.css} +9 -9
- data/lib/RubyHtmlApp/version.rb +1 -1
- data/lib/RubyHtmlApp.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08089ee737de880e59824c913acdc169679eccc4
|
4
|
+
data.tar.gz: 869dc62ec5dc67f718fa7280733bb9d121d93bd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63c9c5dc3b9d888418bf85a8657b9e5eeeaa5a364d7df8fba7c6cdf84174e54a0bbe3224eca89970c7a373cb7c9484a4f01252e4c20bbf0e9d8e43c0678d240f
|
7
|
+
data.tar.gz: 3e6997d42f2d4b488ed51e178e7253c6531d4deb6d5bb2b306252b649c94b84c307b064122f509abbe8ff3dd57e888a88e3514de5ee8cae5e3b731109ff70ece
|
data/RubyHtmlApp.gemspec
CHANGED
data/bin/rubyhtmlapp
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubyhtmlapp'
|
4
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubyhtmlapp'
|
4
|
+
|
5
5
|
RubyHtmlApp::CLI.start(ARGV)
|
data/lib/RubyHtmlApp/cli.rb
CHANGED
@@ -41,8 +41,9 @@ module RubyHtmlApp
|
|
41
41
|
FileGenerator.file(:layout_html, "html/layout.html.haml", "lib/#{name}/html/layout.html.haml")
|
42
42
|
FileGenerator.empty_directory(:images, "lib/#{name}/images/")
|
43
43
|
FileGenerator.file(:application_js, "javascripts/application.js", "lib/#{name}/javascripts/application.js")
|
44
|
-
FileGenerator.file(:application_css, "stylesheets/application.css
|
44
|
+
FileGenerator.file(:application_css, "stylesheets/application.css", "lib/#{name}/stylesheets/application.css")
|
45
45
|
FileGenerator.empty_directory(:dist, "dist/")
|
46
|
+
FileGenerator.file(:helpers, "helpers.rb", "lib/#{name}/helpers.rb")
|
46
47
|
|
47
48
|
#erb files
|
48
49
|
FileGenerator.template(:cli, "cli.rb", "lib/#{name}/cli.rb")
|
data/lib/RubyHtmlApp/helpers.rb
CHANGED
@@ -1,25 +1,37 @@
|
|
1
|
-
require 'tilt'
|
2
|
-
require 'sprockets'
|
3
|
-
require 'find'
|
4
|
-
|
5
|
-
module RubyHtmlApp
|
6
|
-
module Helpers
|
7
|
-
def render(partial, locals={}, &block)
|
8
|
-
Tilt.new(find_f(@partial_path, "_#{partial}.html*"),
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
require 'tilt'
|
2
|
+
require 'sprockets'
|
3
|
+
require 'find'
|
4
|
+
|
5
|
+
module RubyHtmlApp
|
6
|
+
module Helpers
|
7
|
+
def render(partial, locals={}, &block)
|
8
|
+
Tilt.new(find_f(@partial_path, "_#{partial}.html*")).render(self, locals, &block)
|
9
|
+
end
|
10
|
+
|
11
|
+
def include_dir(dir, locals={}, &block)
|
12
|
+
html = ""
|
13
|
+
find_f_each(File.join(@partial_path, dir), "*.html*") do |f|
|
14
|
+
html.concat(Tilt.new(f).render(self, locals, &block))
|
15
|
+
end
|
16
|
+
return html
|
17
|
+
end
|
18
|
+
|
19
|
+
def asset_data_uri(path)
|
20
|
+
asset = @sprocket_env[path]
|
21
|
+
Sprockets::Context.new(@sprocket_env, asset.logical_path, asset.pathname).asset_data_uri(path)
|
22
|
+
end
|
23
|
+
|
24
|
+
def find_f(path, pattern)
|
25
|
+
Find.find(path) do |f|
|
26
|
+
return f if File.fnmatch?(pattern, File.basename(f))
|
27
|
+
end
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def find_f_each(path, pattern)
|
32
|
+
Find.find(path) do |f|
|
33
|
+
yield(f) if File.fnmatch?(pattern, File.basename(f))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
25
37
|
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
require 'thor'
|
2
|
-
|
3
|
-
module <%= @params[:constant_name] %>
|
4
|
-
class CLI < Thor
|
5
|
-
desc "compile", "compile all js, css, and html into a single file"
|
6
|
-
def compile()
|
7
|
-
app = RubyHtmlApp::HtmlApp.new('<%= @params[:name] %>').compile_resources
|
8
|
-
end
|
9
|
-
end
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module <%= @params[:constant_name] %>
|
4
|
+
class CLI < Thor
|
5
|
+
desc "compile", "compile all js, css, and html into a single file"
|
6
|
+
def compile()
|
7
|
+
app = RubyHtmlApp::HtmlApp.new('<%= @params[:name] %>').compile_resources
|
8
|
+
end
|
9
|
+
end
|
10
10
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
!!! 5
|
2
|
-
%html
|
3
|
-
%head
|
4
|
-
%title= title ||= ""
|
5
|
-
:javascript
|
6
|
-
#{inline_js}
|
7
|
-
:css
|
8
|
-
#{inline_css}
|
9
|
-
%body= yield
|
1
|
+
!!! 5
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title= title ||= ""
|
5
|
+
:javascript
|
6
|
+
#{inline_js}
|
7
|
+
:css
|
8
|
+
#{inline_css}
|
9
|
+
%body= yield
|
@@ -1,6 +1,6 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
-
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
-
// be included in the compiled file. It's not advisable to add code directly here, but if you do, it'll appear
|
4
|
-
// at the bottom of the the compiled file.
|
5
|
-
//
|
6
|
-
//= require_tree .
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file. It's not advisable to add code directly here, but if you do, it'll appear
|
4
|
+
// at the bottom of the the compiled file.
|
5
|
+
//
|
6
|
+
//= require_tree .
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require '<%= @params[:name] %>'
|
5
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require '<%= @params[:name] %>'
|
5
|
+
|
6
6
|
<%= @params[:constant_name] %>::CLI.start(ARGV)
|
@@ -1,9 +1,9 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll automatically include all the stylesheets available in this directo\
|
3
|
-
ry
|
4
|
-
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear\
|
5
|
-
at
|
6
|
-
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
7
|
-
*= require_self
|
8
|
-
*= require_tree .
|
9
|
-
*/
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directo\
|
3
|
+
ry
|
4
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear\
|
5
|
+
at
|
6
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
7
|
+
*= require_self
|
8
|
+
*= require_tree .
|
9
|
+
*/
|
data/lib/RubyHtmlApp/version.rb
CHANGED
data/lib/RubyHtmlApp.rb
CHANGED
@@ -50,6 +50,7 @@ module RubyHtmlApp
|
|
50
50
|
|
51
51
|
css_source = @sprocket_env[@main_css].source
|
52
52
|
js_source = @sprocket_env[@main_js].source
|
53
|
+
js_source.gsub!('</script>', '<\/script>')
|
53
54
|
|
54
55
|
FileUtils.mkpath(@build_path) if !File.exists?(@build_path)
|
55
56
|
File.open(File.join(@build_path, @build_name), "w") do |f|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyhtmlapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Curtis Bissonnette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -127,13 +127,14 @@ files:
|
|
127
127
|
- lib/RubyHtmlApp/cli.rb
|
128
128
|
- lib/RubyHtmlApp/helpers.rb
|
129
129
|
- lib/RubyHtmlApp/templates/cli.rb
|
130
|
+
- lib/RubyHtmlApp/templates/helpers.rb
|
130
131
|
- lib/RubyHtmlApp/templates/html/application.html.haml
|
131
132
|
- lib/RubyHtmlApp/templates/html/layout.html.haml
|
132
133
|
- lib/RubyHtmlApp/templates/javascripts/application.js
|
133
134
|
- lib/RubyHtmlApp/templates/newgem.gemspec
|
134
135
|
- lib/RubyHtmlApp/templates/newgem.rb
|
135
136
|
- lib/RubyHtmlApp/templates/run
|
136
|
-
- lib/RubyHtmlApp/templates/stylesheets/application.css
|
137
|
+
- lib/RubyHtmlApp/templates/stylesheets/application.css
|
137
138
|
- lib/RubyHtmlApp/version.rb
|
138
139
|
homepage: https://github.com/cjbissonnette/rubyhtmlapp
|
139
140
|
licenses:
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
version: '0'
|
156
157
|
requirements: []
|
157
158
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.0.0
|
159
|
+
rubygems_version: 2.0.0.rc.2
|
159
160
|
signing_key:
|
160
161
|
specification_version: 4
|
161
162
|
summary: A simple generator used to setup a project for sprockets and tilt which will
|