tipsy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +6 -11
  3. data/README.md +24 -1
  4. data/Rakefile +13 -9
  5. data/bin/tipsy +4 -2
  6. data/lib/templates/server/htaccess.erb +14 -0
  7. data/lib/templates/site/Gemfile +19 -0
  8. data/lib/templates/site/assets/stylesheets/_config.css.scss +1 -0
  9. data/lib/templates/site/assets/stylesheets/screen.css.scss +1 -0
  10. data/lib/templates/site/config.rb +52 -0
  11. data/lib/templates/site/deploy.yml +27 -0
  12. data/lib/templates/site/layouts/default.html.erb +41 -0
  13. data/lib/templates/site/views/index.html.erb +2 -0
  14. data/lib/tipsy/compressors/{css.rb → css_compressor.rb} +0 -0
  15. data/lib/tipsy/compressors/javascript_compressor.rb +44 -0
  16. data/lib/tipsy/configuration.rb +9 -0
  17. data/lib/tipsy/handler/all.rb +4 -0
  18. data/lib/tipsy/handler/asset.rb +93 -0
  19. data/lib/tipsy/handler/erb.rb +42 -0
  20. data/lib/tipsy/handler/php.rb +36 -0
  21. data/lib/tipsy/{sass/template.rb → handler/sass/importer.rb} +15 -53
  22. data/lib/tipsy/handler/sass/resolver.rb +30 -0
  23. data/lib/tipsy/handler/sass.rb +36 -0
  24. data/lib/tipsy/handler/static.rb +30 -0
  25. data/lib/tipsy/helpers/asset_paths.rb +29 -1
  26. data/lib/tipsy/helpers/asset_tags.rb +1 -1
  27. data/lib/tipsy/helpers/capture.rb +12 -41
  28. data/lib/tipsy/helpers/rendering.rb +46 -0
  29. data/lib/tipsy/helpers/sass.rb +17 -6
  30. data/lib/tipsy/helpers/tag.rb +6 -9
  31. data/lib/tipsy/helpers.rb +13 -16
  32. data/lib/tipsy/runner.rb +82 -0
  33. data/lib/tipsy/runners/compiler.rb +189 -0
  34. data/lib/tipsy/runners/deployer.rb +7 -0
  35. data/lib/tipsy/runners/generator.rb +24 -0
  36. data/lib/tipsy/server.rb +56 -114
  37. data/lib/tipsy/site.rb +88 -0
  38. data/lib/tipsy/utils/logger.rb +47 -0
  39. data/lib/tipsy/utils/system.rb +115 -0
  40. data/lib/tipsy/utils/system_test.rb +103 -0
  41. data/lib/tipsy/version.rb +1 -1
  42. data/lib/tipsy/view/base.rb +55 -0
  43. data/lib/tipsy/view/context.rb +28 -0
  44. data/lib/tipsy/view/path.rb +44 -0
  45. data/lib/tipsy/view.rb +14 -68
  46. data/lib/tipsy.rb +30 -67
  47. data/{lib/tipsy/project/assets/javascripts/site.js → test/fixtures/capture.html.erb} +0 -0
  48. data/test/helpers/tag_test.rb +22 -0
  49. data/{lib/tipsy/project/assets/stylesheets/screen.css.scss → test/root/compiled/fake.txt} +0 -0
  50. data/test/root/{test/assets/javascripts/test.js → compiled/sub-path/fake.txt} +0 -0
  51. data/test/root/{development/assets/javascripts/test.js → compiled/sub-path-with-skip/fake.txt} +0 -0
  52. data/test/root/layouts/default.html.erb +0 -0
  53. data/test/root/views/index.html.erb +0 -0
  54. data/test/root/views/page.html.erb +0 -0
  55. data/test/root/views/sub/page.html.erb +0 -0
  56. data/test/root/views/sub/tertiary/index.html.erb +0 -0
  57. data/test/runner/compiler_test.rb +49 -0
  58. data/test/test_helper.rb +160 -21
  59. data/test/unit/site_test.rb +23 -0
  60. data/test/unit/tipsy_test.rb +13 -0
  61. data/test/unit/utils/system_test.rb +26 -0
  62. data/test/view/base_test.rb +34 -0
  63. data/test/view/path_test.rb +34 -0
  64. data/tipsy.gemspec +10 -7
  65. metadata +113 -84
  66. data/lib/tipsy/application.rb +0 -86
  67. data/lib/tipsy/builder.rb +0 -26
  68. data/lib/tipsy/builders/base.rb +0 -64
  69. data/lib/tipsy/builders/export.rb +0 -16
  70. data/lib/tipsy/builders/project.rb +0 -40
  71. data/lib/tipsy/builders/remote.rb +0 -14
  72. data/lib/tipsy/compressors/javascript.rb +0 -25
  73. data/lib/tipsy/logger.rb +0 -62
  74. data/lib/tipsy/project/Gemfile +0 -8
  75. data/lib/tipsy/project/config.erb +0 -19
  76. data/lib/tipsy/project/helpers/site_helper.rb +0 -4
  77. data/lib/tipsy/project/views/_layout.html.erb +0 -16
  78. data/test/fixtures/about.html +0 -1
  79. data/test/fixtures/contact.html +0 -1
  80. data/test/fixtures/index.html +0 -1
  81. data/test/functional/page_test.rb +0 -33
  82. data/test/root/.gitignore +0 -7
  83. data/test/root/development/assets/stylesheets/screen.css.scss +0 -3
  84. data/test/root/development/config.rb +0 -6
  85. data/test/root/development/views/_layout.html.erb +0 -20
  86. data/test/root/development/views/index.html.erb +0 -3
  87. data/test/root/test/assets/stylesheets/screen.css.scss +0 -3
  88. data/test/root/test/config.rb +0 -6
  89. data/test/root/test/views/_layout.html.erb +0 -1
  90. data/test/root/test/views/about/index.html +0 -1
  91. data/test/root/test/views/contact.html +0 -1
  92. data/test/root/test/views/index.html.erb +0 -1
  93. data/test/unit/helpers/asset_paths_test.rb +0 -14
  94. data/test/unit/helpers_test.rb +0 -22
  95. data/test/unit/server_test.rb +0 -1
