abraham 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 934942f3a067c17e06029f1095f7abf5b570d5e7b63a8d16601769df4d3300e1
4
- data.tar.gz: 2389400109634350208fff528edf7c70577982677f34e8af9ef84dcb49aa9d5a
3
+ metadata.gz: d6094c0e5929d5da7e61f12bd1e60a11e450a05e2c3b99afc349b0b7d847edca
4
+ data.tar.gz: 2b6df2f7d73f7b0c312b13ca3bc5adf16452437f1fd97faea90468093193f5fa
5
5
  SHA512:
6
- metadata.gz: ec5c02fcd3b19038b65b9a3af6ce3d84f585c47e465a914021d05a18c340665fb1891fb590fb76b332a05eb5d7e6736e89aba9e854cf94ad0acb921c4cc623ce
7
- data.tar.gz: c00a73dfe7269459459fadaa4db889de665ec0601273fa431d94372cf38383e4f0a5c1b5959fbf0a7f5ea681fb149948dadc2ec4670e09941b54356979500274
6
+ metadata.gz: 978175580bd5132ea570ea0c14421f6ac0def8ca523ce5dfea730c3934c49180c6f9909fd35f161190afddf02aade22c9d447cb74546c419d8cd143e77129d3e
7
+ data.tar.gz: 9c46128409adfc46ed76abe7f07601d4e5035c63641c13e50b747e51a2e532910326ed77f63f7b2406feb4f5930feb8dbdbe10e5b660f858409f1ce7cf8f186c
data/README.md CHANGED
@@ -15,7 +15,8 @@ Abraham injects dynamically-generated [Shepherd](https://shepherdjs.dev/) JavaSc
15
15
 
16
16
  ## Requirements
17
17
 
18
- Abraham needs to know the current user to track tour views, e.g. `current_user` from Devise.
18
+ * Abraham needs to know the current user to track tour views, e.g. `current_user` from Devise.
19
+ * Abraham is tested on Rails 5.2, 6.0, and 6.1
19
20
 
20
21
  ## Installation
21
22
 
@@ -95,7 +96,7 @@ NB: You must specify a locale in the filename, even if you're only supporting on
95
96
 
96
97
  ### Tour content
97
98
 
98
- A tour is composed of a series of steps. A step may have a title and must have a description. You may attach a step to a particular element on the page, and place the callout to the left, right, top, or bottom.
99
+ A tour is composed of a series of steps. A step may have a title and must have a description. You may attach a step to a particular element on the page, and place the callout in a particular position (see below).
99
100
 
100
101
  ```yaml
101
102
  intro:
@@ -122,6 +123,18 @@ Abraham takes care of which buttons should appear with each step:
122
123
  * "Exit" and "Next" buttons on intermediate steps
123
124
  * "Done" button on the last step
124
125
 
126
+ When you specify an `attachTo` element, use the `placement` option to choose where the callout should appear relative to that element:
127
+
128
+ * `bottom` / `bottom center`
129
+ * `bottom left`
130
+ * `bottom right`
131
+ * `center` / `middle` / `middle center`
132
+ * `left` / `middle left'
133
+ * `right` / `middle right`
134
+ * `top` / `top center`
135
+ * `top left`
136
+ * `top right`
137
+
125
138
  Abraham tries to be helpful when your tour steps attach to page elements that are missing:
126
139
 
127
140
  * If your first step is attached to a particular element, and that element is not present on the page, the tour won't start. ([#28](https://github.com/actmd/abraham/issues/28))
@@ -161,10 +174,26 @@ If you have any trouble at all, please [submit an issue](https://github.com/actm
161
174
 
162
175
  Contributions are welcome!
163
176
 
164
- Create a feature branch (using git-flow) and submit as a pull request.
177
+ Create a feature branch (using git-flow) and submit as a pull request (with a base branch of `develop`).
165
178
 
166
179
  Everyone interacting in Abraham's codebase, issue tracker, etc. is expected to follow the [Contributor Covenent Code of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct).
167
180
 
181
+ ### Getting started with the source code
182
+
183
+ Abraham uses `rvm` with a gemset to ensure the appropriate version of Ruby and its dependencies. Make sure that's installed before you get started.
184
+
185
+ ```
186
+ ~ git clone git@github.com:actmd/abraham.git
187
+ Cloning into 'abraham'...
188
+ ~ cd abraham
189
+ ruby-2.5.3 - #gemset created /Users/jon/.rvm/gems/ruby-2.5.3@abraham
190
+ ruby-2.5.3 - #generating abraham wrappers - please wait
191
+ ~ bundle install
192
+ Bundle complete! 13 Gemfile dependencies, 73 gems now installed.
193
+ Use `bundle info [gemname]` to see where a bundled gem is installed.
194
+ ~ yarn install
195
+ ```
196
+
168
197
  ### Testing
169
198
 
170
199
  #### Testing locally
@@ -183,7 +212,7 @@ gem 'abraham', path: '~/Workspace/abraham'
183
212
 
184
213
  #### Automated testing
185
214
 
186
- We use TravisCI to automatically test this engine with Rails 5.1, 5.2, and 6.0. For test history, venture over to [TravisCI](https://travis-ci.com/actmd/abraham).
215
+ We use TravisCI to automatically test this engine with Rails 5.2, 6.0, and 6.1. For test history, venture over to [TravisCI](https://travis-ci.com/actmd/abraham).
187
216
 
188
217
  ### Releasing
189
218
 
data/Rakefile CHANGED
@@ -26,10 +26,10 @@ require "bundler/gem_tasks"
26
26
  require "rake/testtask"
27
27
 
28
28
  Rake::TestTask.new(:test) do |t|
29
- t.libs << "lib"
30
29
  t.libs << "test"
31
30
  t.pattern = "test/**/*_test.rb"
32
31
  t.verbose = false
32
+ t.warning = false
33
33
  end
34
34
 
35
35
  task default: :test
@@ -1,8 +1,7 @@
1
- //= require jquery
2
1
  //= require js-cookie/src/js.cookie
3
2
  //= require shepherd.js/dist/js/shepherd
4
3
 
5
- $(document).on('turbolinks:before-cache', function() {
6
- // Remove visible product tours
7
- $(".shepherd-step").remove();
4
+ document.addEventListener('turbolinks:before-cache', function() {
5
+ // Remove visible product tours
6
+ document.querySelectorAll(".shepherd-element").forEach(function(el) { el.remove() });
8
7
  });
@@ -15,7 +15,6 @@ class AbrahamHistoriesController < ApplicationController
15
15
 
16
16
  private
17
17
 
18
- # Never trust parameters from the scary internet, only allow the white list through.
19
18
  def abraham_history_params
20
19
  params.require(:abraham_history).permit(:controller_name, :action_name, :tour_name)
21
20
  end
@@ -2,13 +2,11 @@
2
2
  var tour = new Shepherd.Tour(<%= Rails.configuration.abraham.tour_options.html_safe unless Rails.configuration.abraham.tour_options.nil? %>);
3
3
 
4
4
  tour.on("complete", function() {
5
- // ajax
6
- return $.ajax({
7
- url: "/abraham_histories/",
8
- type: "POST",
9
- dataType: "json",
10
- contentType: "application/json",
11
- data: JSON.stringify({
5
+ // Make AJAX call to save history of tour completion
6
+ return fetch("/abraham_histories/", {
7
+ method: "POST",
8
+ headers: { 'Content-Type': 'application/json' },
9
+ body: JSON.stringify({
12
10
  authenticity_token: '<%= form_authenticity_token %>',
13
11
  controller_name: '<%= controller_name %>',
14
12
  action_name: '<%= action_name %>',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Abraham
4
- VERSION = "2.1.2"
4
+ VERSION = "2.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abraham
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Abbett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2021-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sassc-rails
@@ -115,7 +115,7 @@ homepage: https://github.com/actmd/abraham
115
115
  licenses:
116
116
  - MIT
117
117
  metadata: {}
118
- post_install_message:
118
+ post_install_message:
119
119
  rdoc_options: []
120
120
  require_paths:
121
121
  - lib
@@ -130,9 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubyforge_project:
134
- rubygems_version: 2.7.6
135
- signing_key:
133
+ rubygems_version: 3.0.8
134
+ signing_key:
136
135
  specification_version: 4
137
136
  summary: Trackable application tours for Rails with i18n support, based on Shepherd.js.
138
137
  test_files: []