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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2516c1290c7aa1588250b79f0763ca529629ed80
4
- data.tar.gz: d51d57e4664cb5685303a060b167520e37814e80
3
+ metadata.gz: 08089ee737de880e59824c913acdc169679eccc4
4
+ data.tar.gz: 869dc62ec5dc67f718fa7280733bb9d121d93bd0
5
5
  SHA512:
6
- metadata.gz: 66601406e94e0e94f06ab564763c49c9e844fdb79682a9a6abf680a6613b79cfb31cdfdbb94e014beee8d7ac04a17a332fa66018841fc641ad420aa8b0cf9d22
7
- data.tar.gz: 576b376181a9380be5874eaba40795abe11b1069906d4ca14f330d0e077e3f3c745784bb9fe638b777fc12cc54cc4e05510fa27346b21f3887cd09d0dcdfeb33
6
+ metadata.gz: 63c9c5dc3b9d888418bf85a8657b9e5eeeaa5a364d7df8fba7c6cdf84174e54a0bbe3224eca89970c7a373cb7c9484a4f01252e4c20bbf0e9d8e43c0678d240f
7
+ data.tar.gz: 3e6997d42f2d4b488ed51e178e7253c6531d4deb6d5bb2b306252b649c94b84c307b064122f509abbe8ff3dd57e888a88e3514de5ee8cae5e3b731109ff70ece
data/RubyHtmlApp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'rubyhtmlapp/version'
4
+ require 'RubyHtmlApp/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "rubyhtmlapp"
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)
@@ -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.scss", "lib/#{name}/stylesheets/application.css.scss")
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")
@@ -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
- locals,
10
- &block).render(self)
11
- end
12
-
13
- def asset_data_uri(path)
14
- asset = @sprocket_env[path]
15
- Sprockets::Context.new(@sprocket_env, asset.logical_path, asset.pathname).asset_data_uri(path)
16
- end
17
-
18
- def find_f(path, pattern)
19
- Find.find(path) do |f|
20
- return f if File.fnmatch?(pattern, File.basename(f))
21
- end
22
- nil
23
- end
24
- end
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
@@ -0,0 +1,4 @@
1
+ module RubyHtmlApp
2
+ module Helpers
3
+ end
4
+ 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 .
@@ -2,6 +2,7 @@ require 'bundler/setup'
2
2
  require 'rubyhtmlapp'
3
3
  require '<%=@params[:name]%>/version'
4
4
  require '<%=@params[:name]%>/cli'
5
+ require '<%=@params[:name]%>/helpers'
5
6
 
6
7
  <%- @params[:constant_array].each_with_index do |c,i| -%>
7
8
  <%= ' '*i %>module <%= c %>
@@ -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
+ */
@@ -1,3 +1,3 @@
1
1
  module RubyHtmlApp
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-04-29 00:00:00.000000000 Z
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.scss
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