utopia 2.5.5 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/Gemfile +1 -0
- data/Rakefile +2 -0
- data/docs/code/Utopia.html +439 -433
- data/docs/code/Utopia/Command.html +201 -195
- data/docs/code/Utopia/Command/Environment.html +244 -244
- data/docs/code/Utopia/Command/Server.html +202 -202
- data/docs/code/Utopia/Command/Server/Create.html +192 -192
- data/docs/code/Utopia/Command/Server/Update.html +235 -235
- data/docs/code/Utopia/Command/Site.html +269 -263
- data/docs/code/Utopia/Command/Site/Create.html +192 -192
- data/docs/code/Utopia/Command/Site/Update.html +246 -246
- data/docs/code/Utopia/Command/Top.html +244 -244
- data/docs/code/Utopia/Content.html +636 -630
- data/docs/code/Utopia/Content/Document.html +1411 -1407
- data/docs/code/Utopia/Content/Document/State.html +1048 -1048
- data/docs/code/Utopia/Content/Link.html +1023 -1023
- data/docs/code/Utopia/Content/Links.html +629 -623
- data/docs/code/Utopia/Content/MarkupParser.html +702 -702
- data/docs/code/Utopia/Content/MarkupParser/ParsedTag.html +375 -375
- data/docs/code/Utopia/Content/MarkupParser/UnbalancedTagError.html +523 -523
- data/docs/code/Utopia/Content/Namespace.html +416 -416
- data/docs/code/Utopia/Content/Node.html +952 -952
- data/docs/code/Utopia/Content/Node/Context.html +790 -790
- data/docs/code/Utopia/Content/Response.html +686 -686
- data/docs/code/Utopia/Content/SymbolicHash.html +365 -365
- data/docs/code/Utopia/Content/Tags.html +134 -134
- data/docs/code/Utopia/Content/UnbalancedTagError.html +270 -270
- data/docs/code/Utopia/ContentLength.html +298 -294
- data/docs/code/Utopia/Controller.html +657 -651
- data/docs/code/Utopia/Controller/Actions.html +260 -260
- data/docs/code/Utopia/Controller/Actions/Action.html +785 -779
- data/docs/code/Utopia/Controller/Actions/ClassMethods.html +360 -360
- data/docs/code/Utopia/Controller/Base.html +989 -989
- data/docs/code/Utopia/Controller/Respond.html +264 -254
- data/docs/code/Utopia/Controller/Respond/ClassMethods.html +207 -207
- data/docs/code/Utopia/Controller/Respond/Converter.html +219 -219
- data/docs/code/Utopia/Controller/Respond/Converter/Callback.html +425 -425
- data/docs/code/Utopia/Controller/Respond/Converter/ToJSON.html +323 -317
- data/docs/code/Utopia/Controller/Respond/Passthrough.html +266 -260
- data/docs/code/Utopia/Controller/Respond/Responder.html +449 -443
- data/docs/code/Utopia/Controller/Rewrite.html +260 -260
- data/docs/code/Utopia/Controller/Rewrite/ClassMethods.html +216 -216
- data/docs/code/Utopia/Controller/Rewrite/ExtractPrefixRule.html +303 -303
- data/docs/code/Utopia/Controller/Rewrite/Rewriter.html +402 -402
- data/docs/code/Utopia/Controller/Rewrite/Rule.html +193 -193
- data/docs/code/Utopia/Controller/Variables.html +428 -428
- data/docs/code/Utopia/Controllers.html +216 -216
- data/docs/code/Utopia/Exceptions.html +125 -125
- data/docs/code/Utopia/Exceptions/Handler.html +405 -405
- data/docs/code/Utopia/Exceptions/Mailer.html +400 -394
- data/docs/code/Utopia/Extensions.html +116 -116
- data/docs/code/Utopia/Extensions/ArraySplit.html +164 -164
- data/docs/code/Utopia/Extensions/DateTimeComparison.html +173 -173
- data/docs/code/Utopia/Extensions/TimeDateComparison.html +173 -173
- data/docs/code/Utopia/HTTP.html +193 -187
- data/docs/code/Utopia/HTTP/Status.html +355 -355
- data/docs/code/Utopia/Locale.html +522 -522
- data/docs/code/Utopia/Localization.html +886 -880
- data/docs/code/Utopia/Localization/Wrapper.html +403 -403
- data/docs/code/Utopia/Logger.html +185 -185
- data/docs/code/Utopia/Logger/CompactFormatter.html +290 -290
- data/docs/code/Utopia/Path.html +2562 -2556
- data/docs/code/Utopia/Path/Matcher.html +395 -395
- data/docs/code/Utopia/Path/Matcher/MatchData.html +418 -418
- data/docs/code/Utopia/Redirection.html +148 -142
- data/docs/code/Utopia/Redirection/ClientRedirect.html +594 -594
- data/docs/code/Utopia/Redirection/DirectoryIndex.html +265 -265
- data/docs/code/Utopia/Redirection/Errors.html +391 -385
- data/docs/code/Utopia/Redirection/Moved.html +265 -265
- data/docs/code/Utopia/Redirection/RequestFailure.html +201 -201
- data/docs/code/Utopia/Redirection/Rewrite.html +265 -265
- data/docs/code/Utopia/Session.html +723 -717
- data/docs/code/Utopia/Session/LazyHash.html +709 -709
- data/docs/code/Utopia/Setup.html +783 -777
- data/docs/code/Utopia/Static.html +516 -510
- data/docs/code/Utopia/Static/LocalFile.html +875 -869
- data/docs/code/Utopia/Static/MimeTypeLoader.html +427 -427
- data/docs/code/Utopia/Static/MimeTypeLoader/ExpansionError.html +123 -123
- data/docs/code/_index.html +757 -757
- data/docs/code/class_list.html +51 -51
- data/docs/code/css/full_list.css +58 -58
- data/docs/code/css/style.css +496 -499
- data/docs/code/file.README.html +72 -70
- data/docs/code/file_list.html +56 -56
- data/docs/code/frames.html +17 -17
- data/docs/code/index.html +72 -70
- data/docs/code/js/app.js +292 -248
- data/docs/code/js/full_list.js +216 -216
- data/docs/code/js/jquery.js +3 -3
- data/docs/code/method_list.html +3443 -3443
- data/docs/code/top-level-namespace.html +109 -109
- data/docs/index.html +2 -2
- data/docs/wiki.html +2 -2
- data/docs/wiki/edit.html +1 -1
- data/docs/wiki/javascript.html +153 -0
- data/docs/wiki/javascript/index.html +153 -0
- data/documentation/.yarnrc +1 -0
- data/documentation/Gemfile +1 -0
- data/documentation/config/environment.rb +1 -0
- data/documentation/pages/wiki/content.md +1 -1
- data/documentation/pages/wiki/javascript/content.md +75 -0
- data/documentation/pages/wiki/links.yaml +3 -1
- data/lib/utopia/command/site.rb +4 -4
- data/lib/utopia/version.rb +1 -1
- data/setup/site/.yarnrc +1 -0
- data/setup/site/tasks/yarn.rake +32 -0
- data/spec/utopia/command_spec.rb +2 -2
- metadata +8 -9
- data/docs/wiki/bower-integration.html +0 -74
- data/docs/wiki/bower-integration/index.html +0 -74
- data/documentation/.bowerrc +0 -4
- data/documentation/pages/wiki/bower-integration/content.md +0 -25
- data/setup/.bowerrc +0 -3
- data/setup/site/.bowerrc +0 -4
- data/setup/site/tasks/bower.rake +0 -45
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--modules-folder lib/components
|
data/documentation/Gemfile
CHANGED
|
@@ -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](
|
|
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
|
+
```
|
data/lib/utopia/command/site.rb
CHANGED
|
@@ -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 = ['.
|
|
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(
|
|
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", *
|
|
175
|
+
system("git", "add", *Site::CONFIGURATION_FILES) or fail "could not add files"
|
|
176
176
|
|
|
177
177
|
move_static!
|
|
178
178
|
|
data/lib/utopia/version.rb
CHANGED
data/setup/site/.yarnrc
ADDED
|
@@ -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
|
data/spec/utopia/command_spec.rb
CHANGED
|
@@ -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(".
|
|
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[.
|
|
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.
|
|
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-
|
|
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><script></code> tags to <code>pages/_page.xnode</code>:</p>
|
|
56
|
-
|
|
57
|
-
<pre><code><script src="/_components/jquery/jquery.min.js" type="text/javascript"></script>
|
|
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><script></code> tags to <code>pages/_page.xnode</code>:</p>
|
|
56
|
-
|
|
57
|
-
<pre><code><script src="/_components/jquery/jquery.min.js" type="text/javascript"></script>
|
|
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>
|
data/documentation/.bowerrc
DELETED