utopia 2.5.5 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -2
  3. data/Gemfile +1 -0
  4. data/Rakefile +2 -0
  5. data/docs/code/Utopia.html +439 -433
  6. data/docs/code/Utopia/Command.html +201 -195
  7. data/docs/code/Utopia/Command/Environment.html +244 -244
  8. data/docs/code/Utopia/Command/Server.html +202 -202
  9. data/docs/code/Utopia/Command/Server/Create.html +192 -192
  10. data/docs/code/Utopia/Command/Server/Update.html +235 -235
  11. data/docs/code/Utopia/Command/Site.html +269 -263
  12. data/docs/code/Utopia/Command/Site/Create.html +192 -192
  13. data/docs/code/Utopia/Command/Site/Update.html +246 -246
  14. data/docs/code/Utopia/Command/Top.html +244 -244
  15. data/docs/code/Utopia/Content.html +636 -630
  16. data/docs/code/Utopia/Content/Document.html +1411 -1407
  17. data/docs/code/Utopia/Content/Document/State.html +1048 -1048
  18. data/docs/code/Utopia/Content/Link.html +1023 -1023
  19. data/docs/code/Utopia/Content/Links.html +629 -623
  20. data/docs/code/Utopia/Content/MarkupParser.html +702 -702
  21. data/docs/code/Utopia/Content/MarkupParser/ParsedTag.html +375 -375
  22. data/docs/code/Utopia/Content/MarkupParser/UnbalancedTagError.html +523 -523
  23. data/docs/code/Utopia/Content/Namespace.html +416 -416
  24. data/docs/code/Utopia/Content/Node.html +952 -952
  25. data/docs/code/Utopia/Content/Node/Context.html +790 -790
  26. data/docs/code/Utopia/Content/Response.html +686 -686
  27. data/docs/code/Utopia/Content/SymbolicHash.html +365 -365
  28. data/docs/code/Utopia/Content/Tags.html +134 -134
  29. data/docs/code/Utopia/Content/UnbalancedTagError.html +270 -270
  30. data/docs/code/Utopia/ContentLength.html +298 -294
  31. data/docs/code/Utopia/Controller.html +657 -651
  32. data/docs/code/Utopia/Controller/Actions.html +260 -260
  33. data/docs/code/Utopia/Controller/Actions/Action.html +785 -779
  34. data/docs/code/Utopia/Controller/Actions/ClassMethods.html +360 -360
  35. data/docs/code/Utopia/Controller/Base.html +989 -989
  36. data/docs/code/Utopia/Controller/Respond.html +264 -254
  37. data/docs/code/Utopia/Controller/Respond/ClassMethods.html +207 -207
  38. data/docs/code/Utopia/Controller/Respond/Converter.html +219 -219
  39. data/docs/code/Utopia/Controller/Respond/Converter/Callback.html +425 -425
  40. data/docs/code/Utopia/Controller/Respond/Converter/ToJSON.html +323 -317
  41. data/docs/code/Utopia/Controller/Respond/Passthrough.html +266 -260
  42. data/docs/code/Utopia/Controller/Respond/Responder.html +449 -443
  43. data/docs/code/Utopia/Controller/Rewrite.html +260 -260
  44. data/docs/code/Utopia/Controller/Rewrite/ClassMethods.html +216 -216
  45. data/docs/code/Utopia/Controller/Rewrite/ExtractPrefixRule.html +303 -303
  46. data/docs/code/Utopia/Controller/Rewrite/Rewriter.html +402 -402
  47. data/docs/code/Utopia/Controller/Rewrite/Rule.html +193 -193
  48. data/docs/code/Utopia/Controller/Variables.html +428 -428
  49. data/docs/code/Utopia/Controllers.html +216 -216
  50. data/docs/code/Utopia/Exceptions.html +125 -125
  51. data/docs/code/Utopia/Exceptions/Handler.html +405 -405
  52. data/docs/code/Utopia/Exceptions/Mailer.html +400 -394
  53. data/docs/code/Utopia/Extensions.html +116 -116
  54. data/docs/code/Utopia/Extensions/ArraySplit.html +164 -164
  55. data/docs/code/Utopia/Extensions/DateTimeComparison.html +173 -173
  56. data/docs/code/Utopia/Extensions/TimeDateComparison.html +173 -173
  57. data/docs/code/Utopia/HTTP.html +193 -187
  58. data/docs/code/Utopia/HTTP/Status.html +355 -355
  59. data/docs/code/Utopia/Locale.html +522 -522
  60. data/docs/code/Utopia/Localization.html +886 -880
  61. data/docs/code/Utopia/Localization/Wrapper.html +403 -403
  62. data/docs/code/Utopia/Logger.html +185 -185
  63. data/docs/code/Utopia/Logger/CompactFormatter.html +290 -290
  64. data/docs/code/Utopia/Path.html +2562 -2556
  65. data/docs/code/Utopia/Path/Matcher.html +395 -395
  66. data/docs/code/Utopia/Path/Matcher/MatchData.html +418 -418
  67. data/docs/code/Utopia/Redirection.html +148 -142
  68. data/docs/code/Utopia/Redirection/ClientRedirect.html +594 -594
  69. data/docs/code/Utopia/Redirection/DirectoryIndex.html +265 -265
  70. data/docs/code/Utopia/Redirection/Errors.html +391 -385
  71. data/docs/code/Utopia/Redirection/Moved.html +265 -265
  72. data/docs/code/Utopia/Redirection/RequestFailure.html +201 -201
  73. data/docs/code/Utopia/Redirection/Rewrite.html +265 -265
  74. data/docs/code/Utopia/Session.html +723 -717
  75. data/docs/code/Utopia/Session/LazyHash.html +709 -709
  76. data/docs/code/Utopia/Setup.html +783 -777
  77. data/docs/code/Utopia/Static.html +516 -510
  78. data/docs/code/Utopia/Static/LocalFile.html +875 -869
  79. data/docs/code/Utopia/Static/MimeTypeLoader.html +427 -427
  80. data/docs/code/Utopia/Static/MimeTypeLoader/ExpansionError.html +123 -123
  81. data/docs/code/_index.html +757 -757
  82. data/docs/code/class_list.html +51 -51
  83. data/docs/code/css/full_list.css +58 -58
  84. data/docs/code/css/style.css +496 -499
  85. data/docs/code/file.README.html +72 -70
  86. data/docs/code/file_list.html +56 -56
  87. data/docs/code/frames.html +17 -17
  88. data/docs/code/index.html +72 -70
  89. data/docs/code/js/app.js +292 -248
  90. data/docs/code/js/full_list.js +216 -216
  91. data/docs/code/js/jquery.js +3 -3
  92. data/docs/code/method_list.html +3443 -3443
  93. data/docs/code/top-level-namespace.html +109 -109
  94. data/docs/index.html +2 -2
  95. data/docs/wiki.html +2 -2
  96. data/docs/wiki/edit.html +1 -1
  97. data/docs/wiki/javascript.html +153 -0
  98. data/docs/wiki/javascript/index.html +153 -0
  99. data/documentation/.yarnrc +1 -0
  100. data/documentation/Gemfile +1 -0
  101. data/documentation/config/environment.rb +1 -0
  102. data/documentation/pages/wiki/content.md +1 -1
  103. data/documentation/pages/wiki/javascript/content.md +75 -0
  104. data/documentation/pages/wiki/links.yaml +3 -1
  105. data/lib/utopia/command/site.rb +4 -4
  106. data/lib/utopia/version.rb +1 -1
  107. data/setup/site/.yarnrc +1 -0
  108. data/setup/site/tasks/yarn.rake +32 -0
  109. data/spec/utopia/command_spec.rb +2 -2
  110. metadata +8 -9
  111. data/docs/wiki/bower-integration.html +0 -74
  112. data/docs/wiki/bower-integration/index.html +0 -74
  113. data/documentation/.bowerrc +0 -4
  114. data/documentation/pages/wiki/bower-integration/content.md +0 -25
  115. data/setup/.bowerrc +0 -3
  116. data/setup/site/.bowerrc +0 -4
  117. data/setup/site/tasks/bower.rake +0 -45
