hopskip 0.1.2 → 0.1.3

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.
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 `x` is the name of the controller.
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
- index:
33
- steps:
34
- - title: Welcome to My App
35
- content: "Some Text..."
36
- target: left_util
37
- placement: right
38
-
39
- - title: Dashboard
40
- content: "This is your dashboard"
41
- target: left_util
42
- placement: bottom
43
- show:
44
- steps:
45
- - title: another title...
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
 
@@ -1,3 +1,3 @@
1
1
  module Hopskip
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -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
   (0.1ms) rollback transaction
1305
+ Connecting to database specified by database.yml
1306
+  (0.5ms) begin transaction
1307
+  (0.1ms) rollback transaction
1308
+  (0.1ms) begin transaction
1309
+  (0.0ms) rollback transaction
1310
+  (0.0ms) begin transaction
1311
+  (0.0ms) rollback transaction
1312
+  (0.1ms) begin transaction
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
+  (0.1ms) rollback transaction
1318
+  (0.1ms) begin transaction
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
+  (0.1ms) rollback transaction
1324
+ Connecting to database specified by database.yml
1325
+  (0.3ms) begin transaction
1326
+  (0.1ms) rollback transaction
1327
+  (0.0ms) begin transaction
1328
+  (0.0ms) rollback transaction
1329
+  (0.0ms) begin transaction
1330
+  (0.0ms) rollback transaction
1331
+  (0.1ms) begin transaction
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
+  (0.1ms) rollback transaction
1337
+  (0.1ms) begin transaction
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
+  (0.1ms) rollback transaction
@@ -3,7 +3,6 @@ require 'test_helper'
3
3
  class UserFlowsTest < ActionDispatch::IntegrationTest
4
4
  test '#index shows the hopscotch' do
5
5
  get '/people'
6
- puts @response.body
7
6
  assert_tag tag: 'script', parent: { :tag => 'body' }
8
7
  assert_response :success
9
8
  end
data/test/test_helper.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  # Configure Rails Environment
2
+ require 'coveralls'
3
+ Coveralls.wear!
2
4
  ENV["RAILS_ENV"] = "test"
3
5
 
4
6
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
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.2
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-10 00:00:00.000000000 Z
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
- - MIT-LICENSE
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: -4064894685666321658
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: -4064894685666321658
147
+ hash: 1049451874999815942
148
148
  requirements: []
149
149
  rubyforge_project:
150
150
  rubygems_version: 1.8.25