hopskip 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/{MIT-LICENSE → LICENCE.md} +0 -0
- data/README.md +57 -18
- data/lib/hopskip/hopscotch_parser.rb +0 -3
- data/lib/hopskip/version.rb +1 -1
- data/test/dummy/log/test.log +38 -0
- data/test/dummy/test/integration/user_flows_test.rb +0 -1
- data/test/test_helper.rb +2 -0
- metadata +5 -5
data/{MIT-LICENSE → LICENCE.md}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -2,9 +2,15 @@
|
|
2
2
|
|
3
3
|
[![Code Climate](https://codeclimate.com/github/boxuk/hopskip.png)](https://codeclimate.com/github/boxuk/hopskip)
|
4
4
|
[![Build Status](https://travis-ci.org/boxuk/hopskip.png?branch=master)](https://travis-ci.org/boxuk/hopskip)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/boxuk/hopskip/badge.png?branch=master)](https://coveralls.io/r/boxuk/hopskip?branch=master)
|
5
6
|
|
6
7
|
Write [hopscotch](https://github.com/linkedin/hopscotch) introductions simply by adding YAML files to your Rails application.
|
7
8
|
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
* Rails 3.2+
|
12
|
+
* Hopscotch `js` and `css` files available. You can use just a standard installation in the asset pipeline or [this gem](https://github.com/ccschmitz/hopscotch-rails).
|
13
|
+
|
8
14
|
## Install
|
9
15
|
|
10
16
|
Add `hopskip` to your `Gemfile`
|
@@ -24,29 +30,62 @@ Add the `hopskip` template to your application layout. It doesn't matter where,
|
|
24
30
|
├── dashboards_tour.yml
|
25
31
|
└── projects_tour.yml
|
26
32
|
|
27
|
-
Where each file is name `xyz_tour.yml` where `
|
33
|
+
Where each file is name `xyz_tour.yml` where `xyz` is the name of the controller.
|
28
34
|
|
29
35
|
The contents of each of these files should look similar to this:
|
30
36
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
37
|
+
```YAML
|
38
|
+
---
|
39
|
+
index:
|
40
|
+
steps:
|
41
|
+
- title: Welcome to My App
|
42
|
+
content: "Some Text..."
|
43
|
+
target: left_util
|
44
|
+
placement: right
|
45
|
+
|
46
|
+
- title: Dashboard
|
47
|
+
content: "This is your dashboard"
|
48
|
+
target: left_util
|
49
|
+
placement: bottom
|
50
|
+
show:
|
51
|
+
steps:
|
52
|
+
- title: another title...
|
53
|
+
#...
|
54
|
+
```
|
47
55
|
|
48
56
|
You can generate an example tour file by using the included generator:
|
49
57
|
|
50
58
|
rails generate tour [controller_name]
|
51
59
|
|
52
|
-
For a full list of params, check out the hopscotch docs.
|
60
|
+
For a full list of params, check out the hopscotch docs.
|
61
|
+
|
62
|
+
## Advanced Usage
|
63
|
+
|
64
|
+
You can also attach methods to the `onClose`, `onEnd` and other callback methods included with hopscotch. Simply define a hopscotch helper in your view:
|
65
|
+
|
66
|
+
```JavaScript
|
67
|
+
<script>
|
68
|
+
hopscotch.registerHelper('showError', function() {
|
69
|
+
alert("This is an error!");
|
70
|
+
});
|
71
|
+
</script>
|
72
|
+
```
|
73
|
+
In your tour file, you can now ask that this method is called at various points in the tour's lifecycle:
|
74
|
+
|
75
|
+
```YAML
|
76
|
+
---
|
77
|
+
index:
|
78
|
+
steps:
|
79
|
+
- title: Welcome to My App
|
80
|
+
content: "Some Text..."
|
81
|
+
target: left_util
|
82
|
+
placement: right
|
83
|
+
onNext:
|
84
|
+
- showError
|
85
|
+
```
|
86
|
+
|
87
|
+
The `showError` helper will now be executed when next is clicked on the first step. You can pass as many helpers as you like to each callback methods.
|
88
|
+
|
89
|
+
## We use Hopskip
|
90
|
+
|
91
|
+
We use Hopskip in [FleetSuite](http://www.boxuk.com/fleetsuite/), a business management system offering a set of collaborative project management tools to optimise processes.
|
@@ -9,11 +9,8 @@ module Hopskip
|
|
9
9
|
def initialize(controller)
|
10
10
|
@controller = controller
|
11
11
|
filename = Rails.root.join('app', 'tours', "#{ @controller.controller_name }_tour.yml")
|
12
|
-
puts filename
|
13
12
|
if File.exists?(filename)
|
14
13
|
@yaml_source = YAML::load(File.open("#{ Rails.root }/app/tours/#{ @controller.controller_name }_tour.yml"))
|
15
|
-
else
|
16
|
-
puts 'cannot find file!'
|
17
14
|
end
|
18
15
|
end
|
19
16
|
|
data/lib/hopskip/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1302,3 +1302,41 @@ Processing by PeopleController#show as HTML
|
|
1302
1302
|
Parameters: {"id"=>"1"}
|
1303
1303
|
Completed 200 OK in 3.4ms (Views: 3.0ms | ActiveRecord: 0.0ms)
|
1304
1304
|
[1m[35m (0.1ms)[0m rollback transaction
|
1305
|
+
Connecting to database specified by database.yml
|
1306
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
1307
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1308
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1309
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1310
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1311
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1312
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1313
|
+
Started GET "/people" for 127.0.0.1 at 2013-12-11 11:13:07 +0000
|
1314
|
+
Processing by PeopleController#index as HTML
|
1315
|
+
Rendered people/index.html.erb within layouts/application (2.8ms)
|
1316
|
+
Completed 200 OK in 18.8ms (Views: 18.3ms | ActiveRecord: 0.0ms)
|
1317
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1318
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1319
|
+
Started GET "/people/1" for 127.0.0.1 at 2013-12-11 11:13:07 +0000
|
1320
|
+
Processing by PeopleController#show as HTML
|
1321
|
+
Parameters: {"id"=>"1"}
|
1322
|
+
Completed 200 OK in 2.8ms (Views: 2.5ms | ActiveRecord: 0.0ms)
|
1323
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1324
|
+
Connecting to database specified by database.yml
|
1325
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
1326
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1327
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1328
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1329
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1330
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1331
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1332
|
+
Started GET "/people" for 127.0.0.1 at 2013-12-11 11:40:37 +0000
|
1333
|
+
Processing by PeopleController#index as HTML
|
1334
|
+
Rendered people/index.html.erb within layouts/application (2.4ms)
|
1335
|
+
Completed 200 OK in 35.1ms (Views: 34.5ms | ActiveRecord: 0.0ms)
|
1336
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1337
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1338
|
+
Started GET "/people/1" for 127.0.0.1 at 2013-12-11 11:40:37 +0000
|
1339
|
+
Processing by PeopleController#show as HTML
|
1340
|
+
Parameters: {"id"=>"1"}
|
1341
|
+
Completed 200 OK in 3.0ms (Views: 2.7ms | ActiveRecord: 0.0ms)
|
1342
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hopskip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- lib/hopskip/version.rb
|
73
73
|
- lib/hopskip.rb
|
74
74
|
- lib/tasks/hopskip_tasks.rake
|
75
|
-
-
|
75
|
+
- LICENCE.md
|
76
76
|
- Rakefile
|
77
77
|
- README.md
|
78
78
|
- test/dummy/app/assets/javascripts/application.js
|
@@ -135,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
segments:
|
137
137
|
- 0
|
138
|
-
hash:
|
138
|
+
hash: 1049451874999815942
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
none: false
|
141
141
|
requirements:
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
segments:
|
146
146
|
- 0
|
147
|
-
hash:
|
147
|
+
hash: 1049451874999815942
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
150
|
rubygems_version: 1.8.25
|