@@ -0,0 +1 @@
1
+ --modules-folder lib/components
@@ -9,6 +9,7 @@ gem "rake"
9
9
  gem "bundler"
10
10
 
11
11
  gem "kramdown"
12
+ gem "kramdown-parser-gfm"
12
13
 
13
14
  group :development do
14
15
  # For `rake server`:
@@ -8,3 +8,4 @@ Utopia.setup
8
8
  RACK_ENV = ENV.fetch('RACK_ENV', :development).to_sym unless defined? RACK_ENV
9
9
 
10
10
  require 'kramdown'
11
+ require 'kramdown/parser/gfm'
@@ -10,7 +10,7 @@ Reading these pages in order will give you an overview of the design of Utopia,
10
10
  - [Server Setup](server-setup/)
11
11
  - [Your First Page](your-first-page/)
12
12
  - [What is `.xnode`?](faq/what-is-xnode/)
13
- - [Installing JavaScript Libraries](bower-integration/)
13
+ - [Installing JavaScript Libraries](javascript/)
14
14
  - [Website Tests](testing/)
15
15
  - [Updating Your Site](updating-utopia/)
16
16
 
@@ -0,0 +1,75 @@
1
+ # Yarn Integration
2
+
3
+ Utopia integrates with Yarn and provides a rake task to simplify deployment packages distributed using `yarn` that implement the `dist` sub-directory convention.
4
+
5
+ By default, utopia includes a `.yarnrc` file which installs modules into `lib/components`. This code can then be copied into `public/_components` using `rake yarn:update`.
6
+
7
+ ## Installing Yarn
8
+
9
+ If you don't already have yarn installed, make sure you have npm installed and then run the following command:
10
+
11
+ $ sudo npm install -g yarn
12
+
13
+ ## Installing jQuery
14
+
15
+ Firstly, ensure your project has a `package.json` file:
16
+
17
+ $ yarn init
18
+
19
+ Then install jquery using `yarn`:
20
+
21
+ $ bower install jquery
22
+
23
+ Copy the distribution scripts to `public/_components`:
24
+
25
+ $ rake yarn:update
26
+
27
+ Then add the appropriate `<script>` tags to `pages/_page.xnode`:
28
+
29
+ ```html
30
+ <script type="text/javascript" src="/_components/jquery/jquery.min.js"></script>
31
+ ```
32
+
33
+ ### What does `rake yarn:update` do?
34
+
35
+ This task copies only the contents of the `dist` directory. This ensures that you only get files intended for distribution. If the bower package doesn't have a `dist` directory, the entire contents is copied.
36
+
37
+ <content:listing rel="site" src="tasks/yarn.rake" brush="ruby" />
38
+
39
+ ## Using JavaScript
40
+
41
+ You can use JavaScript by embedding it directly into your HTML, or by creating a JavaScript source file and referencing that.
42
+
43
+ ### Embedding Code
44
+
45
+ In your HTML view:
46
+
47
+ ```trenni
48
+ <html>
49
+ <body>
50
+ <script type="text/javascript">
51
+ //<![CDATA[
52
+ console.log("Hello World")
53
+ //]]>
54
+ </script>
55
+ </body>
56
+ </html>
57
+ ```
58
+
59
+ ### External Script
60
+
61
+ In `script.js`:
62
+
63
+ ```javascript
64
+ console.log("Hello World")
65
+ ```
66
+
67
+ In your HTML view:
68
+
69
+ ```trenni
70
+ <html>
71
+ <body>
72
+ <script type="text/javascript" src="script.js"></script>
73
+ </body>
74
+ </html>
75
+ ```
@@ -1,4 +1,6 @@
1
1
  index:
2
2
  title: Wiki
3
3
  faq:
4
- title: FAQ
4
+ title: FAQ
5
+ javascript:
6
+ title: "JavaScript"
@@ -31,13 +31,13 @@ module Utopia
31
31
  # Local site setup commands.
32
32
  class Site < Samovar::Command
33
33
  # Configuration files which should be installed/updated:
34
- CONFIGURATION_FILES = ['.bowerrc', '.gitignore', 'config.ru', 'config/environment.rb', 'Gemfile', 'Guardfile', 'Rakefile', 'tasks/bower.rake', 'tasks/deploy.rake', 'tasks/development.rake', 'tasks/environment.rake', 'tasks/log.rake']
34
+ CONFIGURATION_FILES = ['.yarnrc', '.gitignore', 'config.ru', 'config/environment.rb', 'Gemfile', 'Guardfile', 'Rakefile', 'tasks/yarn.rake', 'tasks/deploy.rake', 'tasks/development.rake', 'tasks/environment.rake', 'tasks/log.rake']
35
35
 
36
36
  # Directories that should exist:
37
37
  DIRECTORIES = ["config", "lib", "pages", "public", "tasks"]
38
38
 
39
39
  # Directories that should be removed during upgrade process:
40
- OLD_PATHS = ["access_log", "cache", "tmp", 'tasks/test.rake', 'tasks/utopia.rake']
40
+ OLD_PATHS = ["access_log", "cache", "tmp", 'tasks/test.rake', 'tasks/utopia.rake', '.bowerrc', 'tasks/bower.rake']
41
41
 