@@ -1,16 +0,0 @@
1
- <!DOCTYPE html>
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
- <head>
4
- <meta charset="utf-8"/>
5
- <title></title>
6
- <meta name="keywords" content=""/>
7
- <meta name="description" content=""/>
8
- <!--[if lte IE 8]>
9
- <![endif]-->
10
- <!--[if IE 8]>
11
- <![endif]-->
12
- </head>
13
- <body>
14
- <%= yield %>
15
- </body>
16
- </html>
@@ -1 +0,0 @@
1
- about page
@@ -1 +0,0 @@
1
- test contact
@@ -1 +0,0 @@
1
- index file
@@ -1,33 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PageTest < Test::Unit::TestCase
4
- include Rack::Test::Methods
5
- include Tipsy::Test::Helpers
6
-
7
- def app
8
- Tipsy::Test.app
9
- end
10
-
11
- def test_the_home_page_is_successful
12
- get "/"
13
- assert last_response.ok?
14
- end
15
-
16
- def test_the_home_page_renders_index
17
- get "/"
18
- to_html(last_response.body).should == fixture('index.html')
19
- end
20
-
21
- def test_the_about_page_renders_about
22
- get '/about'
23
- assert last_response.ok?
24
- to_html(last_response.body).should == fixture('about.html')
25
- end
26
-
27
- def test_find_page_above_folder
28
- get '/contact'
29
- assert last_response.ok?
30
- to_html(last_response.body).should == fixture('contact.html')
31
- end
32
-
33
- end
data/test/root/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- .DS_Store
6
- .rvmrc
7
- .sass-cache/*
@@ -1,3 +0,0 @@
1
- //= require_self
2
- body{ background:black; }
3
- p{ font-size:10px; }
@@ -1,6 +0,0 @@
1
- class TestRoot < Tipsy::Application
2
-
3
- # Configure assets that should be precompiled
4
- config.assets << "application.js"
5
-
6
- end
@@ -1,20 +0,0 @@
1
- <!DOCTYPE html>
2
- <?xml version="1.0" encoding="utf-8"?>
3
- <!DOCTYPE html>
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta charset="utf-8"/>
7
- <title></title>
8
- <meta name="keywords" content=""/>
9
- <meta name="description" content=""/>
10
- <!--[if lte IE 8]>
11
- <![endif]-->
12
- <!--[if IE 8]>
13
- <![endif]-->
14
- </head>
15
- <body>
16
- <p> I wrap the <%= yield %> in a layout</p>
17
- <p>I'm a var set in the view: <%= @poop %></p>
18
- <p>Some bold text set in the view: <%= content_for(:text) %></p>
19
- </body>
20
- </html>
@@ -1,3 +0,0 @@
1
- <% @poop = 'awesome' %>
2
- <strong>content</strong>
3
- <% content_for(:text, "THIS IS SOME BOLD ACTION") %>
@@ -1,3 +0,0 @@
1
- //= require_self
2
- body{ background:black; }
3
- p{ font-size:10px; }
@@ -1,6 +0,0 @@
1
- class TestRoot < Tipsy::Application
2
-
3
- # Configure assets that should be precompiled
4
- config.assets << "application.js"
5
-
6
- end
@@ -1 +0,0 @@
1
- <%= yield %>
@@ -1 +0,0 @@
1
- about page
@@ -1 +0,0 @@
1
- test contact
@@ -1 +0,0 @@
1
- index file
@@ -1,14 +0,0 @@
1
- require 'test_helper'
2
-
3
- class AssetPathsTest < Test::Unit::TestCase
4
- include Tipsy::Helpers
5
-
6
- def test_asset_path_helper
7
- asset_path("something.js").should == '/assets/something.js'
8
- end
9
-
10
- def test_absolute_asset_path
11
- asset_path("/js/something.js").should == '/js/something.js'
12
- end
13
-
14
- end
@@ -1,22 +0,0 @@
1
- require 'test_helper'
2
-
3
- class HelpersTest < Test::Unit::TestCase
4
- include Tipsy::Helpers
5
-
6
- def test_tag_helper
7
- tag(:img, :src => 'test.png').should == '<img src="test.png" />'
8
- end
9
-
10
- def test_content_tag_helper
11
- content_tag(:p, 'hello', :class => 'test').should == '<p class="test">hello</p>'
12
- end
13
-
14
- def test_link_to_helper
15
- link_to('link', '/home').should == '<a href="/home">link</a>'
16
- end
17
-
18
- def test_mail_to_helper
19
- mail_to('test@test.com').should == '<a href="mailto:test@test.com">test@test.com</a>'
20
- end
21
-
22
- end
@@ -1 +0,0 @@
1
- require 'test_helper'