42
42
  # The root directory of the template site:
43
43
  ROOT = File.join(SETUP_ROOT, 'site')
@@ -156,7 +156,7 @@ module Utopia
156
156
  end
157
157
 
158
158
  CONFIGURATION_FILES.each do |configuration_file|
159
- source_path = File.join(Setup::Site::ROOT, configuration_file)
159
+ source_path = File.join(Site::ROOT, configuration_file)
160
160
  destination_path = File.join(destination_root, configuration_file)
161
161
 
162
162
  $stderr.puts "Updating #{destination_path}..."
@@ -172,7 +172,7 @@ module Utopia
172
172
  system("git", "add", "-u") or fail "could not add files"
173
173
 
174
174
  # Stage any new files that we have explicitly added:
175
- system("git", "add", *Setup::Site::CONFIGURATION_FILES) or fail "could not add files"
175
+ system("git", "add", *Site::CONFIGURATION_FILES) or fail "could not add files"
176
176
 
177
177
  move_static!
178
178
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "2.5.5"
22
+ VERSION = "2.6.0"
23
23
  end
@@ -0,0 +1 @@
1
+ --modules-folder lib/components
@@ -0,0 +1,32 @@
1
+
2
+ namespace :yarn do
3
+ desc 'Load the .bowerrc file and setup the environment for other tasks.'
4
+ task :environment do
5
+ @yarn_package_root = SITE_ROOT + "lib/components"
6
+ @yarn_install_root = SITE_ROOT + "public/_components"
7
+ end
8
+
9
+ desc 'Update the bower packages and link into the public directory.'
10
+ task :update => :environment do
11
+ require 'fileutils'
12
+ require 'utopia/path'
13
+
14
+ @yarn_package_root.children.select(&:directory?).collect(&:basename).each do |package_directory|
15
+ install_path = @yarn_install_root + package_directory
16
+ package_path = @yarn_package_root + package_directory
17
+ dist_path = package_path + 'dist'
18
+
19
+ FileUtils::Verbose.rm_rf install_path
20
+ FileUtils::Verbose.mkpath(install_path.dirname)
21
+
22
+ # If a package has a dist directory, we only symlink that... otherwise we have to do the entire package, and hope that bower's ignore was setup correctly:
23
+ if File.exist? dist_path
24
+ link_path = Utopia::Path.shortest_path(dist_path, install_path)
25
+ else
26
+ link_path = Utopia::Path.shortest_path(package_path, install_path)
27
+ end
28
+
29
+ FileUtils::Verbose.cp_r File.expand_path(link_path, install_path), install_path
30
+ end
31
+ end
32
+ end
@@ -84,7 +84,7 @@ RSpec.describe "utopia command" do
84
84
  result = sh_status(utopia, "--in", dir, "site", "create")
85
85
  expect(result).to be == 0
86
86
 
87
- expect(Dir.entries(dir)).to include(".bowerrc", ".git", "Gemfile", "Gemfile.lock", "README.md", "Rakefile", "config.ru", "lib", "pages", "public", "spec")
87
+ expect(Dir.entries(dir)).to include(".yarnrc", ".git", "Gemfile", "Gemfile.lock", "README.md", "Rakefile", "config.ru", "lib", "pages", "public", "spec")
88
88
 
89
89
  Dir.chdir(dir) do
90
90
  result = sh_status("rake", "test")
@@ -158,7 +158,7 @@ RSpec.describe "utopia command" do
158
158
  expect(result).to be == 0
159
159
  end
160
160
 
161
- files = %W[.bowerrc .git Gemfile Gemfile.lock README.md Rakefile config.ru lib pages public]
161
+ files = %W[.yarnrc .git Gemfile Gemfile.lock README.md Rakefile config.ru lib pages public]
162
162
 
163
163
  expect(Dir.entries(server_path)).to include(*files)
164
164
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.5
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-04 00:00:00.000000000 Z
11
+ date: 2019-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trenni
@@ -402,13 +402,13 @@ files:
402
402
  - docs/code/top-level-namespace.html
403
403
  - docs/index.html
404
404
  - docs/wiki.html
405
- - docs/wiki/bower-integration.html
406
- - docs/wiki/bower-integration/index.html
407
405
  - docs/wiki/development-environment-setup.html
408
406
  - docs/wiki/development-environment-setup/index.html
409
407
  - docs/wiki/edit.html
410
408
  - docs/wiki/faq/what-is-xnode.html
411
409
  - docs/wiki/faq/what-is-xnode/index.html
410
+ - docs/wiki/javascript.html
411
+ - docs/wiki/javascript/index.html
412
412
  - docs/wiki/middleware/content.html
413
413
  - docs/wiki/middleware/content/index.html
414
414
  - docs/wiki/middleware/controller.html
@@ -434,8 +434,8 @@ files:
434
434
  - docs/wiki/updating-utopia/index.html
435
435
  - docs/wiki/your-first-page.html
436
436
  - docs/wiki/your-first-page/index.html
437
- - documentation/.bowerrc
438
437
  - documentation/.rspec
438
+ - documentation/.yarnrc
439
439
  - documentation/Gemfile
440
440
  - documentation/Guardfile
441
441
  - documentation/Rakefile
@@ -451,12 +451,12 @@ files:
451
451
  - documentation/pages/links.yaml
452
452
  - documentation/pages/wiki/_listing.xnode
453
453
  - documentation/pages/wiki/_navigation.xnode
454
- - documentation/pages/wiki/bower-integration/content.md
455
454
  - documentation/pages/wiki/content.md
456
455
  - documentation/pages/wiki/controller.rb
457
456
  - documentation/pages/wiki/development-environment-setup/content.md
458
457
  - documentation/pages/wiki/edit.xnode
459
458
  - documentation/pages/wiki/faq/what-is-xnode/content.md
459
+ - documentation/pages/wiki/javascript/content.md
460
460
  - documentation/pages/wiki/links.yaml
461
461
  - documentation/pages/wiki/middleware/content/content.md
462
462
  - documentation/pages/wiki/middleware/controller/actions/content.md
@@ -592,11 +592,10 @@ files:
592
592
  - lib/utopia/version.rb
593
593
  - materials/utopia.png
594
594
  - materials/utopia.svg
595
- - setup/.bowerrc
596
595
  - setup/server/git/hooks/post-receive
597
- - setup/site/.bowerrc
598
596
  - setup/site/.gitignore
599
597
  - setup/site/.rspec
598
+ - setup/site/.yarnrc
600
599
  - setup/site/Gemfile
601
600
  - setup/site/Guardfile
602
601
  - setup/site/README.md
@@ -619,12 +618,12 @@ files:
619
618
  - setup/site/spec/spec_helper.rb
620
619
  - setup/site/spec/website_context.rb
621
620
  - setup/site/spec/website_spec.rb
622
- - setup/site/tasks/bower.rake
623
621
  - setup/site/tasks/deploy.rake
624
622
  - setup/site/tasks/development.rake
625
623
  - setup/site/tasks/environment.rake
626
624
  - setup/site/tasks/log.rake
627
625
  - setup/site/tasks/static.rake
626
+ - setup/site/tasks/yarn.rake
628
627
  - spec/mock_node.rb
629
628
  - spec/spec_helper.rb
630
629
  - spec/utopia/command_spec.rb
@@ -1,74 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
-
5
- <title>Bower Integration - Utopia</title>
6
-
7
- <meta charset="UTF-8"/>
8
-
9
- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"/>
10
-
11
- <link rel="icon" type="image/png" href="../_static/icon.png"/>
12
- <link rel="stylesheet" href="../_static/site.css" type="text/css" media="screen"/>
13
-
14
- <script src="../_components/jquery/jquery.min.js"></script>
15
- <script src="../_components/jquery-syntax/jquery.syntax.min.js"></script>
16
-
17
- <script type="text/javascript">
18
- //<![CDATA[
19
- jQuery(function($) {
20
- $.syntax();
21
- });
22
- //]]>
23
- </script>
24
- </head>
25
-
26
- <body class="">
27
- <header>
28
- <img src="../_static/utopia.svg"/>
29
- </header>
30
-
31
- <div id="page">
32
-
33
- <nav>
34
- › <a href="../wiki.html">Wiki</a> › <a href="bower-integration.html">Bower Integration</a></nav>
35
-
36
-
37
- <h1 id="bower-integration">Bower Integration</h1>
38
-
39
- <p>Utopia integrates with Bower and provides a rake task to improve deployment of <code>dist</code> code.</p>
40
-
41
- <p>By default, utopia includes a <code>.bowerrc</code> file which installs modules into <code>lib/components</code>. This code can then be copied into <code>public/_components</code> using <code>rake bower:update</code>.</p>
42
-
43
- <h2 id="installing-jquery">Installing jQuery</h2>
44
-
45
- <p>Firstly install jquery using bower:</p>
46
-
47
- <pre><code>$ bower install jquery
48
- </code></pre>
49
-
50
- <p>Copy the distribution scripts to <code>public/_components</code>:</p>
51
-
52
- <pre><code>$ rake bower:update
53
- </code></pre>
54
-
55
- <p>Then add the appropriate <code>&lt;script&gt;</code> tags to <code>pages/_page.xnode</code>:</p>
56
-
57
- <pre><code>&lt;script src=&quot;/_components/jquery/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
58
- </code></pre>
59
-
60
- <h2 id="what-does-rake-bowerupdate-do">What does <code>rake bower:update</code> do?</h2>
61
-
62
- <p>This task copies only the contents of the dist directory. This ensures that you only get files intended for distribution. If the bower package doesn’t have a <code>dist</code> directory, the entire contents is copied.</p>
63
-
64
- <fragment:listing rel="site" src="tasks/bower.rake" brush="ruby"/>
65
-
66
-
67
-
68
- <footer>
69
- Last Modified: 2017-05-03 14:21:19 +1200 —
70
- </footer>
71
-
72
- </div>
73
- </body>
74
- </html>
@@ -1,74 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
-
5
- <title>Bower Integration - Utopia</title>
6
-
7
- <meta charset="UTF-8"/>
8
-
9
- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"/>
10
-
11
- <link rel="icon" type="image/png" href="../../_static/icon.png"/>
12
- <link rel="stylesheet" href="../../_static/site.css" type="text/css" media="screen"/>
13
-
14
- <script src="../../_components/jquery/jquery.min.js"></script>
15
- <script src="../../_components/jquery-syntax/jquery.syntax.min.js"></script>
16
-
17
- <script type="text/javascript">
18
- //<![CDATA[
19
- jQuery(function($) {
20
- $.syntax();
21
- });
22
- //]]>
23
- </script>
24
- </head>
25
-
26
- <body class="">
27
- <header>
28
- <img src="../../_static/utopia.svg"/>
29
- </header>
30
-
31
- <div id="page">
32
-
33
- <nav>
34
- › <a href="../../wiki.html">Wiki</a> › <a href="../bower-integration.html">Bower Integration</a></nav>
35
-
36
-
37
- <h1 id="bower-integration">Bower Integration</h1>
38
-
39
- <p>Utopia integrates with Bower and provides a rake task to improve deployment of <code>dist</code> code.</p>
40
-
41
- <p>By default, utopia includes a <code>.bowerrc</code> file which installs modules into <code>lib/components</code>. This code can then be copied into <code>public/_components</code> using <code>rake bower:update</code>.</p>
42
-
43
- <h2 id="installing-jquery">Installing jQuery</h2>
44
-
45
- <p>Firstly install jquery using bower:</p>
46
-
47
- <pre><code>$ bower install jquery
48
- </code></pre>
49
-
50
- <p>Copy the distribution scripts to <code>public/_components</code>:</p>
51
-
52
- <pre><code>$ rake bower:update
53
- </code></pre>
54
-
55
- <p>Then add the appropriate <code>&lt;script&gt;</code> tags to <code>pages/_page.xnode</code>:</p>
56
-
57
- <pre><code>&lt;script src=&quot;/_components/jquery/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
58
- </code></pre>
59
-
60
- <h2 id="what-does-rake-bowerupdate-do">What does <code>rake bower:update</code> do?</h2>
61
-
62
- <p>This task copies only the contents of the dist directory. This ensures that you only get files intended for distribution. If the bower package doesn’t have a <code>dist</code> directory, the entire contents is copied.</p>
63
-
64
- <fragment:listing rel="site" src="tasks/bower.rake" brush="ruby"/>
65
-
66
-
67
-
68
- <footer>
69
- Last Modified: 2017-05-03 14:21:19 +1200 —
70
- </footer>
71
-
72
- </div>
73
- </body>
74
- </html>
@@ -1,4 +0,0 @@
1
- {
2
- "directory": "lib/components",
3
- "public": "public/_components"
4
- }